예제 #1
0
 /**
  * Needed for content assistant in the Text viewer. This ensures actions such as key press would
  * trigger content assistant
  */
 @SuppressWarnings("deprecation")
 protected void createActions() {
   super.createActions();
   ResourceBundle bundle = T24BasicPlugin.getDefault().getResourceBundle();
   String id = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS;
   Action action = new ContentAssistAction(bundle, "ContentAssistProposal", this);
   action.setActionDefinitionId(id);
   setAction("ContentAssistProposal", action);
   this.markAsContentDependentAction(id, true);
   ResourceAction printAction =
       new TextOperationAction(bundle, "Editor.Print.", this, ITextOperationTarget.PRINT, true);
   String printid = IWorkbenchActionDefinitionIds.PRINT;
   printAction.setHelpContextId(IAbstractTextEditorHelpContextIds.PRINT_ACTION);
   printAction.setActionDefinitionId(printid);
   setAction(ITextEditorActionConstants.PRINT, new PrintActionDecorator(printAction));
   this.markAsContentDependentAction(printid, true);
 }
예제 #2
0
  @Override
  protected void createActions() {
    super.createActions();
    // TODO: Figure out how to do this later.
    //  	fFoldingGroup= new FoldingActionGroup(this, getSourceViewer());

    // Sticky hover support
    ResourceAction resAction =
        new TextOperationAction(
            AutoconfEditorMessages.getResourceBundle(),
            "ShowToolTip.",
            this,
            ISourceViewer.INFORMATION,
            true); //$NON-NLS-1$
    resAction =
        new InformationDispatchAction(
            AutoconfEditorMessages.getResourceBundle(),
            "ShowToolTip.",
            (TextOperationAction) resAction); // $NON-NLS-1$
    resAction.setActionDefinitionId(IAutotoolEditorActionDefinitionIds.SHOW_TOOLTIP);
    setAction("ShowToolTip", resAction); // $NON-NLS-1$
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(resAction, IAutotoolHelpContextIds.SHOW_TOOLTIP_ACTION);

    // Content assist
    Action action =
        new ContentAssistAction(
            AutoconfEditorMessages.getResourceBundle(),
            "ContentAssistProposal.",
            this); //$NON-NLS-1$
    action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    setAction("ContentAssistProposal", action); // $NON-NLS-1$
    markAsStateDependentAction("ContentAssistProposal", true); // $NON-NLS-1$
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(action, IAutotoolHelpContextIds.CONTENT_ASSIST);
  }