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

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


        this.top = top;
        menu.clearItems();
        final Action[] actions = actionOwner.getActions();
        for (int i = 0; i < actions.length; i++) {
            final Action a = actions[i];
            menu.addItem(new MenuItem(a.getHTML(), true, a));
        }

        setPopupPositionAndShow(new PositionCallback() {
            public void setPosition(int offsetWidth, int offsetHeight) {
                // mac FF gets bad width due GWT popups overflow hacks,
View Full Code Here


            SafeHtmlBuilder menuHtml = new SafeHtmlBuilder();
            for (int j=0; j<item.getIndent(); j++)
               menuHtml.appendHtmlConstant("&nbsp;&nbsp;&nbsp;");
            menuHtml.appendEscaped(item.getTitle());
        
            navigationMenu.addItem(new MenuItem(menuHtml.toSafeHtml(),
                                           new Command() {
               @Override
               public void execute()
               {
                  view_.navigate(item.getIndex());
View Full Code Here

                                 String text,
                                 ScheduledCommand command,
                                 Integer iconOffsetY)
   {
     
      return new MenuItem(AppCommand.formatMenuLabel(res, text, null,
                                                     iconOffsetY),
                          true,
                          command);
   }
View Full Code Here

                        e.cancel();
                        moveSelectionUp();
                        break;
                     case KeyCodes.KEY_ENTER:
                        e.cancel();
                        final MenuItem menuItem = getSelectedItem();
                        if (menuItem != null)
                        {
                           NativeEvent evt = Document.get().createClickEvent(
                                 0,
                                 0,
                                 0,
                                 0,
                                 0,
                                 false,
                                 false,
                                 false,
                                 false);
                           menuItem.getElement().dispatchEvent(evt);
                        }
                        break;
                  }
               }
            }
View Full Code Here

         return getItems().size() ;
      }
     
      public int getSelectedIndex()
      {
         MenuItem selectedMenuItem = getSelectedItem();
         List<MenuItem> menuItems = getItems();
         for (int i = 0; i<menuItems.size(); i++)
         {
            if (menuItems.get(i).equals(selectedMenuItem))
               return i;
View Full Code Here

      return addHandler(handler, ValueChangeEvent.getType());
   }

   public void addMenuItem(String text, final String value)
   {
      addMenuItem(new MenuItem(text, (ScheduledCommand) null), value);
   }
View Full Code Here

public class PTMenuItem extends PTUIObject<MenuItem> {

    @Override
    public void create(final PTInstruction create, final UIService uiService) {
        final MenuItem menuItem = new MenuItem("?", (Command) null);
        init(create, uiService, menuItem);
    }
View Full Code Here

        this.top = top;
        menu.clearItems();
        final Action[] actions = actionOwner.getActions();
        for (int i = 0; i < actions.length; i++) {
            final Action a = actions[i];
            menu.addItem(new MenuItem(a.getHTML(), true, a));
        }

        setPopupPositionAndShow(new PositionCallback() {
            public void setPosition(int offsetWidth, int offsetHeight) {
                // mac FF gets bad width due GWT popups overflow hacks,
View Full Code Here

    public Element getSubPartElement(String subPart) {
        int index = Integer.parseInt(subPart.substring(6));
        // ApplicationConnection.getConsole().log(
        // "Searching element for selection index " + index);
        MenuItem item = menu.getItem(index);
        // ApplicationConnection.getConsole().log("Item: " + item);
        // Item refers to the td, which is the parent of the clickable element
        return item.getElement().getFirstChildElement().cast();
    }
View Full Code Here

  }
 
  private void initMenuBar(MenuBar menuBar) {
    menuBar.clearItems();
    if (!newUser) {
      MenuItem mntmHome = new MenuItem("Home", false, homeCommand());
      menuBar.addItem(mntmHome);
      menuBar.addSeparator(new MenuItemSeparator());
    }

    MenuItem mntmProfile = new MenuItem("Profile", false, profileCommand());
    menuBar.addItem(mntmProfile);
    menuBar.addSeparator(new MenuItemSeparator());

    if (!newUser) {
      MenuItem mntmBuzz = new MenuItem("Opportunities", false,
          opportunityCommand());
      menuBar.addItem(mntmBuzz);
      menuBar.addSeparator(new MenuItemSeparator());
    }
   
    MenuItem searchData = new MenuItem("Search", false, searchCommand());
    menuBar.addItem(searchData);

    menuBar.addSeparator(new MenuItemSeparator());
    MenuItem mntmPulse = new MenuItem("Pulse", false, pulseCommand());
    menuBar.addItem(mntmPulse);
   
    menuBar.addStyleName("menuBar");
  }
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.