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

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


      }
    }
  };

  public MenuItemBindings(Action source) {
    this(source, new MenuItem("", (Command) null));
  }
View Full Code Here


      }
    }
  };

  public RadioButtonMenuItemBindings(String name, Action source) {
    this(name, source, new MenuItem("", (Command) null));
  }
View Full Code Here

      }
    }
  };

  public CheckBoxMenuItemBindings(Action source) {
    this(source, new MenuItem("", (Command) null));
  }
View Full Code Here

    if (action.getImage() != null) {
      html = action.getImage().getHTML() + " " + action.getText();
    } else {
      html = action.getText();
    }
    MenuItem menuItem = new MenuItem(html, true, action);
    if (action.getTitle() != null) {
      menuItem.getTitle();
    }
    return menuItem;
  }
View Full Code Here

        MenuBar rootMenuBar = new MenuBar( true );
        rootMenuBar.setAutoOpen( true );
        rootMenuBar.setAnimationEnabled( true );

        rootMenuBar.addItem( new MenuItem( Constants.INSTANCE.CreateNew(),
                                           createNewMenu ) );

        return rootMenuBar;
    }
View Full Code Here

        MenuBar rootMenuBar = new MenuBar( true );
        rootMenuBar.setAutoOpen( false );
        rootMenuBar.setAnimationEnabled( false );

        rootMenuBar.addItem( new MenuItem( Constants.INSTANCE.CreateNew(), createNewMenu ) );

        return rootMenuBar;
    }
View Full Code Here

        return rootMenuBar;
    }

    private void addItem(String text, boolean asHTML, Command command, String format) {
        MenuItem item = new MenuItem( text, asHTML, command );
        boolean enabled = ApplicationPreferences.enabledFormat( format );
        item.setEnabled( enabled );
        createNewMenu.addItem( item );
    }
View Full Code Here

    /**
     * Initialize right-click context menu
     */
    protected void initMenu() {
        contextMenu = new ContextMenu();
        contextMenu.addItem(new MenuItem("Delete", new Command() {
            @Override
            public void execute() {
                generator.removeWidget(NodeWidget.this);
            }
        }));
View Full Code Here

    /**
     * Initialize right-click context menu
     */
    public void initMenu() {
        canvasMenu = new ContextMenu();
        canvasMenu.addItem(new MenuItem("Generate XML", new Command() {
            @Override
            public void execute() {
                generateXml();
            }
        }));
View Full Code Here

    return super.getItems().get(index);
  }
  @Override
  public void add(Widget widget) {
    addWidgetToCollection(widget);
    final MenuItem menuItem = new MenuItem("Widget", (Command) null){
      @Override
      public void setSelectionStyle(boolean selected)
      {
        super.setSelectionStyle(selected);
        if(VkMenuBarHorizontal.this.getAutoOpen() && getCommand() != null)
          getCommand().execute();
      }
    };
    this.addItem(menuItem);
    final PopupPanel popupPanel = new PopupPanel() {
      public void hide(boolean autoClosed) {
        if(autoClosed) {
          new Timer(){
            @Override
            public void run() {
              lateHide();
            }}.schedule(100);
        } else
          super.hide(autoClosed);
      }
      private void lateHide() {
        if(!VkStateHelper.getInstance().getResizeHelper().isResizing())
          super.hide(true);
      }
    };
    popupPanel.add(widget);
    if(widget instanceof IVkWidget)
      ((IVkWidget)widget).setVkParent(this);
    popupPanel.setAutoHideEnabled(true);
    popupPanel.addAutoHidePartner(menuItem.getElement());
    menuItem.setCommand(new Command(){
      @Override
      public void execute() {
        if(popupPanel.isShowing())
          popupPanel.hide();
        else {
          popupPanel.showRelativeTo(menuItem);
          DOM.setStyleAttribute(popupPanel.getElement(), "top", VkDesignerUtil.getOffsetTop(popupPanel.getElement()) + VkMenuBarHorizontal.this.getOffsetHeight() - menuItem.getOffsetHeight() + "");
          popupPanel.show();
        }
      }});
   
  }
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.