Community
Participate
Working Groups
There are at least four copies of TextViewerAction in the platform. org.eclipse.ui.console.actions.TextViewerAction (this is bad since this is API) org.eclipse.jdt.internal.ui.preferences.EditTemplateDialog.TextViewerAction org.eclipse.ui.texteditor.templates.TemplatePreferencePage.EditTemplateDialog... org.eclipse.team.internal.ccvs.ui.TextViewerAction Is there a better way to do this now or should we come up with API?
What's the point of this question? Do you have the need for something specific? If not, did you compare them? Are they similar?
Yes, they are all the same... private class TextViewerAction extends Action implements IUpdate { private int fOperationCode= -1; private ITextOperationTarget fOperationTarget; /** * Creates a new action. * * @param viewer the viewer * @param operationCode the opcode */ public TextViewerAction(ITextViewer viewer, int operationCode) { fOperationCode= operationCode; fOperationTarget= viewer.getTextOperationTarget(); update(); } /** * Updates the enabled state of the action. * Fires a property change if the enabled state changes. * * @see Action#firePropertyChange(String, Object, Object) */ public void update() { // XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=206111 if (fOperationCode == ITextOperationTarget.REDO) return; boolean wasEnabled= isEnabled(); boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode)); setEnabled(isEnabled); if (wasEnabled != isEnabled) { firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE); } } /** * @see Action#run() */ public void run() { if (fOperationCode != -1 && fOperationTarget != null) { fOperationTarget.doOperation(fOperationCode); } } }
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.