public class CustomApplication extends ProjX { /** the additional button. */ private UIButton butExit; public CustomApplication(UILauncher pLauncher) throws Throwable { super(pLauncher); if (pLauncher.isWebEnvironment()) { Menu menu = getMenu(); menu.removeItem(Menu.EDIT_RELOAD); menu.removeItem(Menu.EDIT_SAVE); menu.removeItem(Menu.EDIT_ROLLBACK); menu.removeItem(Menu.EDIT_UNDO); menu.removeItem(Menu.EDIT_REDO); menu.removeItem(WebMenu.OPTION_HOME); menu.removeItem(WebMenu.OPTION_EXPAND); menu.removeItem(WebMenuCorporation.OPTION_LOGOUT); menu.removeItem(WebMenuCorporation.OPTION_USER); if (menu instanceof WebMenu) { butExit = new UIButton(); butExit.setImage(UIImage.getImage(IFontAwesome.SIGN_OUT_LARGE)); butExit.eventAction().addListener(this, "doLogout"); Style.addStyleNames(butExit, "topbutton"); ((WebMenu)menu).addOption(butExit); } } } @Override public void updateMenu(Menu pMenu) { super.updateMenu(pMenu); if (butExit != null) { butExit.setVisible(isConnected()); } } }