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);
  }