@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(); }