com.google.gwt.user.client.ui.MenuBar Java Examples
The following examples show how to use
com.google.gwt.user.client.ui.MenuBar.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UniTimeTableHeader.java From unitime with Apache License 2.0 | 6 votes |
public UniTimeTableHeader(String title, int colSpan, HorizontalAlignmentConstant align) { super(title, false); iColSpan = colSpan; iAlign = align; iTitle = title; addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final PopupPanel popup = new PopupPanel(true); popup.addStyleName("unitime-Menu"); if (!setMenu(popup)) return; popup.showRelativeTo((Widget)event.getSource()); ((MenuBar)popup.getWidget()).focus(); } }); }
Example #2
Source File: MailMenu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
public MailMenu() { toolBarOption = new ToolBarOption(); // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); create = new MenuItem(Util.menuHTML("img/icon/actions/add_folder.gif", Main.i18n("tree.menu.directory.create")), true, addFolder); create.addStyleName("okm-MenuItem"); dirMenu.addItem(create); remove = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("tree.menu.directory.remove")), true, delFolder); remove.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(remove); rename = new MenuItem(Util.menuHTML("img/icon/actions/rename.gif", Main.i18n("tree.menu.directory.rename")), true, renFolder); rename.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(rename); move = new MenuItem(Util.menuHTML("img/icon/actions/move_folder.gif", Main.i18n("tree.menu.directory.move")), true, moveFolder); move.addStyleName("okm-MenuItem"); dirMenu.addItem(move); copy = new MenuItem(Util.menuHTML("img/icon/actions/copy.gif", Main.i18n("tree.menu.directory.copy")), true, copyFolder); copy.addStyleName("okm-MenuItem"); dirMenu.addItem(copy); dirMenu.setStyleName("okm-MenuBar"); initWidget(dirMenu); }
Example #3
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values searchMenu = new MenuBar(true); download = new MenuItem(Util.menuHTML("img/icon/actions/download.gif", Main.i18n("search.result.menu.download")), true, downloadFile); download.addStyleName("okm-MenuItem"); go = new MenuItem(Util.menuHTML("img/icon/actions/goto_folder.gif", Main.i18n("search.result.menu.go.folder")), true, goDirectory); go.addStyleName("okm-MenuItem"); findSimilarDocument = new MenuItem(Util.menuHTML("img/icon/actions/similar_find.png", Main.i18n("general.menu.file.find.similar.document")), true, findSimilarOKM); findSimilarDocument.addStyleName("okm-MenuItem"); searchMenu.addItem(download); searchMenu.addItem(go); searchMenu.addItem(findSimilarDocument); searchMenu.setStyleName("okm-MenuBar"); initWidget(searchMenu); }
Example #4
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values searchSavedMenu = new MenuBar(true); run = new MenuItem(Util.menuHTML("img/icon/actions/run.gif", Main.i18n("search.saved.run")), true, runSearch); run.addStyleName("okm-MenuItem"); searchSavedMenu.addItem(run); delete = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("search.saved.delete")), true, deleteSearch); delete.addStyleName("okm-MenuItem"); searchSavedMenu.addItem(delete); share = new MenuItem(Util.menuHTML("img/icon/actions/share_query.gif", GeneralComunicator.i18nExtension("messaging.share.query")), true, shareSearch); share.addStyleName("okm-MenuItem"); searchSavedMenu.addStyleName("okm-MenuBar"); initWidget(searchSavedMenu); }
Example #5
Source File: CategoriesMenu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
public CategoriesMenu() { toolBarOption = new ToolBarOption(); // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); create = new MenuItem(Util.menuHTML("img/icon/actions/add_folder.gif", Main.i18n("tree.menu.directory.create")), true, addFolder); create.addStyleName("okm-MenuItem"); dirMenu.addItem(create); rename = new MenuItem(Util.menuHTML("img/icon/actions/rename.gif", Main.i18n("tree.menu.directory.rename")), true, renFolder); rename.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(rename); move = new MenuItem(Util.menuHTML("img/icon/actions/move_folder.gif", Main.i18n("tree.menu.directory.move")), true, moveFolder); move.addStyleName("okm-MenuItem"); dirMenu.addItem(move); dirMenu.setStyleName("okm-MenuBar"); export = new MenuItem(Util.menuHTML("img/icon/actions/export.gif", Main.i18n("tree.menu.export")), true, exportToFile); export.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(export); initWidget(dirMenu); }
Example #6
Source File: TrashMenu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
public TrashMenu() { toolBarOption = new ToolBarOption(); // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); restore = new MenuItem(Util.menuHTML("img/icon/actions/restore.gif", Main.i18n("general.menu.file.restore")), true, restoreFolder); restore.addStyleName("okm-MenuItem"); dirMenu.addItem(restore); purge = new MenuItem(Util.menuHTML("img/icon/actions/purge.gif", Main.i18n("general.menu.file.purge")), true, purgeFolder); purge.addStyleName("okm-MenuItem"); dirMenu.addItem(purge); purgeTrash = new MenuItem(Util.menuHTML("img/icon/actions/purge_trash.gif", Main.i18n("general.menu.file.purge.trash")), true, purgeTrashFolder); purgeTrash.addStyleName("okm-MenuItem"); dirMenu.addItem(purgeTrash); dirMenu.setStyleName("okm-MenuBar"); initWidget(dirMenu); }
Example #7
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values searchSavedMenu = new MenuBar(true); run = new MenuItem(Util.menuHTML("img/icon/actions/run.gif", Main.i18n("search.saved.run")), true, runSearch); run.addStyleName("okm-MenuItem"); searchSavedMenu.addItem(run); delete = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("search.saved.delete")), true, deleteSearch); delete.addStyleName("okm-MenuItem"); searchSavedMenu.addItem(delete); share = new MenuItem(Util.menuHTML("img/icon/actions/share_query.gif", GeneralComunicator.i18nExtension("messaging.share.query")), true, shareSearch); share.addStyleName("okm-MenuItem"); searchSavedMenu.addStyleName("okm-MenuBar"); initWidget(searchSavedMenu); }
Example #8
Source File: FindToolBarMenu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * ResizeToolBarMenu */ public FindToolBarMenu() { // Establishes auto-close when click outside super(true, true); toolBarOption = new ToolBarOption(); dirMenu = new MenuBar(true); dirMenu.setStyleName("okm-SubMenuBar"); findFolder = new MenuItem(Util.menuHTML("img/icon/actions/folder_find.gif", Main.i18n("general.menu.file.find.folder")), true, findFolderOKM); findDocument = new MenuItem(Util.menuHTML("img/icon/actions/document_find.png", Main.i18n("general.menu.file.find.document")), true, findDocumentOKM); findSimilarDocument = new MenuItem(Util.menuHTML("img/icon/actions/similar_find.png", Main.i18n("general.menu.file.find.similar.document")), true, findSimilarOKM); dirMenu.addItem(findFolder); dirMenu.addItem(findDocument); dirMenu.addItem(findSimilarDocument); setWidget(dirMenu); }
Example #9
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values mailMenu = new MenuBar(true); all = new MenuItem(Util.menuHTML("img/icon/actions/select_all.png", Main.i18n("mail.menu.show.all")), true, commandShowAll); all.addStyleName("okm-MenuItem"); mailMenu.addItem(all); cc = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.cc")), true, commandShowCC); cc.addStyleName("okm-MenuItem"); mailMenu.addItem(cc); bcc = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.bcc")), true, commandShowBCC); bcc.addStyleName("okm-MenuItem"); mailMenu.addItem(bcc); reply = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.reply")), true, commandShowReply); reply.addStyleName("okm-MenuItem"); mailMenu.addItem(reply); extra = new MenuItem(Util.menuHTML("img/white_page.png", Main.i18n("mail.menu.show.extre")), true, commandShowExtra); extra.addStyleName("okm-MenuItem"); mailMenu.addItem(extra); mailMenu.addStyleName("okm-MenuBar"); initWidget(mailMenu); }
Example #10
Source File: Bookmark.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Resets all widgets on menu */ private void resetMenu() { if (!bookmarks.isEmpty()) { MenuBar subMenuBookmark = Main.get().mainPanel.topPanel.mainMenu.subMenuBookmark; for (Iterator<MenuItem> it = bookmarks.iterator(); it.hasNext(); ) { subMenuBookmark.removeItem(it.next()); } } }
Example #11
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values menu = new MenuBar(true); delete = new MenuItem(UtilComunicator.menuHTML("img/icon/actions/delete.png", GeneralComunicator.i18nExtension("messaging.message.delete")), true, deletePropose); delete.addStyleName("okm-MenuItem"); menu.addItem(delete); menu.setStyleName("okm-MenuBar"); initWidget(menu); }
Example #12
Source File: PersonalMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * PersonalMenu */ public PersonalMenu() { toolBarOption = new ToolBarOption(); // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); create = new MenuItem(Util.menuHTML("img/icon/actions/add_folder.gif", Main.i18n("tree.menu.directory.create")), true, addFolder); create.addStyleName("okm-MenuItem"); dirMenu.addItem(create); remove = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("tree.menu.directory.remove")), true, delFolder); remove.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(remove); rename = new MenuItem(Util.menuHTML("img/icon/actions/rename.gif", Main.i18n("tree.menu.directory.rename")), true, renFolder); rename.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(rename); move = new MenuItem(Util.menuHTML("img/icon/actions/move_folder.gif", Main.i18n("tree.menu.directory.move")), true, moveFolder); move.addStyleName("okm-MenuItem"); dirMenu.addItem(move); copy = new MenuItem(Util.menuHTML("img/icon/actions/copy.gif", Main.i18n("tree.menu.directory.copy")), true, copyFolder); copy.addStyleName("okm-MenuItem"); dirMenu.addItem(copy); export = new MenuItem(Util.menuHTML("img/icon/actions/export.gif", Main.i18n("tree.menu.export")), true, exportToFile); export.addStyleName("okm-MenuItem"); dirMenu.addItem(export); dirMenu.setStyleName("okm-MenuBar"); initWidget(dirMenu); }
Example #13
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values attachMenu = new MenuBar(true); download = new MenuItem(Util.menuHTML("img/icon/actions/download.gif", Main.i18n("filebrowser.menu.download")), true, downloadFile); download.addStyleName("okm-MenuItem"); attachMenu.addItem(download); copy = new MenuItem(Util.menuHTML("img/icon/actions/copy.gif", Main.i18n("general.menu.edit.copy")), true, copyAttachment); copy.addStyleName("okm-MenuItem"); attachMenu.addItem(copy); attachMenu.addStyleName("okm-MenuBar"); initWidget(attachMenu); }
Example #14
Source File: MetadataMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
public MetadataMenu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); initWidget(dirMenu); }
Example #15
Source File: TemplateMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
public TemplateMenu() { toolBarOption = new ToolBarOption(); // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); create = new MenuItem(Util.menuHTML("img/icon/actions/add_folder.gif", Main.i18n("tree.menu.directory.create")), true, addFolder); create.addStyleName("okm-MenuItem"); dirMenu.addItem(create); remove = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("tree.menu.directory.remove")), true, delFolder); remove.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(remove); rename = new MenuItem(Util.menuHTML("img/icon/actions/rename.gif", Main.i18n("tree.menu.directory.rename")), true, renFolder); rename.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(rename); move = new MenuItem(Util.menuHTML("img/icon/actions/move_folder.gif", Main.i18n("tree.menu.directory.move")), true, moveFolder); move.addStyleName("okm-MenuItem"); dirMenu.addItem(move); copy = new MenuItem(Util.menuHTML("img/icon/actions/copy.gif", Main.i18n("tree.menu.directory.copy")), true, copyFolder); copy.addStyleName("okm-MenuItem"); dirMenu.addItem(copy); export = new MenuItem(Util.menuHTML("img/icon/actions/export.gif", Main.i18n("tree.menu.export")), true, exportToFile); export.addStyleName("okm-MenuItem"); dirMenu.addItem(export); dirMenu.setStyleName("okm-MenuBar"); initWidget(dirMenu); }
Example #16
Source File: ThesaurusMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
public ThesaurusMenu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); initWidget(dirMenu); }
Example #17
Source File: TaxonomyMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
public TaxonomyMenu() { toolBarOption = new ToolBarOption(); // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); create = new MenuItem(Util.menuHTML("img/icon/actions/add_folder.gif", Main.i18n("tree.menu.directory.create")), true, addFolder); create.addStyleName("okm-MenuItem"); dirMenu.addItem(create); remove = new MenuItem(Util.menuHTML("img/icon/actions/delete.gif", Main.i18n("tree.menu.directory.remove")), true, delFolder); remove.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(remove); rename = new MenuItem(Util.menuHTML("img/icon/actions/rename.gif", Main.i18n("tree.menu.directory.rename")), true, renFolder); rename.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(rename); move = new MenuItem(Util.menuHTML("img/icon/actions/move_folder.gif", Main.i18n("tree.menu.directory.move")), true, moveFolder); move.addStyleName("okm-MenuItem"); dirMenu.addItem(move); copy = new MenuItem(Util.menuHTML("img/icon/actions/copy.gif", Main.i18n("tree.menu.directory.copy")), true, copyFolder); copy.addStyleName("okm-MenuItem"); dirMenu.addItem(copy); addDocument = new MenuItem(Util.menuHTML("img/icon/actions/add_document.gif", Main.i18n("tree.menu.directory.add.document")), true, addDocumentFolder); addDocument.addStyleName("okm-MenuItem"); dirMenu.addItem(addDocument); bookmark = new MenuItem(Util.menuHTML("img/icon/actions/add_bookmark.gif", Main.i18n("tree.menu.add.bookmark")), true, addBookmark); bookmark.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(bookmark); home = new MenuItem(Util.menuHTML("img/icon/actions/bookmark.gif", Main.i18n("tree.menu.set.home")), true, setHome); home.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(home); export = new MenuItem(Util.menuHTML("img/icon/actions/export.gif", Main.i18n("tree.menu.export")), true, exportToFile); export.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(export); dirMenu.setStyleName("okm-MenuBar"); initWidget(dirMenu); }
Example #18
Source File: CubaGridWidget.java From cuba with Apache License 2.0 | 5 votes |
protected void initDefaultToggles() { MenuBar sidebarMenu = getSidebarMenu(); sidebarMenu.addItem(createSelectAllToggle()); sidebarMenu.addItem(createDeselectAllToggle()); sidebarMenu.addSeparator(); }
Example #19
Source File: CubaTreeGridWidget.java From cuba with Apache License 2.0 | 5 votes |
protected void initDefaultToggles() { MenuBar sidebarMenu = getSidebarMenu(); sidebarMenu.addItem(createSelectAllToggle()); sidebarMenu.addItem(createDeselectAllToggle()); sidebarMenu.addSeparator(); }
Example #20
Source File: GwtMenuBarImplConnector.java From consulo with Apache License 2.0 | 5 votes |
public static void addItems(List<Widget> child, MenuBar bar) { for (Widget widget : child) { if (widget instanceof GwtMenuItemImpl) { bar.addItem(((GwtMenuItemImpl)widget).getItem()); } else if (widget instanceof GwtMenuSeparatorImpl) { bar.addSeparator(); } else if(widget instanceof GwtMenuImpl) { bar.addItem(((GwtMenuImpl)widget).getMenu()); } } }
Example #21
Source File: MainMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * createSubMenu */ private void createSubMenu(String parentFolderPath, String fldName) { MenuBar subMenuFolder = new MenuBar(true); subMenuFolder.setStyleName("okm-SubMenuBar"); MenuItem menuFolder = new MenuItem(Util.menuHTML("img/menuitem_empty.gif", fldName), true, subMenuFolder); menuFolder.addStyleName("okm-MainMenuItem"); fldMenus.put(parentFolderPath + "/" + fldName, subMenuFolder); fldMenus.get(parentFolderPath).addItem(menuFolder); }
Example #22
Source File: ContextMenu.java From appinventor-extensions with Apache License 2.0 | 5 votes |
/** * Creates a new context menu. */ public ContextMenu() { popupPanel = new PopupPanel(true); // autoHide //Enabling Glass under the popups so that clicks on the iframe (blockly) also hide the panel popupPanel.setGlassEnabled(true); popupPanel.setGlassStyleName("none"); //No style is passed (the default grays out the window) menuBar = new MenuBar(true); menuBar.setStylePrimaryName("ode-ContextMenu"); popupPanel.add(menuBar); }
Example #23
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values menu = new MenuBar(true); delete = new MenuItem(UtilComunicator.menuHTML("img/icon/actions/delete.png", GeneralComunicator.i18nExtension("messaging.message.delete")), true, deleteMessageReceived); delete.addStyleName("okm-MenuItem"); menu.addItem(delete); menu.setStyleName("okm-MenuBar"); initWidget(menu); }
Example #24
Source File: TrashMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
public TrashMenu() { toolBarOption = new ToolBarOption(); // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); restoreItem = new MenuItem(Util.menuHTML("img/icon/actions/restore.gif", Main.i18n("general.menu.file.restore")), true, restore); restoreItem.addStyleName("okm-MenuItem"); dirMenu.addItem(restoreItem); purgeItem = new MenuItem(Util.menuHTML("img/icon/actions/purge.gif", Main.i18n("general.menu.file.purge")), true, purge); purgeItem.addStyleName("okm-MenuItem"); dirMenu.addItem(purgeItem); dirMenu.addStyleName("okm-MenuBar"); initWidget(dirMenu); }
Example #25
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values menu = new MenuBar(true); delete = new MenuItem(UtilComunicator.menuHTML("img/icon/actions/delete.png", GeneralComunicator.i18nExtension("messaging.message.delete")), true, deleteMessageSent); delete.addStyleName("okm-MenuItem"); menu.addItem(delete); menu.setStyleName("okm-MenuBar"); initWidget(menu); }
Example #26
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values menu = new MenuBar(true); delete = new MenuItem(UtilComunicator.menuHTML("img/icon/actions/delete.png", GeneralComunicator.i18nExtension("messaging.message.delete")), true, deletePropose); delete.addStyleName("okm-MenuItem"); menu.addItem(delete); menu.setStyleName("okm-MenuBar"); initWidget(menu); }
Example #27
Source File: Menu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Browser menu */ public Menu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values menu = new MenuBar(true); delete = new MenuItem(UtilComunicator.menuHTML("img/icon/actions/delete.png", GeneralComunicator.i18nExtension("messaging.message.delete")), true, deletePropose); delete.addStyleName("okm-MenuItem"); menu.addItem(delete); menu.setStyleName("okm-MenuBar"); initWidget(menu); }
Example #28
Source File: MassiveOperationsMenu.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Category menu */ public MassiveOperationsMenu() { // The item selected must be called on style.css : .okm-MenuBar .gwt-MenuItem-selected // First initialize language values dirMenu = new MenuBar(true); selectAll = new MenuItem(Util.menuHTML("img/icon/actions/select_all.png", Main.i18n("filebrowser.menu.select.all")), true, massiveSelectAll); selectAll.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(selectAll); selectFolders = new MenuItem(Util.menuHTML("img/menuitem_empty.gif", Main.i18n("filebrowser.menu.select.all.folders")), true, massiveSelectFolders); selectFolders.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(selectFolders); selectDocuments = new MenuItem(Util.menuHTML("img/document.png", Main.i18n("filebrowser.menu.select.all.documents")), true, massiveSelectDocuments); selectDocuments.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(selectDocuments); selectMails = new MenuItem(Util.menuHTML("img/email.gif", Main.i18n("filebrowser.menu.select.all.mails")), true, massiveSelectMails); selectMails.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(selectMails); removeSelection = new MenuItem(Util.menuHTML("img/icon/actions/remove_all.png", Main.i18n("filebrowser.menu.remove.selection")), true, massiveRemoveSelection); removeSelection.addStyleName("okm-MenuItem-strike"); dirMenu.addItem(removeSelection); dirMenu.setStyleName("okm-MenuBar"); initWidget(dirMenu); enable(selectAll); enable(selectFolders); enable(selectDocuments); enable(selectMails); }
Example #29
Source File: MainMenu.java From document-management-system with GNU General Public License v2.0 | 4 votes |
/** * refreshAvailableTemplates */ public void refreshAvailableTemplates() { if (menuTemplates.isVisible()) { documentService.getAllTemplates(new AsyncCallback<List<GWTDocument>>() { @Override public void onSuccess(List<GWTDocument> result) { subMenuTemplates.clearItems(); // Remove all items fldMenus = new HashMap<String, MenuBar>(); templateMenuItems = new ArrayList<MenuItem>(); fldMenus.put(GWTRepository.TEMPLATES, subMenuTemplates); for (final GWTDocument doc : result) { String[] paths = doc.getPath().split("/"); String actualPath = GWTRepository.TEMPLATES; for (int i = 2; i < paths.length - 1; i++) { // Evaluates if new path exist otherside creates if (!fldMenus.containsKey(actualPath + "/" + paths[i])) { createSubMenu(actualPath, paths[i]); // Menuitem // folder } actualPath += "/" + paths[i]; } MenuItem docItem = new MenuItem(Util.menuHTML("../mime/" + doc.getMimeType(), doc.getName()), true, new Command() { @Override public void execute() { if (mainMenuOption.createFromTemplateOption) { Main.get().templatePopup.reset(doc, Main.get().activeFolderTree.getActualPath(), false); Main.get().templatePopup.center(); } } }); docItem.addStyleName("okm-MainMenuItem"); fldMenus.get(actualPath).addItem(docItem); templateMenuItems.add(docItem); if (mainMenuOption.createFromTemplateOption) { enable(docItem); } else { disable(docItem); } } } @Override public void onFailure(Throwable caught) { Main.get().showError("getAllTemplatesByType", caught); } }); } }
Example #30
Source File: FinderColumn.java From core with GNU Lesser General Public License v2.1 | 4 votes |
private void openTopContextMenu(Element anchor, final NativeEvent event) { Element el = Element.as(event.getEventTarget()); //Element anchor = el.getParentElement().getParentElement(); final PopupPanel popupPanel = new PopupPanel(true); final MenuBar popupMenuBar = new MenuBar(true); popupMenuBar.setStyleName("dropdown-menu"); int i=0; for (final MenuDelegate menuitem : accessibleTopMenuItems) { if(i>0) { // skip the "default" action MenuItem cmd = new MenuItem(menuitem.getTitle(), true, new Command() { @Override public void execute() { Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { menuitem.getCommand().executeOn(null); } }); popupPanel.hide(); } }); popupMenuBar.addItem(cmd); } i++; } popupMenuBar.setVisible(true); popupPanel.setWidget(popupMenuBar); int left = anchor.getAbsoluteLeft(); int top = anchor.getAbsoluteTop() + 30; popupPanel.setPopupPosition(left, top); popupPanel.setAutoHideEnabled(true); popupPanel.show(); }