/** * 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 editor.getAdapter(IEncodingSupport.class); return null; }
/** * 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; }
@Override public void update() { ITextOperationTarget target= editor.getAdapter(ITextOperationTarget.class); boolean isEnabled= (target != null && target.canDoOperation(ProjectionViewer.TOGGLE)); setEnabled(isEnabled); } };
public void update() { ITextOperationTarget target= (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class); boolean isEnabled= (target != null && target.canDoOperation(ProjectionViewer.TOGGLE)); setEnabled(isEnabled); } };
@Override public void update() { ITextOperationTarget target= editor.getAdapter(ITextOperationTarget.class); boolean isEnabled= (target != null && target.canDoOperation(ProjectionViewer.TOGGLE)); setEnabled(isEnabled); } };
/** * Returns a <code>IVerticalRulerInfo</code> if this action's editor adapts to one. * * @return the <code>IVerticalRulerInfo</code> for the editor's vertical ruler, or <code>null</code> */ protected IVerticalRulerInfo getRuler() { if (getTextEditor() != null) return (IVerticalRulerInfo)getTextEditor().getAdapter(IVerticalRulerInfo.class); return null; }
/** * Displays information in the status line why a line move is not possible */ private void showStatus() { ITextEditor editor= getTextEditor(); if (editor == null) return; IEditorStatusLine status= editor.getAdapter(IEditorStatusLine.class); if (status == null) return; status.setMessage(false, EditorMessages.Editor_MoveLines_IllegalMove_status, null); }
/** * Gets the editor's encoding support. * * @return the resource being edited or <code>null</code>s */ private IEncodingSupport getEncodingSupport() { if (getTextEditor() != null) return (IEncodingSupport)getTextEditor().getAdapter(IEncodingSupport.class); return null; } }
/** * Returns a <code>IVerticalRulerInfo</code> if this action's editor adapts to one. * * @return the <code>IVerticalRulerInfo</code> for the editor's vertical ruler, or <code>null</code> */ protected IVerticalRulerInfo getRuler() { if (getTextEditor() != null) return (IVerticalRulerInfo)getTextEditor().getAdapter(IVerticalRulerInfo.class); return null; }
/** * Displays information in the status line why a line move is not possible */ private void showStatus() { ITextEditor editor= getTextEditor(); if (editor == null) return; IEditorStatusLine status= editor.getAdapter(IEditorStatusLine.class); if (status == null) return; status.setMessage(false, EditorMessages.Editor_MoveLines_IllegalMove_status, null); }
/** * Gets the editor's encoding support. * * @return the resource being edited or <code>null</code>s */ private IEncodingSupport getEncodingSupport() { if (getTextEditor() != null) return getTextEditor().getAdapter(IEncodingSupport.class); return null; } }
private boolean computeEnablement(ITextEditor editor) { if (editor == null) return false; ITextOperationTarget target= (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class); boolean hasContentAssist= target != null && target.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); if (!hasContentAssist) return false; ISelection selection= editor.getSelectionProvider().getSelection(); return isValidSelection(selection); }
private static IRevisionRulerColumnExtension findEditorRevisonRulerColumn(IWorkbenchPage page, Object object) { ITextEditor editor= findOpenTextEditorFor(page, object); if (editor == null) return null; IRevisionRulerColumn column= (IRevisionRulerColumn) editor.getAdapter(IRevisionRulerColumn.class); if (column instanceof IRevisionRulerColumnExtension) { if (column.getControl() != null && column.getControl().isDisposed()) return null; return (IRevisionRulerColumnExtension) column; } return null; }
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(); }
@Override public void run() { ITextEditor editor= getTextEditor(); if (editor == null || !validateEditorInputState()) return; IRewriteTarget target= editor.getAdapter(IRewriteTarget.class); if (target != null) target.beginCompoundChange(); runCompoundChange(); if (target != null) target.endCompoundChange(); }
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(); }
public void update() { super.update(); if (!isEnabled()) return; if (!canModifyEditor()) { setEnabled(false); return; } ITextEditor editor= getTextEditor(); if (fOperationTarget == null && editor != null && fOperationCode != -1) fOperationTarget= (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class); }
public void update() { super.update(); if (!isReadOnlyOperation() && !canModifyEditor()) { setEnabled(false); return; } ITextEditor editor= getTextEditor(); if (fOperationTarget == null && editor!= null && fOperationCode != -1) fOperationTarget= (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class); boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode)); setEnabled(isEnabled); }
private boolean computeEnablement(ITextEditor editor) { if (editor == null) return false; ITextOperationTarget target= editor.getAdapter(ITextOperationTarget.class); if (target == null || ! target.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)) return false; IJavaProject javaProject = EditorUtility.getJavaProject(editor.getEditorInput()); if (! fCategory.matches(javaProject)) return false; ISelection selection= editor.getSelectionProvider().getSelection(); return isValidSelection(selection); }
private boolean computeEnablement(ITextEditor editor) { if (editor == null) return false; ITextOperationTarget target= editor.getAdapter(ITextOperationTarget.class); if (target == null || ! target.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)) return false; IJavaProject javaProject = EditorUtility.getJavaProject(editor.getEditorInput()); if (! fCategory.matches(javaProject)) return false; ISelection selection= editor.getSelectionProvider().getSelection(); return isValidSelection(selection); }