@Override
  protected void setupMenu() {

    final AbstractWorkbenchPerspectiveActivity defaultPerspective =
        menusHelper.getDefaultPerspectiveActivity();
    final Menus menus =
        MenuFactory.newTopLevelMenu(constants.Home())
            .place(new DefaultPlaceRequest(defaultPerspective.getIdentifier()))
            .endMenu()
            .newTopLevelMenu(constants.Authoring())
            .withItems(getAuthoringViews())
            .endMenu()
            .newTopLevelMenu(constants.Deploy())
            .withItems(getDeploymentViews())
            .endMenu()
            .newTopLevelMenu(constants.Case_Management())
            .withItems(getCaseManagementViews())
            .endMenu()
            .newTopLevelMenu(constants.Process_Management())
            .withItems(getProcessManagementViews())
            .endMenu()
            .newTopLevelMenu(constants.Work())
            .withItems(getWorkViews())
            .endMenu()
            .newTopLevelMenu(constants.Dashboards())
            .withItems(getDashboardsViews())
            .endMenu()
            .newTopLevelMenu(constants.Extensions())
            .withItems(menusHelper.getExtensionsViews())
            .endMenu()
            .newTopLevelMenu(constants.Experimental())
            .withItems(getExperimentalViews())
            .endMenu()
            .newTopLevelCustomMenu(iocManager.lookupBean(SearchMenuBuilder.class).getInstance())
            .endMenu()
            .build();

    menuBar.addMenus(menus);

    menusHelper.addRolesMenuItems();
    menusHelper.addGroupsMenuItems();
    menusHelper.addWorkbenchConfigurationMenuItem();
    menusHelper.addUtilitiesMenuItems();
  }
Ejemplo n.º 2
0
  private void setupMenu() {
    final AbstractWorkbenchPerspectiveActivity defaultPerspective = getDefaultPerspectiveActivity();

    final Menus menus =
        MenuFactory.newTopLevelMenu(AppConstants.INSTANCE.Home())
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    if (defaultPerspective != null) {
                      placeManager.goTo(
                          new DefaultPlaceRequest(defaultPerspective.getIdentifier()));
                    } else {
                      Window.alert("Default perspective not found.");
                    }
                  }
                })
            .endMenu()
            .newTopLevelMenu(AppConstants.INSTANCE.MenuOrganizationalUnits())
            .menus()
            .menu(AppConstants.INSTANCE.MenuManageOrganizationalUnits())
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(
                        "org.kie.workbench.common.screens.organizationalunit.manager.OrganizationalUnitManager");
                  }
                })
            .endMenu()
            .endMenus()
            .endMenu()
            .newTopLevelMenu("Repositories")
            .menus()
            .menu("Repositories List")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo("RepositoriesEditor");
                  }
                })
            .endMenu()
            .menu("Clone repository")
            .respondsWith(cloneRepoCommand)
            .endMenu()
            .menu("New repository")
            .respondsWith(newRepoCommand)
            .endMenu()
            .endMenus()
            .endMenu()
            .newTopLevelMenu("Authoring")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    if (defaultPerspective != null) {
                      placeManager.goTo(new DefaultPlaceRequest("AuthoringPerspective"));
                    } else {
                      Window.alert(" perspective not found.");
                    }
                  }
                })
            .endMenu()
            .newTopLevelMenu("Artifacts")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(
                        new DefaultPlaceRequest(
                            "org.guvnor.m2repo.client.perspectives.GuvnorM2RepoPerspective"));
                  }
                })
            .endMenu()
            .newTopLevelMenu("Wires")
            .menus()
            .menu("Scratch Pad")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("WiresScratchPadPerspective"));
                  }
                })
            .endMenu()
            .menu("Trees")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("WiresTreesPerspective"));
                  }
                })
            .endMenu()
            .menu("Bayesian networks")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("WiresBayesianPerspective"));
                  }
                })
            .endMenu()
            .endMenus()
            .endMenu()
            .newTopLevelMenu("Workbench")
            .menus()
            .menu("Apps")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("AppsPerspective"));
                  }
                })
            .endMenu()
            .menu("Plugins")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("PlugInAuthoringPerspective"));
                  }
                })
            .endMenu()
            .endMenus()
            .endMenu()
            .newTopLevelMenu("Messages")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("MessagesPerspective"));
                  }
                })
            .endMenu()
            .newTopLevelMenu("Inbox")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("InboxPerspective"));
                  }
                })
            .endMenu()
            .newTopLevelMenu("Assets")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("AssetsPerspective"));
                  }
                })
            .endMenu()
            .newTopLevelMenu("Projects")
            .respondsWith(
                new Command() {
                  @Override
                  public void execute() {
                    placeManager.goTo(new DefaultPlaceRequest("ProjectsPerspective"));
                  }
                })
            .endMenu()
            .newTopLevelMenu(AppConstants.INSTANCE.Logout())
            .respondsWith(new LogoutCommand())
            .position(MenuPosition.RIGHT)
            .endMenu()
            .build();

    menubar.addMenus(menus);
  }