Bug 124673 [Commands] handlers: TextActionHandler's text actions do not work as expected
In the current implementation, the text actions used to redirect clipboard operations to the active text control's methods do not cause action enablement updates. For example, choosing Select All from the Edit menu (when there was no previous selection) does not enable cut, copy, and delete. The fix could be to call updateActionsEnableState() in each action's runWithEvent(Event) after performing the text operation. Another related problem is that the DeleteActionHandler does not actually delete the selected text, only clears the selection (Text.clearSelection() does nothing to the selected text itself). The fix could be to remove the selected portion of the string, then set the result back to the control.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/TextActionHandler.java
if (activeTextControl != null && !activeTextControl.isDisposed()) {
                activeTextControl.clearSelection();
                return;
            }
            if (deleteAction != null) {
                deleteAction.runWithEvent(event);
                return;
            }
        }
        /**
         * Update state.
         */
        public void updateEnabledState() {
            if (activeTextControl != null && !activeTextControl.isDisposed()) {
                setEnabled(activeTextControl.getSelectionCount() > 0
                        || activeTextControl.getCaretPosition() < activeTextControl
                                .getCharCount());
                return;
            }
            if (deleteAction != null) {
                setEnabled(deleteAction.isEnabled());
                return;
            }
            setEnabled(false);
        }
    }
    private class CutActionHandler extends Action {
        protected CutActionHandler() {
            super(IDEWorkbenchMessages.Cut);
            setId("TextCutActionHandler");