Esempio n. 1
0
 @Override
 protected void handleSettingsChanged(
     final Set<String> groupIds, final Map<String, Object> options) {
   super.handleSettingsChanged(groupIds, options);
   if (groupIds.contains(RCodeStyleSettings.INDENT_GROUP_ID)
       && UIAccess.isOkToUse(getOutputViewer())) {
     final RCodeStyleSettings codeStyle = (getConsole()).getRCodeStyle();
     if (codeStyle.isDirty()) {
       getOutputViewer().setTabWidth(codeStyle.getTabSize());
     }
   }
 }
Esempio n. 2
0
  @Override
  protected void initActions(
      final IServiceLocator serviceLocator, final HandlerCollection handlers) {
    super.initActions(serviceLocator, handlers);

    final IContextService contextService =
        (IContextService) serviceLocator.getService(IContextService.class);
    contextService.activateContext("de.walware.statet.r.actionSets.RSessionTools"); // $NON-NLS-1$

    fHelpContextProvider =
        RUIHelp.createEnrichedRHelpContextProvider(
            getInputGroup().getViewer(), IRUIHelpContextIds.R_CONSOLE);
    getInputGroup()
        .getViewer()
        .getTextWidget()
        .addHelpListener(
            new HelpListener() {
              public void helpRequested(final HelpEvent e) {
                PlatformUI.getWorkbench()
                    .getHelpSystem()
                    .displayHelp(fHelpContextProvider.getContext(null));
              }
            });
  }
Esempio n. 3
0
 @Override
 protected void collectContextMenuPreferencePages(final List<String> pageIds) {
   super.collectContextMenuPreferencePages(pageIds);
   pageIds.add("de.walware.statet.r.preferencePages.REditorOptions"); // $NON-NLS-1$
   pageIds.add("de.walware.statet.r.preferencePages.RTextStylesPage"); // $NON-NLS-1$
 }
Esempio n. 4
0
  @Override
  protected void contributeToActionBars(
      final IServiceLocator serviceLocator,
      final IActionBars actionBars,
      final HandlerCollection handlers) {
    super.contributeToActionBars(serviceLocator, actionBars, handlers);

    final IMenuManager menuManager = actionBars.getMenuManager();

    menuManager.appendToGroup(
        NICO_CONTROL_MENU_ID,
        new CommandContributionItem(
            new CommandContributionItemParameter(
                getSite(),
                null,
                NicoUI.PAUSE_COMMAND_ID,
                null,
                null,
                null,
                null,
                null,
                null,
                null,
                CommandContributionItem.STYLE_CHECK,
                null,
                false)));
    if (getConsole().getProcess().isProvidingFeatureSet(IRemoteEngineController.FEATURE_SET_ID)) {
      menuManager.appendToGroup(
          NICO_CONTROL_MENU_ID,
          new CommandContributionItem(
              new CommandContributionItemParameter(
                  getSite(),
                  null,
                  NicoUI.DISCONNECT_COMMAND_ID,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  CommandContributionItem.STYLE_PUSH,
                  null,
                  false)));
      menuManager.appendToGroup(
          NICO_CONTROL_MENU_ID,
          new CommandContributionItem(
              new CommandContributionItemParameter(
                  getSite(),
                  null,
                  NicoUI.RECONNECT_COMMAND_ID,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  CommandContributionItem.STYLE_PUSH,
                  null,
                  false)));
    }

    menuManager.insertBefore(
        SharedUIResources.ADDITIONS_MENU_ID, new Separator("workspace")); // $NON-NLS-1$
    menuManager.appendToGroup(
        "workspace", //$NON-NLS-1$
        new ChangeWorkingDirectoryWizard.ChangeAction(this));

    menuManager.insertBefore(
        SharedUIResources.ADDITIONS_MENU_ID, new Separator("view")); // $NON-NLS-1$
    menuManager.appendToGroup(
        "view", //$NON-NLS-1$
        new AdjustWithAction());

    final RProcess process = (RProcess) getConsole().getProcess();
    if (process.isProvidingFeatureSet(RTool.R_DATA_FEATURESET_ID)
        && process.getAdapter(IREnvConfiguration.class) != null) {
      final MenuManager rEnv = new MenuManager("R environment");
      menuManager.appendToGroup(NICO_CONTROL_MENU_ID, rEnv);

      rEnv.add(
          new HandlerContributionItem(
              new CommandContributionItemParameter(
                  getSite(),
                  null,
                  HandlerContributionItem.NO_COMMAND_ID,
                  null,
                  null,
                  null,
                  null,
                  "Index c&ompletely",
                  null,
                  null,
                  CommandContributionItem.STYLE_PUSH,
                  null,
                  false),
              new REnvUpdateHandler(process, true)));
      rEnv.add(
          new HandlerContributionItem(
              new CommandContributionItemParameter(
                  getSite(),
                  null,
                  HandlerContributionItem.NO_COMMAND_ID,
                  null,
                  null,
                  null,
                  null,
                  "Index ch&anges",
                  null,
                  null,
                  CommandContributionItem.STYLE_PUSH,
                  null,
                  false),
              new REnvUpdateHandler(process, false)));
    }
  }
Esempio n. 5
0
 @Override
 public void createControl(final Composite parent) {
   super.createControl(parent);
 }