Project: Eclipse_Platform_UI
Bug 125437 [Commands] handlers: TextActionHandler does not properly maintain enablement of its delegate actions
Reported: 2006-01-26 22:54:25 | Status: verified fixed

In order to synchronize enablement behavior of global clipboard actions managed by TextActionHandler with Text control's native context menu, the following rules should be observed: 1. Cut, Paste and Delete should only be enabled for editable Text fields 2. In addition, Paste should only be enabled if there is textual content on the clipboard 3. Select All should only be enabled when there is at least one character in the Text control Furthermore, TextActionHandler does not properly update enablement in its addText(Text) method. For one, it assumes that the Text control being added is currently active, OR that this method will be called before set<Action>(IAction) methods are (which properly update enablement). This may not be the case, particularly in scenarios where the global actions are shared (e.g., editor's action bar contributor) and controls are added only after the actions have been set. This is in follow-up to bugs.eclipse.org/bugs/show_bug.cgi?id=124673. Apparently, I didn't catch all of the problems with TextActionHandler. A proposed patch is attached.

Files changed in fix:
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/TextActionHandler.java