Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.ITextOperationTarget.doOperation()


      ITextOperationTarget operation = (ITextOperationTarget) fTextEditor.getAdapter(ITextOperationTarget.class);
      final int opCode = ISourceViewer.QUICK_ASSIST;
      if (operation != null && operation.canDoOperation(opCode)) {
        fTextEditor.selectAndReveal(fPosition.getOffset(), fPosition.getLength());
        operation.doOperation(opCode);
      }
      return;
    }

    super.run();
View Full Code Here


      ITextOperationTarget operation = (ITextOperationTarget) fTextEditor
              .getAdapter(ITextOperationTarget.class);
      final int opCode = ISourceViewer.QUICK_ASSIST;
      if (operation != null && operation.canDoOperation(opCode)) {
        fTextEditor.selectAndReveal(fPosition.getOffset(), fPosition.getLength());
        operation.doOperation(opCode);
      }
      return;
    }

    super.run();
View Full Code Here

  private void triggerContextInfo() {
    ITextOperationTarget target= fCurrentTarget.getViewer().getTextOperationTarget();
    if (target != null) {
      if (target.canDoOperation(ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION))
        target.doOperation(ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION);
    }
  }

  /** Trigger content assist on choice positions */
  private void triggerContentAssist() {
View Full Code Here

    IEditorPart editor = HandlerUtil.getActiveEditor(event);

    ITextOperationTarget operationTarget = (ITextOperationTarget) editor
        .getAdapter(ITextOperationTarget.class);

    operationTarget.doOperation(ISourceViewer.FORMAT);

    return null;
  }

}
View Full Code Here

 
  public static void invokeContentAssist(ScriptEditor editor, int offset) {
    editor.getViewer().setSelectedRange(offset, 0);
    ITextOperationTarget target= (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class);
    if (target != null && target.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)) {
      target.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
    }
  }
 
  public static ContentAssistant getContentAssistant(ScriptEditor scriptEditor) {
    // Need to do this because AdaptedSourceViewer is not extendable
View Full Code Here

      ITextOperationTarget operation = (ITextOperationTarget) fTextEditor
              .getAdapter(ITextOperationTarget.class);
      final int opCode = ISourceViewer.QUICK_ASSIST;
      if (operation != null && operation.canDoOperation(opCode)) {
        fTextEditor.selectAndReveal(fPosition.getOffset(), fPosition.getLength());
        operation.doOperation(opCode);
      }
      return;
    }

    super.run();
View Full Code Here

          .getAdapter(ITextOperationTarget.class);
      final int opCode = ISourceViewer.QUICK_ASSIST;
      if (operation != null && operation.canDoOperation(opCode)) {
        fTextEditor.selectAndReveal(fPosition.getOffset(),
            fPosition.getLength());
        operation.doOperation(opCode);
      }
      return;
    }

    super.run();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.