use of org.eclipse.scout.rt.client.ui.action.menu.MenuSeparator in project scout.rt by eclipse.
the class AbstractBookmarkMenu method addBookmarkTreeInternal.
protected void addBookmarkTreeInternal(BookmarkFolder folder, List<IMenu> actionList) {
for (BookmarkFolder f : folder.getFolders()) {
IMenu group = new MenuSeparator();
group.setSeparator(false);
group.setText(f.getTitle());
group.setIconId(f.getIconId());
List<IMenu> childActionList = new ArrayList<IMenu>();
addBookmarkTreeInternal(f, childActionList);
group.setChildActions(childActionList);
actionList.add(group);
}
List<IMenu> newActions = new ArrayList<>();
for (Bookmark b : folder.getBookmarks()) {
newActions.add(new ActivateBookmarkMenu(b));
}
ActionUtility.initActions(newActions);
actionList.addAll(newActions);
}
use of org.eclipse.scout.rt.client.ui.action.menu.MenuSeparator in project scout.rt by eclipse.
the class AbstractBookmarkMenu method handleBookmarksChanged.
protected void handleBookmarksChanged() {
IBookmarkService service = BEANS.get(IBookmarkService.class);
List<IMenu> oldList = getChildActions();
List<IMenu> newList = new ArrayList<IMenu>();
for (IMenu m : oldList) {
if (m.getClass() == AddUserBookmarkMenu.class) {
newList.add(m);
} else if (m.getClass() == AddGlobalBookmarkMenu.class) {
newList.add(m);
} else if (m.getClass() == ManageBookmarksMenu.class) {
newList.add(m);
} else if (m.getClass() == StartBookmarkMenu.class) {
newList.add(m);
} else if (m.getClass() == Separator1Menu.class) {
newList.add(m);
} else {
// ignore the rest
break;
}
}
// add global bookmarks
newList.add(new MenuSeparator());
addBookmarkTreeInternal(service.getBookmarkData().getGlobalBookmarks(), newList);
// add user bookmarks
newList.add(new MenuSeparator());
addBookmarkTreeInternal(service.getBookmarkData().getUserBookmarks(), newList);
setChildActions(newList);
}
Aggregations