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

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


    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


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

    MenuBar fileMenu = new MenuBar();
    menu.addItem(new MenuItem("File", fileMenu));
    fileMenu.addItem("Add Chart", addCommand);
    fileMenu.addItem("Del Chart", menuCommand);

    MenuBar helpMenu = new MenuBar();
    menu.addItem(new MenuItem("Help", helpMenu));
    helpMenu.addItem("Help", menuCommand);
    helpMenu.addItem("About", menuCommand);

    return menu;
  }
View Full Code Here

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

        rootMenuBar.addItem( new MenuItem( constants.CreateNew(), createNewMenu ) );

        return rootMenuBar;
    }
View Full Code Here

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

        rootMenuBar.addItem( new MenuItem( constants.CreateNew(), createNewMenu ) );

        return rootMenuBar;
    }
View Full Code Here

      // if we have overlays add it to the list
      if ( perspective.getOverlays() != null ) {
        overlays.addAll( perspective.getOverlays() );
      }

      final MenuItem menuItem = new MenuItem( "", noopCmd );
      perspectiveMenuItemMap.put( perspective.getId(), menuItem );
      ScheduledCommand cmd = new ScheduledCommand() {
        public void execute() {
          showPerspective( perspective );
          perspectiveDropDown.setText( menuItem.getText() );
          perspectiveDropDown.hidePopup();
        }
      };
      menuItem.setScheduledCommand( cmd );
      perspectiveMenuBar.addItem( menuItem );
      loadResourceBundle( menuItem, perspective );
    }

    // register overlays with XulMainToolbar
View Full Code Here

    int top = Window.getScrollTop() + DOM.eventGetClientY( event );
    popupMenu.setPopupPosition( adjustLeftIfNecessary( left ), top );
    MenuBar menuBar = new MenuBar( true );
    menuBar.setAutoOpen( true );
    if ( getContent() instanceof IFrameTabPanel ) {
      MenuItem backMenuItem =
          new MenuItem( Messages.getString( "back" ), new TabCommand( TABCOMMANDTYPE.BACK, popupMenu ) ); //$NON-NLS-1$
      menuBar.addItem( backMenuItem );
      backMenuItem.getElement().setId( "back" ); //$NON-NLS-1$
      menuBar.addSeparator();
      MenuItem reloadTabMenuItem =
          new MenuItem( Messages.getString( "reloadTab" ), new TabCommand( TABCOMMANDTYPE.RELOAD, popupMenu ) ); //$NON-NLS-1$
      menuBar.addItem( reloadTabMenuItem );
      reloadTabMenuItem.getElement().setId( "reloadTab" ); //$NON-NLS-1$
    }
    if ( getTabPanel().getTabCount() > 1 ) {
      MenuItem reloadAllTabsMenuItem =
          new MenuItem( Messages.getString( "reloadAllTabs" ), new TabCommand( TABCOMMANDTYPE.RELOAD_ALL, popupMenu ) ); //$NON-NLS-1$
      menuBar.addItem( reloadAllTabsMenuItem );
      reloadAllTabsMenuItem.getElement().setId( "reloadAllTabs" ); //$NON-NLS-1$
    } else {
      MenuItem reloadAllTabsMenuItem = new MenuItem( Messages.getString( "reloadAllTabs" ), (Command) null ); //$NON-NLS-1$
      menuBar.addItem( reloadAllTabsMenuItem );
      reloadAllTabsMenuItem.getElement().setId( "reloadAllTabs" ); //$NON-NLS-1$
      reloadAllTabsMenuItem.setStyleName( "disabledMenuItem" ); //$NON-NLS-1$
    }
    menuBar.addSeparator();
    if ( getContent() instanceof IFrameTabPanel ) {
      MenuItem openTabInNewWindowMenuItem =
          new MenuItem(
              Messages.getString( "openTabInNewWindow" ), new TabCommand( TABCOMMANDTYPE.NEW_WINDOW, popupMenu ) ); //$NON-NLS-1$
      menuBar.addItem( openTabInNewWindowMenuItem );
      openTabInNewWindowMenuItem.getElement().setId( "openTabInNewWindow" ); //$NON-NLS-1$
      MenuItem createDeepLinkMenuItem =
          new MenuItem(
              Messages.getString( "createDeepLink" ), new TabCommand( TABCOMMANDTYPE.CREATE_DEEP_LINK, popupMenu ) ); //$NON-NLS-1$
      menuBar.addItem( createDeepLinkMenuItem );
      createDeepLinkMenuItem.getElement().setId( "deepLink" ); //$NON-NLS-1$
      menuBar.addSeparator();
    }
    menuBar
        .addItem( new MenuItem( Messages.getString( "closeTab" ), new TabCommand( TABCOMMANDTYPE.CLOSE, popupMenu ) ) ); //$NON-NLS-1$
    if ( getTabPanel().getTabCount() > 1 ) {
      MenuItem closeOtherTabsMenuItem =
          new MenuItem( Messages.getString( "closeOtherTabs" ), new TabCommand( TABCOMMANDTYPE.CLOSE_OTHERS, popupMenu ) ); //$NON-NLS-1$
      menuBar.addItem( closeOtherTabsMenuItem );
      closeOtherTabsMenuItem.getElement().setId( "closeOtherTabs" ); //$NON-NLS-1$
      MenuItem closeAllTabsMenuItem =
          new MenuItem( Messages.getString( "closeAllTabs" ), new TabCommand( TABCOMMANDTYPE.CLOSE_ALL, popupMenu ) ); //$NON-NLS-1$
      menuBar.addItem( closeAllTabsMenuItem );
      closeAllTabsMenuItem.getElement().setId( "closeAllTabs" ); //$NON-NLS-1$
    } else {
      MenuItem closeOtherTabsMenuItem = new MenuItem( Messages.getString( "closeOtherTabs" ), (Command) null ); //$NON-NLS-1$
      closeOtherTabsMenuItem.setStyleName( "disabledMenuItem" ); //$NON-NLS-1$
      MenuItem closeAllTabsMenuItem = new MenuItem( Messages.getString( "closeAllTabs" ), (Command) null ); //$NON-NLS-1$
      closeAllTabsMenuItem.setStyleName( "disabledMenuItem" ); //$NON-NLS-1$
      menuBar.addItem( closeOtherTabsMenuItem );
      menuBar.addItem( closeAllTabsMenuItem );
      closeOtherTabsMenuItem.getElement().setId( "closeOtherTabs" ); //$NON-NLS-1$
      closeAllTabsMenuItem.getElement().setId( "closeAllTabs" ); //$NON-NLS-1$
    }
    popupMenu.setWidget( menuBar );
    popupMenu.hide();
    popupMenu.show();
  }
View Full Code Here

  @Override
  public void onBrowserEvent( Event event ) {
    super.onBrowserEvent( event );

    final MenuItem item = getSelectedItem();
    switch ( DOM.eventGetType( event ) ) {
      case Event.ONCLICK: {
        if ( item != null ) {
          hidePDFFrames( item );
        }
View Full Code Here

public class UserDropDown extends CustomDropDown {

  public UserDropDown() {
    super( UserDropDown.getUsername(), null, MODE.MINOR );
    MenuBar menuBar = new MenuBar( true );
    menuBar.addItem( new MenuItem( Messages.getString( "logout" ), new LogoutCommand() ) );
    setMenuBar( menuBar );
  }
View Full Code Here

    Map<String, String> supportedLanguages = Messages.getResourceBundle().getSupportedLanguages();
    if ( supportedLanguages != null && supportedLanguages.keySet() != null && !supportedLanguages.isEmpty() ) {
      MenuBar langMenu = (MenuBar) languageMenu.getManagedObject();
      langMenu.insertSeparator( 0 );
      for ( String lang : supportedLanguages.keySet() ) {
        MenuItem langMenuItem = new MenuItem( supportedLanguages.get( lang ), new SwitchLocaleCommand( lang ) );
        langMenuItem.getElement().setId( supportedLanguages.get( lang ) + "_menu_item" ); //$NON-NLS-1$
        langMenu.insertItem( langMenuItem, 0 );
      }
    }
    buildFavoritesAndRecent( false );
View Full Code Here

    recentDocsMenu.addItem("Document 1", emptyCommand);
    recentDocsMenu.addItem("Document 2", emptyCommand);

    // Create the file menu
    MenuBar fileMenu = new MenuBar(true);
    menu.addItem(new MenuItem("File", fileMenu));
    fileMenu.addItem("New", emptyCommand);
    fileMenu.addItem("Print", emptyCommand);
    fileMenu.addItem("Recent Docs", recentDocsMenu);

    // Create the edit menu
    MenuBar editMenu = new MenuBar(true);
    menu.addItem(new MenuItem("Edit", editMenu));
    editMenu.addItem("Cut", emptyCommand);
    editMenu.addItem("Copy", emptyCommand);
    editMenu.addItem("Paste", emptyCommand);

    // Create the help menu
    MenuBar helpMenu = new MenuBar(true);
    menu.addItem(new MenuItem("Help", helpMenu));
    helpMenu.addItem("Settings", emptyCommand);
    helpMenu.addItem("About", emptyCommand);

    return menu;
  }
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.