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

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


public class DefaultMultiViewEditorMenuBarCreator implements MultiViewEditorMenuBarCreator {

    private Constants constants = GWT.create(Constants.class);

    public MenuBar createMenuBar(final MultiViewEditor editor) {
        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


        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

        this.closeCommand = closeCommand;
    }

    @Override
    public MenuBar createMenuBar(final MultiViewEditor editor) {
        MenuBar toolbar = super.createMenuBar(editor);
        toolbar.addItem(constants.Close(),this.closeCommand);
        return toolbar;
    }
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

          
            Command  menuCommandEstadoDesastre= new Command() {
                public void execute() {
                    setWindowHref("../EstadoDesastre.html");}};// Create a menu bar          

            MenuBar menu = new MenuBar();
             menu.setAutoOpen(true);
             menu.setWidth("100%");
             menu.setAnimationEnabled(true);
 
             // Create the file menu
             MenuBar fileMenu = new MenuBar(true);
             fileMenu.setAnimationEnabled(true);
             menu.addItem(new MenuItem("Inicio", fileMenu));
               fileMenu.addItem("Salir", menuCommandSalir);
 
               MenuBar eventosMenu = new MenuBar(true);
               eventosMenu.setAnimationEnabled(true);
               if(usuarioGlobal.getPerfil().tienePermiso("MNU_REGISTROS")){
               menu.addItem(new MenuItem("Registros", eventosMenu));
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_DONACIONES")){
               eventosMenu.addSeparator();
               eventosMenu.addItem("Donaciones", menuCommandDoaciones);
              }
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_EVENTOS")){
                eventosMenu.addSeparator();
                eventosMenu.addItem("Eventos", menuCommandEvento);
              }
             if(usuarioGlobal.getPerfil().tienePermiso("MNU_PROPIEDADES_SINIESTRADAS")){
              eventosMenu.addSeparator();
              eventosMenu.addItem("Propiedades Siniestradas", menuCommandPropiedadesSinistradas);
             }
               }
            if(usuarioGlobal.getPerfil().tienePermiso("MNU_DEPOSITOS")){
               MenuBar depositoMenu = new MenuBar(true);
               depositoMenu.setAnimationEnabled(true);
               menu.addItem(new MenuItem("Deposito", depositoMenu));
              
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_SUMINISTROS")){
                depositoMenu.addSeparator();
                depositoMenu.addItem("Stock Suministros", menuCommandStockSuministros);
              }
             if(usuarioGlobal.getPerfil().tienePermiso("MNU_SOLICITUDES_ENVIO")){
              depositoMenu.addSeparator();
              depositoMenu.addItem("Solicitudes de envio", menuCommandSolicitudEnvio);
             }
             }
           if(usuarioGlobal.getPerfil().tienePermiso("MNU_DESASTRES")){
             MenuBar desastresMenu = new MenuBar(true);
             desastresMenu.setAnimationEnabled(true);
             menu.addItem(new MenuItem("Desastres", desastresMenu));
                if(usuarioGlobal.getPerfil().tienePermiso("MNU_DESASTRES_DECLARACION")){
                  desastresMenu.addSeparator();
                  desastresMenu.addItem("Declaracion Desastres", menuCommandDesastre);
             }
                if(usuarioGlobal.getPerfil().tienePermiso("MNU_ESTADO_DESASTRE")){
                  desastresMenu.addItem("Estado Desastre", menuCommandEstadoDesastre);
                }
                if(usuarioGlobal.getPerfil().tienePermiso("MNU_INGRESO_NECESIDADES")){
                  desastresMenu.addSeparator();
                  desastresMenu.addItem("Ingreso Necesidades", menuCommandNecesidades);
                }
                if(usuarioGlobal.getPerfil().tienePermiso("MNU_GESTION_NECESIDADES")){
                  desastresMenu.addItem("Gestion Necesidades", menuCommandGestionNecesidad);
                }
                if(usuarioGlobal.getPerfil().tienePermiso("MNU_GESTION_COSTOS")){
                  desastresMenu.addSeparator();
                  desastresMenu.addItem("Gestion Costos", menuCommandCosto);
                }
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_CALCULO_INDICES")){
               desastresMenu.addSeparator();
               desastresMenu.addItem("Calculo de indicadores", menuCommandIndices);
             }
               }
           if(usuarioGlobal.getPerfil().tienePermiso("MNU_MANTENIMISNTOS")){
               MenuBar basicosMenu = new MenuBar(true);
               basicosMenu.setAnimationEnabled(true);
               menu.addItem(new MenuItem("Mantenimientos", basicosMenu));
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_PUNTO_REFERENCIA")){
                basicosMenu.addSeparator();
                basicosMenu.addItem("Punto Referencia ", menuCommandPuntoReferencia);
              }
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_MANTENIMIENTOS_DEPOSITOS")){
                basicosMenu.addSeparator();
                basicosMenu.addItem("Deposito ", menuCommandDeposito);
              }
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_TIPOS_SUMINISTROS")){
                basicosMenu.addSeparator();
                basicosMenu.addItem("Tipo Suministro ", menuCommandTipoSuministro);
              }
              if(usuarioGlobal.getPerfil().tienePermiso("MNU_TIPOS_COSTOS")){
                basicosMenu.addSeparator();
                basicosMenu.addItem("Tipo Costo ", menuCommandTipoCosto);
             
                
           }
         
           if(usuarioGlobal.getPerfil().tienePermiso("MNU_SEGURIDAD")){
             MenuBar seguridadMenu = new MenuBar(true);
               seguridadMenu.setAnimationEnabled(true);
             menu.addItem(new MenuItem("Seguridad", seguridadMenu));
             seguridadMenu.addSeparator();
            if(usuarioGlobal.getPerfil().tienePermiso("MNU_USUARIOS")){
              seguridadMenu.addItem("Usuarios", menuCommandUsuarios);
              seguridadMenu.addSeparator();
            }
            if(usuarioGlobal.getPerfil().tienePermiso("MNU_PERFILES")){
              seguridadMenu.addItem("Perfiles", menuCommandPerfil);
            }
           }
         
             // Return the menu
             menu.ensureDebugId("cwMenuBar");
View Full Code Here

      });
      profileButton.setEnabled(enabled);
      return profileButton;
    }

    MenuBar profileMenu = new MenuBar(true);

    MenuItem editAccountMenuItem = new MenuItem(getMessages().getString("account", "Account"), new MenuButtonCommand() {
      public void execute() {
        popup.hide();
        // it is possible the user is 'stale', but HIGHLY unlikely
        AuthenticationHandler.getInstance().showEditAccountDialog(getAuthenticatedUser());
      }
    });
    editAccountMenuItem.setTitle(getMessages().getString("editYourAccount", "Edit Your Account"));
    profileMenu.addItem(editAccountMenuItem);

    MenuItem myFilesMenuItem = new MenuItem(getMessages().getString("fileManager", "File Manager"), new MenuButtonCommand() {
      public void execute() {
        GWT.runAsync(new RunAsyncCallback() {
          public void onFailure(Throwable reason) {
          }

          public void onSuccess() {
            popup.hide();
            PromptDialogBox dialogBox = new PromptDialogBox(getMessages().getString("fileManager", "File Manager"), getMessages().getString("close", "Close"),
                null, null, false, false);
            // create a new filemanager for this user
            FileManagerPanel fileManager = new FileManagerPanel(getMessages().getString("fileManager", "File Manager"));
            dialogBox.setContent(fileManager);
            dialogBox.center();
          }
        });
      }
    });
    myFilesMenuItem.setTitle(getMessages().getString("manageFiles", "Manage Files"));
    profileMenu.addItem(myFilesMenuItem);

    ComboMenuButton menuButton = new ComboMenuButton(getMessages().getString("profile", "Profile"), profileMenu);
    menuButton.setEnabled(enabled);
    menuButton.setTitle("Edit account, profile, photos and more");
    return menuButton;
View Full Code Here

    menuButton.setTitle("Edit account, profile, photos and more");
    return menuButton;
  }

  public ComboMenuButton buildManageGroupsButton(boolean enabled) {
    MenuBar groupsMenu = new MenuBar(true);
    MenuItem manageGroupsMenuItem = new MenuItem("Manage My Groups", new ManageMyGroupsCommand(getAuthenticatedUser()));
    manageGroupsMenuItem.setTitle("Manage groups which you administer");
    groupsMenu.addItem(manageGroupsMenuItem);
    groupsMenu.addItem("Manage Group Requests", new ManagePendingGroupJoinsCommand(getAuthenticatedUser()));
    groupsMenu.addItem("Create New Group", new CreateGroupCommand(getAuthenticatedUser(), null));
    groupsMenu.addItem("Join/Leave Groups", new JoinLeaveGroupsCommand(getAuthenticatedUser()));

    ComboMenuButton menuButton = new ComboMenuButton(getMessages().getString("groups", "Groups"), groupsMenu);
    menuButton.setEnabled(enabled);
    menuButton.setTitle("Create, manage or join groups");
    return menuButton;
View Full Code Here

      return GwtReflectionUtils.getPrivateFieldValue(menuBar, "items");
   }

   public static List<MenuItem> getMenuItems(SuggestBox suggestBox) {
      SuggestionDisplay display = GwtReflectionUtils.getPrivateFieldValue(suggestBox, "display");
      MenuBar suggestionMenu = GwtReflectionUtils.getPrivateFieldValue(display, "suggestionMenu");
      return getMenuItems(suggestionMenu);
   }
View Full Code Here

   private boolean called = false;

   @Test
   public void addItem() {
      // Arrange
      MenuBar bar = new MenuBar();

      // Act
      MenuItem item0 = bar.addItem("test0", cmd);
      MenuItem item1 = bar.addItem("test1", cmd);

      // Assert
      assertEquals(0, bar.getItemIndex(item0));
      assertEquals(1, bar.getItemIndex(item1));
      assertEquals(bar, item0.getParentMenu());
      assertEquals(bar, item1.getParentMenu());
   }
View Full Code Here

   }

   @Test
   public void addSeparator() {
      // Arrange
      MenuBar bar = new MenuBar();
      bar.addItem("test0", cmd);

      // Act
      MenuItemSeparator separator = bar.addSeparator();
      bar.addItem("test1", cmd);

      // Assert
      assertEquals(1, bar.getSeparatorIndex(separator));
   }
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.