Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Scout/Concepts/Bookmark

< Scout‎ | Concepts
Revision as of 03:55, 11 June 2013 by Jeremie.bresson.unblu.com (Talk | contribs) (New page: {{ScoutPage|cat=Client}} Bookmarks are a way to represent a position (which {{ScoutLink|Concepts|Page|page}} is selected, what is expanded...) in a {{ScoutLink|Concepts|Outline_based_appl...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Scout documentation has been moved to https://eclipsescout.github.io/.

Bookmarks are a way to represent a position (which The Scout documentation has been moved to https://eclipsescout.github.io/. is selected, what is expanded...) in a The Scout documentation has been moved to https://eclipsescout.github.io/..

class: The Scout documentation has been moved to https://eclipsescout.github.io/.

Description

Note.png
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.png
TODO
Add some screenshots


Create a bookmark

Using the desktop

Note.png
TODO
Add a code snippet


Using the Bookmark Service

Note.png
TODO
Add a code snippet


Programmatically

Here a code sniptet to create the bookmark without any direct page reference:

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);


See also

Back to the top