Package com.vaadin.ui.MenuBar

Examples of com.vaadin.ui.MenuBar.Command


    final MenuBar.MenuItem find = edit.addItem("Find/Replace", menuCommand);
    Link sample = new Link("Google search", new ExternalResource(
        "http://www.google.com"));
    sample.setDescription("Visit google.com");
    // Actions can be added inline as well, of course
    find.addItem("Google Search", new Command() {
      /**
       *
       */
      private static final long serialVersionUID = 4723307629344582943L;

View Full Code Here


  private MenuBar getMenu() {
    MenuBar menubar = new MenuBar();
    menubar.setWidth("100%");
    actionMenu = menubar.addItem("Action", null);

    actionMenu.addItem("Built-in Action...", new Command() {
      @Override
      public void menuSelected(MenuItem selectedItem) {
        main.showNotification("Built-in Action executed!");
      }
    });
    actionMenu.addSeparator();

    final MenuBar.MenuItem viewMenu = menubar.addItem("Help", null);
    viewMenu.addItem("About...", new Command() {
      @Override
      public void menuSelected(MenuItem selectedItem) {
        main.addWindow(getAboutDialog());
      }
    });
View Full Code Here

    });
    getToolbar().addComponent(button);
    buttonActionMap.put(actionContribution, button);

    @SuppressWarnings("serial")
    MenuItem menuItem = actionMenu.addItem(actionContribution.getText(), new Command() {
      @Override
      public void menuSelected(MenuItem selectedItem) {
        actionContribution.execute(application);
      }
    });
View Full Code Here

    MenuItem rootItem = profileMenu.addItem(user.getFirstName() + " " + user.getLastName(), null);
    rootItem.setStyleName(ExplorerLayout.STYLE_HEADER_PROFILE_MENU);
   
    if(useProfile()) {
      // Show profile
      rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_SHOW), new Command() {
        public void menuSelected(MenuItem selectedItem) {
          ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
        }
      });
     
      // Edit profile
      rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_EDIT), new Command() {
       
        public void menuSelected(MenuItem selectedItem) {
          // TODO: Show in edit-mode
          ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
        }
      });
     
      // Change password
      rootItem.addItem(i18nManager.getMessage(Messages.PASSWORD_CHANGE), new Command() {
        public void menuSelected(MenuItem selectedItem) {
          ExplorerApp.get().getViewManager().showPopupWindow(new ChangePasswordPopupWindow());
        }
      });
     
      rootItem.addSeparator();
    }
  
    // Logout
    rootItem.addItem(i18nManager.getMessage(Messages.HEADER_LOGOUT), new Command() {
      public void menuSelected(MenuItem selectedItem) {
        ExplorerApp.get().close();
      }
    });
View Full Code Here

 
  /**
   * Add a menu-item, which executes the given command when clicked.
   */
  public MenuItem addMenuItem(String title, final ToolbarCommand command) {
    return rootItem.addItem(title, new Command() {
      private static final long serialVersionUID = 1L;
      public void menuSelected(MenuItem selectedItem) {
        if(command != null) {
          command.toolBarItemSelected();
        }
View Full Code Here

    MenuItem rootItem = profileMenu.addItem(user.getFirstName() + " " + user.getLastName(), null);
    rootItem.setStyleName(ExplorerLayout.STYLE_HEADER_PROFILE_MENU);
   
    if(useProfile()) {
      // Show profile
      rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_SHOW), new Command() {
        public void menuSelected(MenuItem selectedItem) {
          ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
        }
      });
     
      // Edit profile
      rootItem.addItem(i18nManager.getMessage(Messages.PROFILE_EDIT), new Command() {
       
        public void menuSelected(MenuItem selectedItem) {
          // TODO: Show in edit-mode
          ExplorerApp.get().getViewManager().showProfilePopup(user.getId());
        }
      });
     
      // Change password
      rootItem.addItem(i18nManager.getMessage(Messages.PASSWORD_CHANGE), new Command() {
        public void menuSelected(MenuItem selectedItem) {
          ExplorerApp.get().getViewManager().showPopupWindow(new ChangePasswordPopupWindow());
        }
      });
     
      rootItem.addSeparator();
    }
  
    // Logout
    rootItem.addItem(i18nManager.getMessage(Messages.HEADER_LOGOUT), new Command() {
      public void menuSelected(MenuItem selectedItem) {
        ExplorerApp.get().close();
      }
    });
View Full Code Here

                                addComponent(profilePic);
                                Label userName = new Label("");
                                userName.setSizeUndefined();
                                addComponent(userName);

                                Command perfil = new Command() {
                                    @Override
                                    public void menuSelected(
                                            MenuItem selectedItem) {
                                        UI.getCurrent().addWindow(new ModalTestDeInversor());
                                    }
                                };
                               
                                Command cmd = new Command() {
                                    @Override
                                    public void menuSelected(
                                            MenuItem selectedItem) {
                                        Notification
                                                .show("No implementado");
View Full Code Here

TOP

Related Classes of com.vaadin.ui.MenuBar.Command

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.