@Override public void update() { findAnnotation(); setEnabled(true); // super.update() might change this later if (!mCanFix) { super.update(); } }
@Override public void runWithEvent(Event event) { if (mCanFix) { ITextOperationTarget operation = (ITextOperationTarget) mTextEditor.getAdapter(ITextOperationTarget.class); final int opCode = ISourceViewer.QUICK_ASSIST; if (operation != null && operation.canDoOperation(opCode)) { mTextEditor.selectAndReveal(mPosition.getOffset(), mPosition.getLength()); operation.doOperation(opCode); } return; } super.run(); }
/* * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event) * @since 3.2 */ public void runWithEvent(Event event) { if (fAnnotation instanceof OverrideIndicatorManager.OverrideIndicator) { ((OverrideIndicatorManager.OverrideIndicator) fAnnotation).open(); return; } 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; } super.run(); }
public void update() { findJavaAnnotation(); setEnabled(true); // super.update() might change this later if (fAnnotation instanceof OverrideIndicatorManager.OverrideIndicator) { initialize( fBundle, "JavaSelectAnnotationRulerAction.OpenSuperImplementation."); // $NON-NLS-1$ return; } if (fHasCorrection) { if (fAnnotation instanceof AssistAnnotation) initialize(fBundle, "JavaSelectAnnotationRulerAction.QuickAssist."); // $NON-NLS-1$ else initialize(fBundle, "JavaSelectAnnotationRulerAction.QuickFix."); // $NON-NLS-1$ return; } initialize(fBundle, "JavaSelectAnnotationRulerAction.GotoAnnotation."); // $NON-NLS-1$; super.update(); }