Examples of canDoOperation()


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

    if (fIsEditable) {

      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;
    }
View Full Code Here

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

    if (fHasCorrection) {
      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;
    }
View Full Code Here

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

      }

      public void update() {
        ITextOperationTarget target = (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class);

        boolean isEnabled = (target != null && target.canDoOperation(ProjectionViewer.TOGGLE));
        setEnabled(isEnabled);
      }
    };
   
    IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
View Full Code Here

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

      }

      public void update() {
        ITextOperationTarget target = (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class);

        boolean isEnabled = (target != null && target.canDoOperation(ProjectionViewer.TOGGLE));
        setEnabled(isEnabled);
      }
    };
   
    IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
View Full Code Here

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

  }

  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 */
 
View Full Code Here

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

  }
 
  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) {
View Full Code Here

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

      public void update() {
        ITextOperationTarget target = (ITextOperationTarget) editor
            .getAdapter(ITextOperationTarget.class);

        boolean isEnabled = (target != null && target
            .canDoOperation(ProjectionViewer.TOGGLE));
        setEnabled(isEnabled);
      }
    };
    fToggle.setChecked(true);
View Full Code Here

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

    if (fHasCorrection) {
      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;
    }
View Full Code Here

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

    if (fHasCorrection) {
      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;
View Full Code Here

Examples of org.eclipse.jface.text.source.projection.ProjectionViewer.canDoOperation()

        private void toggleFolding() {
            final ISourceViewer sourceViewer = getSourceViewer();
            if (sourceViewer instanceof ProjectionViewer) {
                final ProjectionViewer pv = (ProjectionViewer) sourceViewer;
                if (pv.isProjectionMode() != EditorUtility.isFoldingEnabled()) {
                    if (pv.canDoOperation(ProjectionViewer.TOGGLE)) {
                        pv.doOperation(ProjectionViewer.TOGGLE);
                    }
                }
            }
        }
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.