Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.MenuItem


  public void dispatchTableMenu(int left, int top) {

      MenuBar menu = new MenuBar(true);
      final PopupPanel menuPopup = new PopupPanel(true);
     
      menu.addItem(new MenuItem("Import...", new Command() {
      public void execute() {
        menuPopup.hide();
        dispatchImportAction();
      }
      }));
      menu.addItem(new MenuItem("Export...", new Command() {
      public void execute() {
        menuPopup.hide();
        exportContents();
      }
      }));
View Full Code Here


      }

      ExternalViewersInfo xvi = pctrl.getExternalViewersInfo(oi, includeVersion);
      if ( xvi != null ) {
        ont_mb.addSeparator();
        MenuItem mi = new MenuItem(xvi.hrefHtml.getHTML(), true, nullCmd);
        mi.setTitle(xvi.tooltip);
        ont_mb.addItem(mi);
      }
    }
   
    return ont_mb;
View Full Code Here

    return ont_mb;
  }
 
 
  private MenuItem _createMenuItemCreateNewVersion() {
    return new MenuItem("Edit new version", new Command() {
      public void execute() {
        pctrl.editNewVersion();
      }
    });
  }
View Full Code Here

    });

  }
 
  private MenuItem _createMenuItemVersions(final RegisteredOntologyInfo oi) {
    return new MenuItem("Versions", new Command() {
      public void execute() {
        launchVersions(oi);
      }
    });
  }
View Full Code Here

   * @param icon the menu item's icon, if any
   * @param title the menu item's title
   * @param command the menu items associated command type
   */
  private MenuItem addMenuItem(final MenuBar menuBar, AbstractImagePrototype icon, String title, final Command command) {
    MenuItem mi;
    if (icon == null) {
      mi = menuBar.addItem(title, true, (com.google.gwt.user.client.Command)null);
    } else {
      mi = menuBar.addItem(icon.getHTML() + " " + title, true, (com.google.gwt.user.client.Command)null);
    }
    mi.setCommand(new com.google.gwt.user.client.Command() {
      public void execute() {
        CommandEvent.fire(command);
      }
    });
    return mi;
View Full Code Here

   * Sets the icon for a menu item, by title.
   * @param title the title of the menu item for which to set the icon image
   * @param icon the icon image
   */
  public void setMenuItemIcon(String title, AbstractImagePrototype icon) {
    MenuItem item = getMenuItem(title);
    item.setHTML(icon.getHTML() + " " + title);
  }
View Full Code Here

    });
  }
 
  private void addMenuItem(final MenuBarExt menuBar, AbstractImagePrototype icon, String title,
    com.google.gwt.user.client.Command command) {
    MenuItem item = menuBar.addItem(icon.getHTML() + " " + title, true, command);
    itemIndex.put(title, item);
  }
View Full Code Here

      MenuBar menu = new MenuBar(true);
      final PopupPanel menuPopup = new PopupPanel(true);
     
      if ( row >= FIRST_REGULAR_ROW ) {
        menu.addItem(new MenuItem("Insert row above", new Command() {
          public void execute() {
            _insertRow(row, flexTable.getCellCount(row));
            menuPopup.hide();
          }
        }));
      }
      menu.addItem(new MenuItem("Insert row below", new Command() {
      public void execute() {
        _insertRow(row + 1, flexTable.getCellCount(row));
        menuPopup.hide();
      }
      }));
     
      if ( row >= FIRST_REGULAR_ROW ) {
        menu.addSeparator();
        menu.addItem(new MenuItem("Delete row", new Command() {
          public void execute() {
            _deleteRow(row);
            menuPopup.hide();
          }
        }));
View Full Code Here

    int top = ww.getAbsoluteTop();

      MenuBar menu = new MenuBar(true);
      final PopupPanel menuPopup = new PopupPanel(true);
     
      menu.addItem(new MenuItem("Insert column right", new Command() {
      public void execute() {
        _insertCol(col + 1);
        menuPopup.hide();
      }
      }));
      menu.addItem(new MenuItem("Insert column left", new Command() {
      public void execute() {
        _insertCol(col);
        menuPopup.hide();
      }
      }));
     
      // do not allow to remove the client column if it's the only one:
      if ( flexTable.getCellCount(0) > 2 ) {
        menu.addSeparator();
        menu.addItem(new MenuItem("Delete column", new Command() {
        public void execute() {
          _deleteCol(col);
          menuPopup.hide();
        }
        }));
View Full Code Here

        MenuBar menu = new MenuBar(true);
//        menu.setStylePrimaryName("PopupMenu");
        final PopupPanel menuPopup = new PopupPanel(true);
       
        menu.addItem(new MenuItem("Sort up", new Command() {
        public void execute() {
          sortByColumn(colName, false);
          menuPopup.hide();
        }
        }));
        menu.addItem(new MenuItem("Sort down", new Command() {
        public void execute() {
          sortByColumn(colName, true);
          menuPopup.hide();
        }
        }));
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.MenuItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.