... | ... | @@ -1,14 +1,19 @@ |
1 | 1 | [[image:How To API@Pencil-icon.png||style="float: right;"]] |
2 | 2 | |
3 | 3 | |
4 | -= |
|
4 | += Rename page sets via script = | |
5 | 5 | |
6 | - |
|
6 | +{{jbeam-sign/}}-page sets supports localization. The following Script sets the english page name as standard page name for the visible pages in graphic 1 and deletes the english localization after: | |
7 | 7 | |
8 | 8 | {{code language="java"}} |
9 | -import com.AMS.jBEAM.*; | |
10 | -import com.google.common.collect.Iterables; | |
11 | -MultiFileImport mfi = Iterables.getOnlyElement(jC.getComponentsByClass(MultiFileImport.class)); | |
12 | -mfi.refreshImportDataFiles(); | |
13 | -mfi.startSequence(true); | |
9 | +DesktopManager dm = | |
10 | +(DesktopManager)jB.getComponentManager().getDesktopManager(); | |
11 | +GraphLayoutFrame glf = dm.getGraphLayoutFrames().get(0); int pageCount = glf.getActivePages().size(); for (int i = 0; i < pageCount; i++) { jB_MultiLanguageString pageTitle = glf.getPageTitleML(i); String englishTitle = pageTitle.getExactString(Locale.ENGLISH); | |
12 | + if (englishTitle != null && !englishTitle.trim().isEmpty()) { | |
13 | + pageTitle.setString(englishTitle); | |
14 | + pageTitle.setString(null, Locale.ENGLISH); | |
15 | + glf.setPageTitleML(i,pageTitle); | |
16 | + } | |
17 | +} | |
18 | + | |
14 | 14 | {{/code}} |