Community
Participate
Working Groups
Build ID: M20060921-0945 Steps To Reproduce: 1. Add the Cut action to the toolbar (for me done in the ApplicationActionBarAdvisor): private IWorkbenchAction cutAction; ... cutAction = ActionFactory.CUT.create(window); register(cutAction); ... toolBarManager.add(cutAction); 2. register the TextActionHandler for a text widget: TextActionHandler textActionHandler = new TextActionHandler(this.getViewSite().getActionBars()); textActionHandler.addText(myText); 3. Now open the application, put some text in the text widget, mark it and push the icon 'Cut' from the application toolbar. The button gets disabled and the cut-action is not done. More information: I'm using the TextActionHandler in a non-IDE application. The reason for the bug seams to be the following: 1) The text widget gets activated when the user typs some text in the widget. 2) The listener SWT.Deactivate is fired when the user pushes a button from the toolbar. activeTextControl gets null and the button gets deactivated. I have modified the following code in the class TextActionHandler: private class TextControlListener implements Listener { public void handleEvent(Event event) { switch (event.type) { case SWT.Activate: activeTextControl = (Text) event.widget; updateActionsEnableState(); break; case SWT.Deactivate: //do not set the active widget to null //activeTextControl = null; updateActionsEnableState(); break; default: break; } } } I do not know if this could solve the problem, since I haven't tested it very well.
After investigating some time into this issue a better way would be to use the SWT.FocusIn and SWT.FocusOut events instead of the SWT.Activate and SWT.Deactivate event types. For me this leads to the desired behavior of the text cut/copy/paste handlers.
Not sure if you're the right person; punt it back or pass it on...
I'll try and look at this for RC1 PW
No time in 3.3 PW
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.