Examples of ITextEditor


Examples of org.eclipse.ui.texteditor.ITextEditor

  /* (non-Javadoc)
   * Method declared on IAction
   */
  public void run() {

    ITextEditor editor= getTextEditor();

    editor.resetHighlightRange();
    boolean show= editor.showsHighlightRangeOnly();
    setChecked(!show);
    editor.showHighlightRangeOnly(!show);
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

    }

    private void doSetActiveEditor( IEditorPart part ) {
        super.setActiveEditor(part);

        ITextEditor editor = null;
        if (part instanceof ITextEditor)
            editor = (ITextEditor) part;

        fContentAssistProposal.setAction(getAction(editor, ITextEditorActionConstants.CONTENT_ASSIST));
        fContentAssistTip.setAction(getAction(editor, ITextEditorActionConstants.CONTENT_ASSIST_CONTEXT_INFORMATION));
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

      beep();
      return;
    }
   
    IEditorPart editor = window.getActivePage().getActiveEditor();
    ITextEditor textEditor = (ITextEditor) editor;
    new DeeOpenDefinitionHandler().runOperation(textEditor);
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

    return BestMatchHover.doGetHoverRegion(textViewer, offset);
  }
 
  @Override
  public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
    ITextEditor editor = tryCast(getEditor(), ITextEditor.class);
    if(editor == null) {
      return null;
    }
    ISourceModule sourceModule = EditorUtility.getEditorInputModelElement(editor, false);
    if(sourceModule == null) {
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

  /*
   * @see org.eclipse.jface.action.IAction#run()
   */
  public void run() {
    ITextEditor editor= getTextEditor();
    if (editor == null || !validateEditorInputState())
      return;
    IRewriteTarget target= (IRewriteTarget)editor.getAdapter(IRewriteTarget.class);
    if (target != null)
      target.beginCompoundChange();
    runCompoundChange();
    if (target != null)
      target.endCompoundChange();
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

    // protect against concurrent disposal
    IDocumentProvider prov= fDocumentProvider;
    IEditorInput inp= fEditorInput;
    IDocument doc= fReference;
    ITextEditor editor= fEditor;

    if (prov instanceof IStorageDocumentProvider && inp instanceof IStorageEditorInput) {

      IStorageEditorInput input= (IStorageEditorInput) inp;
      IStorageDocumentProvider provider= (IStorageDocumentProvider) prov;
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

    boolean setting= store != null ? store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON) : false;
    if (!setting)
      return false;
   
    boolean modifiable;
    ITextEditor editor= getEditor();
    if (editor instanceof ITextEditorExtension2) {
      ITextEditorExtension2 ext= (ITextEditorExtension2) editor;
      modifiable= ext.isEditorInputModifiable();
    } else if (editor instanceof ITextEditorExtension) {
      ITextEditorExtension ext= (ITextEditorExtension) editor;
      modifiable= ext.isEditorInputReadOnly();
    } else if (editor != null) {
      modifiable= editor.isEditable();
    } else {
      modifiable= true;
    }
    return modifiable;
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

     * Returns the encoding support of the action's editor.
     *
     * @return the encoding support of the action's editor or <code>null</code> if none
     */
    private IEncodingSupport getEncodingSupport() {
      ITextEditor editor= getTextEditor();
      if (editor != null)
        return (IEncodingSupport) editor.getAdapter(IEncodingSupport.class);
      return null;
    }
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

      if (fEncoding == null) {
        setEnabled(false);
        return;
      }

      ITextEditor editor= getTextEditor();
      if (editor == null) {
        setEnabled(false);
        return;
      }

      // update label
      fIsDefault= IEncodingActionsConstants.DEFAULT.equals(fEncoding);
      if (fIsDefault)
        setText(getDefaultEncodingText(editor, fLabel));
      else
        setText(fLabel);

      // update enable state
      if (editor.isDirty())
        setEnabled(false);
      else
        setEnabled(true);

      // update checked state
View Full Code Here

Examples of org.eclipse.ui.texteditor.ITextEditor

    /*
     * @see IUpdate#update()
     */
    public void update() {
      ITextEditor editor= getTextEditor();
      setEnabled(editor != null && !editor.isDirty());
    }
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.