Java 类com.google.gwt.user.client.ui.MenuBar 实例源码

项目:unitimes    文件:UniTimeTableHeader.java   
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();
        }
    });
}
项目:document-management-system    文件:TrashMenu.java   
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);
}
项目:document-management-system    文件:MailMenu.java   
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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:FindToolBarMenu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:CategoriesMenu.java   
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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:ontobrowser    文件:OntoBrowser.java   
private void createOntologyMenu(List<Term> terms) {
    MenuBar menu = new MenuBar(true);
    menu.setAnimationEnabled(true);

    for(final Term term : terms) {
        Ontology ontology = term.getOntology();
        if(!ontology.isCodelist()) {
            menu.addItem(ontology.getName(), new Command() {
                public void execute() {
                    History.newItem(term.getReferenceId());
                }
            });
        }
    }

    menuBar.insertItem(new MenuItem("Ontology", menu), 0);
}
项目:umlet    文件:MenuPopup.java   
public MenuPopup(List<MenuPopupItem> items) {
    super(false, Type.MENU);
    MenuBar popupMenuBar = new MenuBar(true);

    for (final MenuPopupItem item : items) {
        popupMenuBar.addItem(new MenuItem(item.getText(), true, new ScheduledCommand() {
            @Override
            public void execute() {
                item.execute();
                hide();
            }
        }));
    }
    popupMenuBar.setVisible(true);
    add(popupMenuBar);
}
项目:unitime    文件:UniTimeTableHeader.java   
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();
        }
    });
}
项目:qafe-platform    文件:AbstractComponentRenderer.java   
private static void processMenu(MenuBar menu, MenuItemGVO[] subMenus, String name, String uuid, String parent) {
    MenuBar subMenu = new MenuBar(true);
    for (int j = 0; j < subMenus.length; j++) {
        if (subMenus[j].getSubMenus() != null && subMenus[j].getSubMenus().length > 0) {
            processMenu(subMenu, subMenus[j].getSubMenus(), subMenus[j].getDisplayname(), uuid, parent);
        } else {
            if (subMenus[j] instanceof MenuItemSeparatorGVO) {
                menu.addSeparator();
            } else {
                MenuItem menuItem = new MenuItem(subMenus[j].getDisplayname(), (Command) null);
                RendererHelper.fillIn(subMenus[j], menuItem, uuid, parent, subMenus[j].getContext());
                subMenu.addItem(menuItem);
            }
        }
    }
    if (tempString.equals(name)) {
        contextMenu.addItem(new MenuItem(name, subMenu));
    } else {
        menu.addItem(new MenuItem(name, subMenu));
    }
}
项目:qafe-platform    文件:RendererHelper.java   
public static void addMenu(ComponentGVO vo, UIObject ui, String uuid, String parent) {
    if (vo != null && ui != null) {
        if (vo.getMenu() != null) {
            MenuBar menu = new MenuBar();
            menu.setAutoOpen(true);
            menu.setWidth("100%");
            UIObject renderedComponent = new MenuItemRenderer().render(vo.getMenu(), uuid, parent, vo.getContext());
            if (renderedComponent instanceof MenuBar) {
                menu.addItem(vo.getMenu().getDisplayname(), (MenuBar) renderedComponent);
            } else if (renderedComponent instanceof MenuItem) {
                menu.addItem((MenuItem) renderedComponent);
            }
            if (ui instanceof DockPanel) {
                ((DockPanel) ui).add(menu, DockPanel.NORTH);
            } else if (ui instanceof Grid || ui instanceof VerticalPanel || ui instanceof HorizontalPanel)
                ((Panel) ui).add(menu);
        }
    }

}
项目:qafe-platform    文件:WindowRenderer.java   
private void processMenu(MenuBar menu, MenuItemGVO subMenuGVO, String name, String uuid, String parent) {
    MenuBar subMenu = new MenuBar(true);
    MenuItemGVO[] subMenus = subMenuGVO.getSubMenus();
    for (int j = 0; j < subMenus.length; j++) {
        if (subMenus[j].getSubMenus() != null && subMenus[j].getSubMenus().length > 0) {
            processMenu(subMenu, subMenus[j], subMenus[j].getDisplayname(), uuid,parent);
        } else {
            if (subMenus[j] instanceof MenuItemSeparatorGVO){                   
                subMenu.addSeparator();
            } else {
                MenuItem menuItem = new MenuItem(subMenus[j].getDisplayname(),(Command) null);
                RendererHelper.fillIn(subMenus[j], menuItem, uuid,parent, subMenus[j].getContext());
                subMenu.addItem(menuItem);
            }
        }

    }
    MenuItem subMenuItem = new MenuItem(name, subMenu);
    RendererHelper.fillIn(subMenuGVO, subMenuItem, uuid,parent, subMenuGVO.getContext());
    menu.addItem(subMenuItem);
}
项目:qafe-platform    文件:RendererHelper.java   
public static void addMenu(ComponentGVO vo, UIObject ui, String uuid, String parent) {
    if (vo != null && ui != null) {
        if (vo.getMenu() != null) {
            MenuBar menu = new MenuBar();
            menu.setAutoOpen(true);
            menu.setWidth("100%");
            UIObject renderedComponent = new MenuItemRenderer().render(vo.getMenu(), null, uuid, parent, vo.getContext(), null);
            if (renderedComponent instanceof MenuBar) {
                menu.addItem(vo.getMenu().getDisplayname(), (MenuBar) renderedComponent);
            } else if (renderedComponent instanceof MenuItem) {
                menu.addItem((MenuItem) renderedComponent);
            }
            if (ui instanceof DockPanel) {
                ((DockPanel) ui).add(menu, DockPanel.NORTH);
            } else if (ui instanceof Grid || ui instanceof VerticalPanel || ui instanceof HorizontalPanel)
                ((Panel) ui).add(menu);
        }
    }

}
项目:iambookmaster    文件:ParagraphsMapEditor.java   
public NewConnectionPanel() {
    super(true,true);
    newConnectionMenu = new MenuBar(true);
    newConnectionMenu.addItem(appConstants.modelBiDirection(),new Command() {
        public void execute() {
            addNewConnection(selectedWidget,selectedWidget2,true);
            NewConnectionPanel.this.hide();
        }
    });
    newConnectionMenu.addItem(appConstants.modelToHere(),new Command() {
        public void execute() {
            addNewConnection(selectedWidget,selectedWidget2,false);
            NewConnectionPanel.this.hide();
        }
    });
    newConnectionMenu.addItem(appConstants.modelFromHere(),new Command() {
        public void execute() {
            addNewConnection(selectedWidget2,selectedWidget,false);
            NewConnectionPanel.this.hide();
        }
    });
    add(newConnectionMenu);
}
项目:rva    文件:PlaceholderContextMenuWidget.java   
public PlaceholderContextMenuWidget(Command bringToFrontCommand, Command bringForwardCommand, Command sendBackwardCommand,
                                        Command sendToBackCommand, Command propertiesCommand, Command deleteCommand) {
    super(true, false);
    MenuBar popupMenuBar = new MenuBar(true);

    MenuItem propertiesItem = new MenuItem("Properties", true, propertiesCommand);
    MenuItem deleteItem = new MenuItem("Delete", true, deleteCommand);
    MenuItem bringToFrontItem = new MenuItem("Bring to Front", true, bringToFrontCommand);
    MenuItem bringForwardItem = new MenuItem("Bring Forward", true, bringForwardCommand);
    MenuItem sendBackwardItem = new MenuItem("Send Backward", true, sendBackwardCommand);
    MenuItem sendToBackItem = new MenuItem("Send to Back", true, sendToBackCommand);

    popupMenuBar.addItem(propertiesItem);
    popupMenuBar.addItem(deleteItem);
    popupMenuBar.addSeparator();
    popupMenuBar.addItem(bringToFrontItem);
    popupMenuBar.addItem(bringForwardItem);
    popupMenuBar.addItem(sendBackwardItem);
    popupMenuBar.addItem(sendToBackItem);

    popupMenuBar.setVisible(true);
    add(popupMenuBar);

    sinkEvents(Event.ONCONTEXTMENU); 
}
项目:appinventor-extensions    文件:ContextMenu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:MassiveOperationsMenu.java   
/**
 * 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);
}
项目:document-management-system    文件:TrashMenu.java   
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);
}
项目:document-management-system    文件:MainMenu.java   
/**
 * 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);
}
项目:document-management-system    文件:Bookmark.java   
/**
 * 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());
        }
    }
}
项目:document-management-system    文件:PersonalMenu.java   
/**
 * 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);
}
项目:document-management-system    文件:Menu.java   
/**
 * 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);
}
项目:document-management-system    文件:MetadataMenu.java   
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);
}
项目:document-management-system    文件:TemplateMenu.java   
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);
}
项目:document-management-system    文件:ThesaurusMenu.java   
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);
}
项目:document-management-system    文件:TaxonomyMenu.java   
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);
}
项目:ontobrowser    文件:OntoBrowser.java   
private void createPopups(Curator curator) {
    if(curator != null) {                   
        CreateChildTermPopup createTermPopup = new CreateChildTermPopup(service, eventBus);
        CrossRefPopup crossRefPopup = new CrossRefPopup(service, eventBus, curator, createTermPopup);
        ApproveRejectPopup approveRejectPopup = new ApproveRejectPopup(service, eventBus, curator);
        AddSynonymPopup addSynonymPopup = new AddSynonymPopup(service, eventBus);
        AddRelationshipPopup addRelationshipPopup = new AddRelationshipPopup(service, eventBus);

        createTermPopup.setSynonymProvider(crossRefPopup);

        MenuBar menu = new MenuBar(true);
        menu.setAnimationEnabled(true);
        createPopupMenuItem(menu, "Map Synonyms", crossRefPopup);
        createPopupMenuItem(menu, "Approve", approveRejectPopup);
        createPopupMenuItem(menu, "Create Child Term", createTermPopup);
        createPopupMenuItem(menu, "Add Synonym", addSynonymPopup);
        createPopupMenuItem(menu, "Add Relationship", addRelationshipPopup);

        if(BigDecimal.ONE.equals(curator.getEntityApprovalWeight(Entity.TERM))) {
            ReplaceTermPopup replaceTermPopup = new ReplaceTermPopup(service, eventBus);
            createPopupMenuItem(menu, "Obsolete Term", replaceTermPopup);
        }

        menuBar.addItem("Curate", menu);
    }           

    createPopupMenuItem(menuBar, "History", new HistoryPopup(eventBus, service));
    createPopupMenuItem(menuBar, "Legend", new LegendPopup());

    if(curator != null && curator.getPassword() != null) {
        ChangePasswordPopup changePasswordPopup = new ChangePasswordPopup(service);
        if(curator.isPasswordExpired()) {
            changePasswordPopup.show();
        }
        menuBar.addSeparator();
        createPopupMenuItem(menuBar, "Change Password", changePasswordPopup);
    }
}
项目:ontobrowser    文件:OntoBrowser.java   
private void createPopupMenuItem(MenuBar menu, final String text, final OntoBrowserPopup popup) {
    menu.addItem(text, new Command() {
        public void execute() {
            popup.show();
        }
    });
}
项目:ephesoft    文件:AdvancedKVExtractionView.java   
/**
 * To extractSpanValue.
 * 
 * @param coordinateX int
 * @param coordinateY int
 * @param clientCoordinateX int
 * @param clientCoordinateY int
 */
public void extractSpanValue(int coordinateX, int coordinateY, int clientCoordinateX, int clientCoordinateY) {
    if (spanList != null) {
        double aspectWidthRatio = (double) (pageImage.getWidth()) / (double) (originalWidth);
        double aspectHeightRatio = (double) (pageImage.getHeight()) / (double) (originalHeight);
        int xCoordinate = (int) Math.round(coordinateX / aspectWidthRatio);
        int yCoordinate = (int) Math.round(coordinateY / aspectHeightRatio);
        for (Span span : spanList) {
            int spanX0 = span.getCoordinates().getX0().intValue();
            int spanY0 = span.getCoordinates().getY0().intValue();
            int spanX1 = span.getCoordinates().getX1().intValue();
            int spanY1 = span.getCoordinates().getY1().intValue();
            if (spanX0 <= xCoordinate && spanX1 >= xCoordinate && spanY0 <= yCoordinate && spanY1 >= yCoordinate) {
                MenuBar menuBar = new MenuBar(true);
                MenuItem menuItem = new MenuItem(span.getValue(), new Command() {

                    @Override
                    public void execute() {
                        contextMenu.hide();
                    }
                });
                menuBar.addItem(menuItem);
                contextMenu.setWidget(menuBar);
                contextMenu.setPopupPosition(clientCoordinateX, clientCoordinateY);
                contextMenu.show();
                break;
            }
        }
    }
}
项目:circuitjs1    文件:Scope.java   
MenuBar getMenu() {
CircuitElm elm = plots.get(0).elm;
    if (elm == null)
        return null;
    elm = getSingleElm();
    if (elm != null && elm instanceof TransistorElm) {
        sim.scopeIbMenuItem.setState(showingValue(VAL_IB));
        sim.scopeIcMenuItem.setState(showingValue(VAL_IC));
        sim.scopeIeMenuItem.setState(showingValue(VAL_IE));
        sim.scopeVbeMenuItem.setState(showingValue(VAL_VBE));
        sim.scopeVbcMenuItem.setState(showingValue(VAL_VBC));
        sim.scopeVceMenuItem.setState(showingValue(VAL_VCE));
        sim.scopeVceIcMenuItem.setState(isShowingVceAndIc());
            sim.scopeMaxScaleTransMenuItem.setState(maxScale && !plot2d);
        return sim.transScopeMenuBar;
    } else {
            sim.scopeRemovePlotMenuItem.setEnabled(visiblePlots.size() > 1 && !plot2d);
        sim.scopeVMenuItem    .setState(showV && !showingValue(VAL_POWER));
        sim.scopeIMenuItem    .setState(showI && !showingValue(VAL_POWER));
        sim.scopeScaleMenuItem.setState(showScale);
        sim.scopeMaxMenuItem  .setState(showMax);
        sim.scopeMinMenuItem  .setState(showMin);
        sim.scopeFreqMenuItem .setState(showFreq);
        sim.scopePowerMenuItem.setState(showingValue(VAL_POWER));
        sim.scopeRMSMenuItem  .setState(showRMS);
        sim.scopeVIMenuItem   .setState(plot2d && !plotXY);
        sim.scopeXYMenuItem   .setState(plotXY);
        sim.scopeSelectYMenuItem.setEnabled(plotXY);
        sim.scopeFFTMenuItem.setState(showFFT);
        sim.scopeResistMenuItem.setState(showingValue(VAL_R));
        sim.scopeResistMenuItem.setEnabled(elm != null && elm.canShowValueInScope(VAL_R));
            sim.scopeMaxScaleMenuItem.setState(maxScale && !plot2d);
        return sim.scopeMenuBar;
    }
   }
项目:unitime    文件:UniTimeTableHeader.java   
public boolean setMenu(final PopupPanel popup) {
    List<Operation> operations = getOperations();
    if (operations.isEmpty()) return false;
    boolean first = true;
    MenuBar menu = new MenuBarWithAccessKeys();
    for (final Operation op: operations) {
        if (!op.isApplicable()) continue;
        if (op.hasSeparator() && !first)
            menu.addSeparator();
        first = false;
        MenuItem item = new MenuItem(op.getName(), true, new Command() {
            @Override
            public void execute() {
                popup.hide();
                op.execute();
            }
        });
        if (op instanceof AriaOperation)
            Roles.getMenuitemRole().setAriaLabelProperty(item.getElement(), ((AriaOperation)op).getAriaLabel());
        else
            Roles.getMenuitemRole().setAriaLabelProperty(item.getElement(), UniTimeHeaderPanel.stripAccessKey(op.getName()));
        menu.addItem(item);
    }
    if (first) return false;
    menu.setVisible(true);
    popup.add(menu);
    return true;
}
项目:platypus-js    文件:PlatypusSplitButton.java   
public PlatypusSplitButton(String aTitle, boolean asHtml, ImageResource aImage, MenuBar aMenu) {
    super(aTitle, asHtml, aImage, aMenu);
    addKeyDownHandler(new KeyDownHandler(){

        @Override
           public void onKeyDown(KeyDownEvent event) {
            if(event.getNativeKeyCode() == KeyCodes.KEY_ENTER || event.getNativeKeyCode() == KeyCodes.KEY_SPACE){
                ActionEvent.fire(PlatypusSplitButton.this, PlatypusSplitButton.this);
            }
           }

    });
}