Search in sources :

Example 6 with MenuItem

use of com.extjs.gxt.ui.client.widget.menu.MenuItem in project activityinfo by bedatadriven.

the class ExportMenuButton method setFormats.

public void setFormats(List<RenderElement.Format> formats) {
    this.formats = formats;
    setIcon(formatIcon(formats.get(0)));
    menu.removeAll();
    for (RenderElement.Format format : formats) {
        MenuItem word = new MenuItem(formatLabel(format), formatIcon(format), menuListener);
        word.setData("format", format);
        menu.add(word);
    }
}
Also used : RenderElement(org.activityinfo.legacy.shared.command.RenderElement) Format(org.activityinfo.legacy.shared.command.RenderElement.Format) MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem)

Example 7 with MenuItem

use of com.extjs.gxt.ui.client.widget.menu.MenuItem in project activityinfo by bedatadriven.

the class DbEditorMenu method newMenuItem.

private MenuItem newMenuItem(String itemId, String label, AbstractImagePrototype icon, SelectionListener<MenuEvent> listener) {
    final MenuItem newMenuItem = new MenuItem(label, icon, listener);
    newMenuItem.setItemId(itemId);
    return newMenuItem;
}
Also used : MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem)

Example 8 with MenuItem

use of com.extjs.gxt.ui.client.widget.menu.MenuItem in project activityinfo by bedatadriven.

the class SaveMenuButton method setMethods.

public void setMethods(List<SaveMethod> methods) {
    this.methods = methods;
    setIcon(IconImageBundle.ICONS.save());
    menu.removeAll();
    for (SaveMethod method : methods) {
        MenuItem word = new MenuItem(formatLabel(method), IconImageBundle.ICONS.save(), menuListener);
        word.setData("method", method);
        menu.add(word);
    }
}
Also used : MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem)

Example 9 with MenuItem

use of com.extjs.gxt.ui.client.widget.menu.MenuItem in project activityinfo by bedatadriven.

the class ReportPortlet method addOptionsMenu.

private void addOptionsMenu() {
    final Menu optionsMenu = new Menu();
    optionsMenu.add(new MenuItem(I18N.CONSTANTS.edit(), IconImageBundle.ICONS.edit(), new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            edit();
        }
    }));
    optionsMenu.add(new MenuItem(I18N.CONSTANTS.removeFromDashboard(), IconImageBundle.ICONS.remove(), new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            removeFromDashboard();
        }
    }));
    final ToolButton gear = new ToolButton("x-tool-gear", new SelectionListener<IconButtonEvent>() {

        @Override
        public void componentSelected(IconButtonEvent ce) {
            optionsMenu.show(ce.getComponent());
        }
    });
    getHeader().addTool(gear);
}
Also used : ToolButton(com.extjs.gxt.ui.client.widget.button.ToolButton) MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem) Menu(com.extjs.gxt.ui.client.widget.menu.Menu)

Aggregations

MenuItem (com.extjs.gxt.ui.client.widget.menu.MenuItem)9 Menu (com.extjs.gxt.ui.client.widget.menu.Menu)6 SeparatorMenuItem (com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem)3 MenuEvent (com.extjs.gxt.ui.client.event.MenuEvent)2 Button (com.extjs.gxt.ui.client.widget.button.Button)1 SplitButton (com.extjs.gxt.ui.client.widget.button.SplitButton)1 ToolButton (com.extjs.gxt.ui.client.widget.button.ToolButton)1 CheckMenuItem (com.extjs.gxt.ui.client.widget.menu.CheckMenuItem)1 SeparatorToolItem (com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem)1 UiHandler (com.google.gwt.uibinder.client.UiHandler)1 ApplicationLocale (org.activityinfo.i18n.shared.ApplicationLocale)1 RenderElement (org.activityinfo.legacy.shared.command.RenderElement)1 Format (org.activityinfo.legacy.shared.command.RenderElement.Format)1 NavigationEvent (org.activityinfo.ui.client.page.NavigationEvent)1