Jump to: navigation, search

Scout/Concepts/Bookmark


Scout
Wiki Home
Website
DownloadGit
Community
ForumsBlogTwitter
Bugzilla
Bugzilla


Bookmarks are a way to represent a position (which page is selected, what is expanded...) in a outline based application.

class: C obj.pngBookmark

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