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

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


                    GenClient.showCodeBug("Check code here because JFD had to disable some vital code to keep Eclipse's code checker happy.");
                }
            }
        });

        final MenuBar menuBar = new MenuBar();
        final MenuBar menuBar_file = new MenuBar(true);
        final MenuBar menuBar_iCing = new MenuBar(true);

        Command commandCriteria = new Command() {
            public void execute() {
                loadCriteriaView();
            }
        };
        Command commandFile = new Command() {
            public void execute() {
                loadFileView();
            }
        };
        // Command commandLog = new Command() {
        // public void execute() {
        // loadLogView();
        // }
        // };
        Command commandCingLog = new Command() {
            public void execute() {
                loadCingLogView();
            }
        };
        // Command commandExit = new Command() {
        // public void execute() {
        // loadLoginView();
        // }
        // };
        // Command commandPref = new Command() {
        // public void execute() {
        // loadPrefView();
        // }
        // };
        // Command commandWelcome = new Command() {
        // public void execute() {
        // loadWelcomeView();
        // }
        // };
        Command commandOptions = new Command() {
            public void execute() {
                loadOptionsView();
            }
        };

        Command commandRun = new Command() {
            public void execute() {
                loadRunView();
            }
        };
        Command commandReport = new Command() {
            public void execute() {
                loadReportView();
            }
        };
        Command commandAbout = new Command() {
            public void execute() {
                (new About()).show();
            }
        };

        Command commandPurgeProject = new Command() {
            public void execute() {
                // loadLogView();
                cingLogView.getPurgeProject();
            }
        };

        Command commandHelp = new Command() {
            public void execute() {
                About h = new About();
                h.setHTML(c.About()); // TODO: seems without effect.
                h.details.setHTML(h.details.getHTML() + "<BR>" + c.for_help());
                h.show();
            }
        };

        menuBar_iCing.addItem(c.About() + " iCing", commandAbout);
        // menuBar_iCing.addItem(c.Preferences(), commandPref);
        menuBar.addItem(c.iCing(), menuBar_iCing);
        menuBar.addItem(c.File(), menuBar_file);
        menuBar_file.addItem(c.Upload(), commandFile);
        menuBar_file.addItem(c.PurgeProject(), commandPurgeProject);
        // menuBar_file.addItem(c.Exit(), commandExit);
        final MenuBar menuBar_edit = new MenuBar(true);
        // menuBar_edit.setVisible(false);// doesn't 'help'
        menuBar.addItem(c.Edit(), menuBar_edit);
        menuBar_edit.addItem(c.Criteria(), commandCriteria);
        menuBar_edit.addItem(c.Options(), commandOptions);
        menuBar.addItem(c.Run(), commandRun);
        final MenuBar menuBar_view = new MenuBar(true);
        menuBar.addItem(c.View(), menuBar_view);

        menuBar_view.addItem(c.Report(), commandReport);
        // menuItemReport.addStyleDependentName("disabled");
        menuBar_view.addItem(c.Log() + " CING", commandCingLog);
        // menuItemLogCing.addStyleDependentName("disabled");
        // menuBar_view.addItem(c.Log() + " iCing", commandLog);
        // MenuItem menuItem3D = menuBar.addItem(c.threeD(), (Command) null);
        // menuItem3D.addStyleDependentName("disabled"); // try to improve
        // styling.
View Full Code Here


    private void _dispatchColumnHeader(final String colName) {
      Widget ww = focusPanel;
      int left = ww.getAbsoluteLeft();
      int top = ww.getAbsoluteTop() + ww.getOffsetHeight();

        MenuBar menu = new MenuBar(true);
//        menu.setStylePrimaryName("PopupMenu");
        final PopupPanel menuPopup = new PopupPanel(true);
       
        menu.addItem(new MenuItem("Sort up", new Command() {
        public void execute() {
          sortByColumn(colName, false);
          menuPopup.hide();
        }
        }));
        menu.addItem(new MenuItem("Sort down", new Command() {
        public void execute() {
          sortByColumn(colName, true);
          menuPopup.hide();
        }
        }));
View Full Code Here

   
    class friendListCallback extends Callback<JavaScriptObject> {
      @Override
        public void onSuccess(JavaScriptObject response){
        friendList = new MenuBar(true);
            JSOModel jso = response.cast();
            if (jso.hasKey("error")) {
                    Window.alert("Get Friend List Error");
                    return;
            }
View Full Code Here

    public RulesNewMenuViewImpl() {
        super( true );
        setAutoOpen( true );
        setAnimationEnabled( true );

        MenuBar createNewMenu = new MenuBar( true );

        createNewMenu.addItem( Util.getHeader( images.businessRule(), constants.BusinessRuleGuidedEditor() ).asString(),
                true,
                new Command() {
                    public void execute() {
                        presenter.onOpenWizard( AssetFormats.BUSINESS_RULE, true );
                    }
                } );

        createNewMenu.addItem( Util.getHeader( images.ruleAsset(), constants.DSLBusinessRuleTextEditor() ).asString(),
                true,
                new Command() {
                    public void execute() {
                        presenter.onOpenWizard( AssetFormats.DSL_TEMPLATE_RULE, true );
                    }
                } );

        createNewMenu.addItem( Util.getHeader( images.ruleAsset(), constants.DRLRuleTechnicalRuleTextEditor() ).asString(),
                true,
                new Command() {
                    public void execute() {
                        presenter.onOpenWizard( AssetFormats.DRL, true );
                    }
                } );

        createNewMenu.addItem( Util.getHeader( images.spreadsheetSmall(), constants.DecisionTableSpreadsheet() ).asString(),
                true,
                new Command() {
                    public void execute() {
                        presenter.onOpenWizard( AssetFormats.DECISION_SPREADSHEET_XLS, true );
                    }
                } );

        createNewMenu.addItem( Util.getHeader( images.gdst(), constants.DecisionTableWebGuidedEditor() ).asString(),
                true,
                new Command() {
                    public void execute() {
                        presenter.onOpenWizard( AssetFormats.DECISION_TABLE_GUIDED, true );
                    }
                } );

        createNewMenu.addItem( Util.getHeader( images.testManager(), constants.TestScenario() ).asString(),
                true,
                new Command() {
                    public void execute() {
                        presenter.onOpenWizard( AssetFormats.TEST_SCENARIO, false );
                    }
View Full Code Here

    private static Constants constants = (Constants) GWT.create( Constants.class );
    private static Images    images    = (Images) GWT.create( Images.class );

    public static MenuBar getMenu(final NavigationItemBuilderOld manager) {

        MenuBar createNewMenu = new MenuBar( true );

        createNewMenu.addItem( Util.getHeader( images.snapshotSmall(),
                                               constants.NewDeploymentSnapshot() ).asString(),
                               true,
                               new Command() {
                                   public void execute() {
                                       SnapshotView.showNewSnapshot( new Command() {
                                           public void execute() {
                                               //we have to refresh the whole tree when a snapshot was added to previously empty package.
                                               manager.refreshTree();
                                           }
                                       } );
                                   }
                               } );

        createNewMenu.addItem( Util.getHeader( images.refresh(),
                                               constants.RebuildAllSnapshotBinaries() ).asString(),
                               true,
                               new Command() {
                                   public void execute() {
                                       SnapshotView.rebuildBinaries();
                                   }
                               } );

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

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

        return rootMenuBar;
    }
View Full Code Here

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

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

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

        return rootMenuBar;
    }
View Full Code Here

        Window.alert("Not implemented yet :-(");
      }
    };

    // wadl menu
    MenuBar wadlMenu = new MenuBar(true);
    wadlMenu.addItem(GuiFactory.strings.save(), true, new Command() {
      public void execute() {
        WadlPanel.wadlSaveButton.click();
      }
    });
    wadlMenu.addItem(GuiFactory.strings.preview(), true, new Command() {
      public void execute() {
        WadlPanel.wadlPreviewButton.click();       
      }
     
    });
    wadlMenu.addItem(GuiFactory.strings.separator(), true, cmd);
    wadlMenu.addItem(GuiFactory.strings.compile(), true, new Command() {
      public void execute() {
        WadlPanel.generateCodeButton.click();
      }     
    });
    wadlMenu.addItem(GuiFactory.strings.separator(), true, cmd);
    wadlMenu.addItem(GuiFactory.strings.upload(), true, new Command() {
      public void execute() {
        WadlUploadDialog.show();
      }     
    });
    wadlMenu.addItem(GuiFactory.strings.separator(), true, cmd);
    wadlMenu.addItem(GuiFactory.strings.reset(), true, new Command() {
      public void execute() {
        WadlPanel.resetButton.click();
      }
    });
   
    // edit menu
    MenuBar editMenu = new MenuBar(true);
    editMenu.addItem(GuiFactory.strings.undo(), true, cmd);
    editMenu.addItem(GuiFactory.strings.redo(), true, cmd);

    // navigate menu
    MenuBar navigateMenu = new MenuBar(true);
    navigateMenu.addItem(GuiFactory.strings.jumpToParametersDeclaration(), true, cmd);
    navigateMenu.addItem(GuiFactory.strings.jumpToRequestDeclaration(), true, cmd);
    navigateMenu.addItem(GuiFactory.strings.jumpToResponseDeclaration(), true, cmd);
    navigateMenu.addItem(GuiFactory.strings.separator(), true, cmd);
    navigateMenu.addItem(GuiFactory.strings.jumpToBeginning(), true, cmd);
    navigateMenu.addItem(GuiFactory.strings.jumpToEnd(), true, cmd);
   
    // help menu
    MenuBar helpMenu = new MenuBar(true);
    helpMenu.addItem(GuiFactory.strings.userManual(), true, new Command() {
      public void execute() {
        HelpDialog.show();
      }
    });   
    helpMenu.addItem(GuiFactory.strings.about(), true, new Command() {
      public void execute() {
        AboutDialog.show();
      }
    });   
   
    MenuBar mainMenu = new MenuBar();    
    mainMenu.addItem(GuiFactory.strings.wadl(), true, wadlMenu);
    mainMenu.addItem(GuiFactory.strings.edit(), true, editMenu);
    mainMenu.addItem(GuiFactory.strings.navigate(), true, navigateMenu);
    mainMenu.addItem(GuiFactory.strings.help(), true, helpMenu);
   
    menuPanel.add(mainMenu);
   
    initWidget(menuPanel);
  }
View Full Code Here

    private EventBus eventBus;

    public MenuBar createMenuBar(final MultiViewEditor editor, EventBus eventBus) {
        this.eventBus = eventBus;
       
        MenuBar toolbar = new MenuBar();

        toolbar.addItem(constants.SaveAllChanges(),
                new Command() {

                    public void execute() {
                        editor.checkin(false);
                    }
                });
        toolbar.addItem(constants.SaveAndCloseAll(),
                new Command() {

                    public void execute() {
                        editor.checkin(true);
                    }
View Full Code Here

            final TableRow tr = headerGroup.newTableRow();
            for (int i=0; i < rgs.length; i++) {
                final PropertyDescriptor pd = (PropertyDescriptor)propertyDescriptorsMap.get(rgs[i]);
                final TableHeaderCell thc = tr.newTableHeaderCell();

                final MenuBar colMenu = new MenuBar(true);
                if (pd instanceof SortablePropertyDescriptor) {
                    final MenuItem sortItem = createSortMenu((SortablePropertyDescriptor)pd);
                    colMenu.addItem(sortItem);
                }
                if (pd instanceof FilterablePropertyDescriptor) {
                    // TODO: filter menu items
                }

                colMenu.addItem("Hide Column", new Command() {
                    public void execute() {
                        Window.alert("Hide not yet supported.");
                    }
                });

                final MenuBar menu = new MenuBar();
                menu.addItem(pd.getDisplayName(), colMenu);
                thc.add(menu);
                tr.add(thc);
            }
            headerGroup.add(tr);
        }
View Full Code Here

        }

        private MenuItem createSortMenu(final SortablePropertyDescriptor spd) {
            final Comparator comparator = spd.getComparator();

            final MenuBar sortMenu = new MenuBar(true);
            sortMenu.addItem("Sort Up", new Command() {
                public void execute() {
                    //Window.alert("Sort Up not implemented.");
                    final Comparator reverse = new Comparator() {
                        public int compare(final Object o1, final Object o2) {
                            return comparator.compare(o2, o1);
                        }
                    };
                    ptel.setComparator(reverse);
                }
            });
            sortMenu.addItem("Sort Down", new Command() {
                public void execute() {
                    //Window.alert("Sort Down not implemented.");
                    ptel.setComparator(comparator);
                }
            });
View Full Code Here

TOP

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

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.