Esempio n. 1
0
  public void addProjectTools(SessionInfo sessionInfo) {
    if (sessionInfo.isIndexingEnabled()) {
      addLeftSeparator();

      CodeSearch codeSearch = pCodeSearch_.get();

      addLeftWidget(codeSearch.getSearchWidget());
    } else {
      commands_.goToFileFunction().setVisible(false);
    }

    // project popup menu
    ProjectPopupMenu projectMenu = new ProjectPopupMenu(sessionInfo, commands_);
    addRightWidget(projectMenu.getToolbarButton());
  }
Esempio n. 2
0
  public void completeInitialization(SessionInfo sessionInfo) {
    StandardIcons icons = StandardIcons.INSTANCE;

    if (sessionInfo.isVcsEnabled()) {
      addLeftSeparator();

      ToolbarPopupMenu vcsMenu = new ToolbarPopupMenu();
      vcsMenu.addItem(commands_.vcsFileDiff().createMenuItem(false));
      vcsMenu.addItem(commands_.vcsFileLog().createMenuItem(false));
      vcsMenu.addItem(commands_.vcsFileRevert().createMenuItem(false));
      vcsMenu.addSeparator();
      vcsMenu.addItem(commands_.vcsViewOnGitHub().createMenuItem(false));
      vcsMenu.addItem(commands_.vcsBlameOnGitHub().createMenuItem(false));
      vcsMenu.addSeparator();
      vcsMenu.addItem(commands_.vcsCommit().createMenuItem(false));
      vcsMenu.addSeparator();
      vcsMenu.addItem(commands_.vcsPull().createMenuItem(false));
      vcsMenu.addItem(commands_.vcsCleanup().createMenuItem(false));
      vcsMenu.addItem(commands_.vcsPush().createMenuItem(false));
      vcsMenu.addSeparator();
      vcsMenu.addItem(commands_.vcsShowHistory().createMenuItem(false));
      vcsMenu.addSeparator();
      vcsMenu.addItem(commands_.versionControlProjectSetup().createMenuItem(false));

      ImageResource vcsIcon = null;
      if (sessionInfo.getVcsName().equals(VCSConstants.GIT_ID)) vcsIcon = icons.git();
      else if (sessionInfo.getVcsName().equals(VCSConstants.SVN_ID)) vcsIcon = icons.svn();

      ToolbarButton vcsButton = new ToolbarButton(null, vcsIcon, vcsMenu);
      vcsButton.setTitle("Version control");
      addLeftWidget(vcsButton);
    }

    if (sessionInfo.getShinyappsInstalled()) {
      addLeftSeparator();
      ToolbarButton deployButton = commands_.shinyAppsDeploy().createToolbarButton();
      deployButton.setText("Deploy");
      addLeftWidget(deployButton);
    }

    // project popup menu
    ProjectPopupMenu projectMenu = new ProjectPopupMenu(sessionInfo, commands_);
    addRightWidget(projectMenu.getToolbarButton());
  }