use of com.vaadin.ui.MenuBar.MenuItem in project Activiti by Activiti.
the class MainMenuBar method initProfileButton.
protected void initProfileButton() {
final LoggedInUser user = ExplorerApp.get().getLoggedInUser();
// User name + link to profile
MenuBar profileMenu = new MenuBar();
profileMenu.addStyleName(ExplorerLayout.STYLE_HEADER_PROFILE_BOX);
MenuItem rootItem = profileMenu.addItem(user.getFirstName() + " " + user.getLastName(), null);
rootItem.setStyleName(ExplorerLayout.STYLE_HEADER_PROFILE_MENU);
if (useProfile()) {
// Show profile
rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_SHOW), new Command() {
public void menuSelected(MenuItem selectedItem) {
ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
}
});
// Edit profile
rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_EDIT), new Command() {
public void menuSelected(MenuItem selectedItem) {
// TODO: Show in edit-mode
ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
}
});
// Change password
rootItem.addItem(i18nManager.getMessage(Messages.PASSWORD_CHANGE), new Command() {
public void menuSelected(MenuItem selectedItem) {
ExplorerApp.get().getViewManager().showPopupWindow(new ChangePasswordPopupWindow());
}
});
rootItem.addSeparator();
}
// Logout
rootItem.addItem(i18nManager.getMessage(Messages.HEADER_LOGOUT), new Command() {
public void menuSelected(MenuItem selectedItem) {
ExplorerApp.get().close();
}
});
addComponent(profileMenu);
setComponentAlignment(profileMenu, Alignment.TOP_RIGHT);
setExpandRatio(profileMenu, 1.0f);
}
use of com.vaadin.ui.MenuBar.MenuItem in project Activiti by Activiti.
the class TaskListHeader method initSortMenu.
protected void initSortMenu() {
MenuBar menuBar = new MenuBar();
menuBar.addStyleName(ExplorerLayout.STYLE_SEARCHBOX_SORTMENU);
//TODO: Adding types of sorting manually and listener/events
MenuItem rootItem = menuBar.addItem("Sort by", null);
rootItem.addItem("Id", null);
rootItem.addItem("Name", null);
rootItem.addItem("Due date", null);
rootItem.addItem("Creation date", null);
layout.addComponent(menuBar);
layout.setComponentAlignment(menuBar, Alignment.MIDDLE_RIGHT);
}
Aggregations