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

Examples of com.google.gwt.user.client.ui.MenuBar$Resources


            th.add(new Label("rowSpan=2", true));
            th.setRowSpan(2);
            tr.add(th);
            {
                th = tr.newTableHeaderCell();
                final MenuBar nameMenu = new MenuBar();

                final MenuBar nameSubMenu = new MenuBar(true);
                final MenuItem nameSortUp = new MenuItem("Sort Up", new Command() {
                    Comparator c = new Comparator() {
                        public int compare(final Object o1, final Object o2) {
                            final Person p1 = (Person)o1;
                            final Person p2 = (Person)o2;
                            return p1.getName().compareTo(p2.getName());
                        }
                    };
                    public void execute() {
                        if (sel != null) {
                            sel.setComparator(c);
                        }
                    }
                });
                final MenuItem nameSortDown = new MenuItem("Sort Down", new Command() {
                    Comparator c = new Comparator() {
                        public int compare(final Object o1, final Object o2) {
                            final Person p1 = (Person)o1;
                            final Person p2 = (Person)o2;
                            return p2.getName().compareTo(p1.getName());
                        }
                    };
                    public void execute() {
                        if (sel != null) {
                            sel.setComparator(c);
                        }
                    }
                });
                nameSubMenu.addItem(nameSortUp);
                nameSubMenu.addItem(nameSortDown);

                final MenuItem nameMenuItem = new MenuItem("Name", nameSubMenu);
                nameMenu.addItem(nameMenuItem);
                th.add(nameMenu);
                tr.add(th);
            }

            {
                th = tr.newTableHeaderCell();
                final MenuBar ageMenu = new MenuBar();

                final MenuBar ageSubMenu = new MenuBar(true);
                final MenuItem ageSortUp = new MenuItem("Sort Up", new Command() {
                    Comparator c = new Comparator() {
                        public int compare(final Object o1, final Object o2) {
                            final Person p1 = (Person)o1;
                            final Person p2 = (Person)o2;
                            return p1.getAge() - p2.getAge();
                        }
                    };
                    public void execute() {
                        if (sel != null) {
                            sel.setComparator(c);
                        }
                    }
                });
                final MenuItem ageSortDown = new MenuItem("Sort Down", new Command() {
                    Comparator c = new Comparator() {
                        public int compare(final Object o1, final Object o2) {
                            final Person p1 = (Person)o1;
                            final Person p2 = (Person)o2;
                            return p2.getAge() - p1.getAge();
                        }
                    };
                    public void execute() {
                        if (sel != null) {
                            sel.setComparator(c);
                        }
                    }
                });
                ageSubMenu.addItem(ageSortUp);
                ageSubMenu.addItem(ageSortDown);

                final MenuItem ageMenuItem = new MenuItem("Age", ageSubMenu);
                ageMenu.addItem(ageMenuItem);
                th.add(ageMenu);
                tr.add(th);
View Full Code Here


            pcs.removePropertyChangeListener(listener);
        }
    }

    public static MenuBar makeMenuBar() {
        final MenuBar subMenu = new MenuBar(true);
        subMenu.addItem("<code>Code</code>", true, new MyCommand());
        subMenu.addItem("<strike>Strikethrough</strike>", true, new MyCommand());
        subMenu.addItem("<u>Underlined</u>", true, new MyCommand());

        final MenuBar menu0 = new MenuBar(true);
        menu0.addItem("<b>Bold</b>", true, new MyCommand());
        menu0.addItem("<i>Italicized</i>", true, new MyCommand());
        menu0.addItem("More &#187;", true, subMenu);


        final MenuBar menu = new MenuBar(true);
        menu.addItem(new MenuItem("Style", menu0));

        return menu;
    }
View Full Code Here

    top.setVerticalAlignment(HorizontalPanel.ALIGN_BOTTOM);
    top.add(new Image(images.logo()));
    //添加顶部logo.
   
   
    MenuBar menu = new MenuBar();
      menu.setAutoOpen(true);
      menu.setWidth((GWT_SNS_Main.mainWidth - logoWith + 17) +"px");
      //menu.setStyleName("gwt_sns_main_top_panel_menu");
      menu.setAnimationEnabled(true);

      // Create a sub menu of recent documents
    
      menu.addItem("   首页       ",new MenuBar());
      menu.addSeparator();
     
      //添加个人空间菜单.
      MenuBar recentDocsMenu = new MenuBar(true);
      recentDocsMenu.setTitle("abc");
      for(int i = 0; i < 3; i ++){
        MenuItem item = new MenuItem("abc"+i, new Command() {
        @Override
        public void execute() {
          // TODO Auto-generated method stub
        }
      });
        recentDocsMenu.addItem(item);
      }
      menu.addItem("   个人空间      ",recentDocsMenu);
      menu.addSeparator();
     
      menu.addItem("   好友      ",new MenuBar(false));
      menu.addSeparator();
     
      menu.addItem("   消息     ",new MenuBar(false));
      menu.addSeparator();
     
      menu.addItem("   管理     ",new MenuBar(false));
      menu.addSeparator();
     
      menu.addItem("   邀请     ",new MenuBar(false));
      menu.addSeparator();
     
      menu.addItem("   帐号     ",new MenuBar(false));
      menu.addSeparator();
     
      menu.addItem("   退出     ",new MenuBar(false));
      menu.addSeparator();

      // Create the file menu
      MenuBar fileMenu = new MenuBar(true);
     

      // Create the edit menu
      MenuBar editMenu = new MenuBar(true);
     

     
    top.add(menu);
    add(top);
View Full Code Here

    }
  };

  private Widget createMenu() {

    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

        addNewEnumerationMenuItem();
        addNewTestScenarioMenuItem();
        addNewFileMenuItem();
        rebuildAllPackagesMenuItem();

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

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

        return rootMenuBar;
    }
View Full Code Here

        String[] formats = perspectiveFactory.getRegisteredAssetEditorFormats("soaservice");
        for(final String format:formats) {
            addNewAssetMenuItem(format);        
        }

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

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

        return rootMenuBar;
    }
View Full Code Here

        Integer p2 = new Integer( o2.getLayoutPriority() );
        return p1.compareTo( p2 );
      }
    } );

    MenuBar perspectiveMenuBar = new MenuBar( true );
    perspectiveDropDown = new CustomDropDown( "", perspectiveMenuBar, MODE.MAJOR );
    setWidget( perspectiveDropDown );
    loadResourceBundle( perspectiveDropDown, perspectives.get( 0 ) );

    ScheduledCommand noopCmd = new ScheduledCommand() {
      public void execute() {
      }
    };

    for ( final IPluginPerspective perspective : perspectives ) {

      // 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
    MantleXul.getInstance().addOverlays( overlays );
View Full Code Here

    FrameUtils.setEmbedVisibility( ( (IFrameTabPanel) getTabPanel().getSelectedTab().getContent() ).getFrame(), false );

    int left = Window.getScrollLeft() + DOM.eventGetClientX( event );
    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();
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

    }

    // install language sub-menus
    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 );

    UserSettingsManager.getInstance().getUserSettings( new AsyncCallback<JsArray<JsSetting>>() {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.MenuBar$Resources

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.