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

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


                                                 presenter.startMatch(opponentId);  
                                                 presenter.sendRequest();
                                    }});
                                }
                               
                                menu.addItem(new MenuItem("Friends", friendList));
                           
                          }
                      }
                     
                    });
View Full Code Here


         {
            // Unlike the other status bar elements, the function outliner
            // needs its menu built on demand
            JsArray<Scope> tree = docDisplay_.getScopeTree();
            final StatusBarPopupMenu menu = new StatusBarPopupMenu();
            MenuItem defaultItem = null;
            if (fileType_.isRpres())
            {
               String path = docUpdateSentinel_.getPath();
               if (path != null)
               {
View Full Code Here

   }
  
   private void showStatusBarPopupMenu(StatusBarPopupRequest popupRequest)
   {
      final StatusBarPopupMenu menu = popupRequest.getMenu();
      MenuItem defaultItem = popupRequest.getDefaultMenuItem();
      if (defaultItem != null)
      {
         menu.selectItem(defaultItem);
         Scheduler.get().scheduleFinally(new RepeatingCommand()
         {
View Full Code Here

   private MenuItem createMenuItemForType(final TextFileType type)
   {
      SafeHtmlBuilder labelBuilder = new SafeHtmlBuilder();
      labelBuilder.appendEscaped(type.getLabel());

      MenuItem menuItem = new MenuItem(
         labelBuilder.toSafeHtml(),
         new Command()
         {
            public void execute()
            {
View Full Code Here

                                       final JsArray<Scope> funcs,
                                       String indent,
                                       Scope defaultFunction,
                                       boolean includeNoFunctionsMessage)
   {
      MenuItem defaultMenuItem = null;

      if (funcs.length() == 0 && includeNoFunctionsMessage)
      {
         String type = fileType_.canExecuteChunks() ? "chunks" : "functions";
         MenuItem noFunctions = new MenuItem("(No " + type + " defined)",
                                             false,
                                             (Command) null);
         noFunctions.setEnabled(false);
         noFunctions.getElement().addClassName("disabled");
         menu.addItem(noFunctions);
      }

      for (int i = 0; i < funcs.length(); i++)
      {
         final Scope func = funcs.get(i);

         String childIndent = indent;
         if (!StringUtil.isNullOrEmpty(func.getLabel()))
         {
            SafeHtmlBuilder labelBuilder = new SafeHtmlBuilder();
            labelBuilder.appendHtmlConstant(indent);
            labelBuilder.appendEscaped(func.getLabel());

            final MenuItem menuItem = new MenuItem(
                  labelBuilder.toSafeHtml(),
                  new Command()
                  {
                     public void execute()
                     {
                        docDisplay_.navigateToPosition(toSourcePosition(func),
                                                       true);
                     }
                  });
            menu.addItem(menuItem);

            childIndent = indent + "&nbsp;&nbsp;";

            if (defaultFunction != null && defaultMenuItem == null &&
                func.getLabel().equals(defaultFunction.getLabel()) &&
                func.getPreamble().getRow() == defaultFunction.getPreamble().getRow() &&
                func.getPreamble().getColumn() == defaultFunction.getPreamble().getColumn())
            {
               defaultMenuItem = menuItem;
            }
         }

         MenuItem childDefaultMenuItem = addFunctionsToMenu(
               menu,
               func.getChildren(),
               childIndent,
               defaultMenuItem == null ? defaultFunction : null,
               false);
View Full Code Here

            {
               onCompleted.execute(new StatusBarPopupRequest(menu, null));
               return;
            }
           
            MenuItem defaultMenuItem = null;
            int length = slideNavigation.getItems().length();
            for (int i=0; i<length; i++)
            {
               SlideNavigationItem item = slideNavigation.getItems().get(i);
               String title = item.getTitle();
               if (StringUtil.isNullOrEmpty(title))
                  title = "(Untitled Slide)";
              
               StringBuilder indentBuilder = new StringBuilder();
               for (int level=0; level<item.getIndent(); level++)
                  indentBuilder.append("&nbsp;&nbsp;");
              
               SafeHtmlBuilder labelBuilder = new SafeHtmlBuilder();
               labelBuilder.appendHtmlConstant(indentBuilder.toString());
               labelBuilder.appendEscaped(title);

               final int targetSlide = i;
               final MenuItem menuItem = new MenuItem(
                  labelBuilder.toSafeHtml(),
                  new Command()
                  {
                     public void execute()
                     {
View Full Code Here

              
               JsArrayString methods = functionDef_.getMethods();
               for (int i=0; i < methods.length(); i++)
               {
                  final String method = methods.get(i);
                  MenuItem mi = new MenuItem(method, new Command() {
                     @Override
                     public void execute()
                     {
                        SelectionEvent.fire(CodeBrowserContextWidget.this,
                                            method) ;  
                     }
                  });
                  mi.getElement().getStyle().setPaddingRight(20, Unit.PX);                 
                  menu.addItem(mi);
               }
              
               menu.showRelativeTo(nameLabel_);
               menu.getElement().getStyle().setPaddingTop(3, Unit.PX);
View Full Code Here

     
      setTitle(ALL_COMMITS_TITLE);
     
      ToolbarPopupMenu menu = getMenu();
     
      menu.addItem(new MenuItem("(all commits)", new Command() {
         @Override
         public void execute()
         {
            setValue(null);
         }
      }));
     
      menu.addItem(new MenuItem("Filter by File...", new Command() {
         @Override
         public void execute()
         {
            fileDialogs_.openFile("Choose File",
                                  fileContext_,
                                  getInitialChooserPath(),
                                  chooserOperation());
         }
      }));
     
      menu.addItem(new MenuItem("Filter by Directory...", new Command() {
         @Override
         public void execute()
         {
            fileDialogs_.chooseFolder("Choose Folder",
                                       fileContext_,
View Full Code Here

       String openLabel = AppCommand.formatMenuLabel(
          commands_.openHtmlExternal().getImageResource(),
          "View in Web Browser",
          null);
      
       menu.addItem(new MenuItem(editLabel, true, onEdit));
       menu.addItem(new MenuItem(openLabel, true, onBrowse));
     
       menu.setPopupPositionAndShow(new PositionCallback() {
          @Override
          public void setPosition(int offsetWidth, int offsetHeight)
          {
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

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.