|
|
Line 1: |
Line 1: |
− | {{ScoutPage|cat=Client}}
| + | The Scout documentation has been moved to https://eclipsescout.github.io/. |
− | | + | |
− | Bookmarks are a way to represent a position (which {{ScoutLink|Concepts|Page|page}} is selected, what is expanded...) in a {{ScoutLink|Concepts|Outline_based_application|outline based application}}.
| + | |
− | | + | |
− | class: {{ScoutJavadoc|Bookmark|C}}
| + | |
− | | + | |
− | == Description ==
| + | |
− | {{note|TODO|Add description}}
| + | |
− | | + | |
− | == UI Representation ==
| + | |
− | It is up to each application to decide how it will represent bookmarks. A possibility is to use a bookmark menu. An other possibility is to display them in a list box in a specific form.
| + | |
− | | + | |
− | === Screnshot examples ===
| + | |
− | {{note|TODO|Add some screenshots}}
| + | |
− | | + | |
− | | + | |
− | == Create a bookmark ==
| + | |
− | | + | |
− | === Using the desktop ===
| + | |
− | {{note|TODO|Add a code snippet}}
| + | |
− | | + | |
− | === Using the Bookmark Service ===
| + | |
− | {{note|TODO|Add a code snippet}}
| + | |
− | | + | |
− | === Programmatically ===
| + | |
− | Here a code sniptet to create the bookmark without any direct page reference:
| + | |
− | | + | |
− | <source lang="java">
| + | |
− | Bookmark bm = new Bookmark();
| + | |
− | // outline | + | |
− | bm.setOutlineClassName(StandardOutline.class.getName());
| + | |
− | // invisible root node page !!the class name must be inserted as a string with Kepler!! | + | |
− | NodePageState invisibleRootNodeState = new NodePageState();
| + | |
− | invisibleRootNodeState.setPageClassName("org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutline$InvisibleRootPage");
| + | |
− | invisibleRootNodeState.setExpanded(true);
| + | |
− | bm.addPathElement(invisibleRootNodeState);
| + | |
− | // a node page
| + | |
− | NodePageState childNodePageState = new NodePageState();
| + | |
− | childNodePageState.setPageClassName(ChildNodePage.class.getName());
| + | |
− | childNodePageState.setExpanded(true);
| + | |
− | bm.addPathElement(childNodePageState);
| + | |
− | // a table page with a selected value !! ensure to mark the column as primary key !!!
| + | |
− | TablePageState personsTablePageState = new TablePageState();
| + | |
− | personsTablePageState.setExpanded(true);
| + | |
− | personsTablePageState.setPageClassName(PersonsTablePage.class.getName());
| + | |
− | personsTablePageState.setExpandedChildPrimaryKey(new CompositeObject(2l));
| + | |
− | personsTablePageState.setSelectedChildrenPrimaryKeys(Arrays.asList(new CompositeObject[]{new CompositeObject(2l)}));
| + | |
− | bm.addPathElement(personsTablePageState);
| + | |
− | | + | |
− | // a sub node of the persons table page
| + | |
− | NodePageState companyNodePage = new NodePageState();
| + | |
− | companyNodePage.setExpanded(true);
| + | |
− | companyNodePage.setPageClassName(ChildNodePage.class.getName());
| + | |
− | bm.addPathElement(companyNodePage);
| + | |
− | | + | |
− | // a table page under the
| + | |
− | TablePageState companiesTablePageState = new TablePageState();
| + | |
− | companiesTablePageState.setExpanded(true);
| + | |
− | companiesTablePageState.setPageClassName(CompaniesTablePage.class.getName());
| + | |
− | bm.addPathElement(companiesTablePageState);
| + | |
− | | + | |
− | // activation of the bookmark
| + | |
− | ClientSession.get().getDesktop().activateBookmark(bm, true);
| + | |
− | </source>
| + | |
− | | + | |
− | | + | |
− | == See also ==
| + | |
− | * {{ScoutLink|Concepts|Page}}
| + | |
− | * {{ScoutLink|Concepts|Outline}}
| + | |
− | * {{ScoutLink|Concepts|Outline based application}}
| + | |