DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Widget Method Handler and Retargetting Actions
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Default Widget Method Handler and Retargetting Actions - 01-07-2009, 05:52 AM

Hello,

I have a small RCP application, which has a View which include a custom Canvas component and a textfield.

As I implement the application, I need to add selectAll behaviour to my canvas, in which case I relied on the WidgetMethodHandler./SelectAllHandler, which introspects the widget for the selectAll method.

I also needed to trap CTRL-C in the view, to perform some more sophisticated copying, in which case the reflective copy() method of one component is useless.

I found that I should be able to do something similar to this:

Code:
viewSite.getActionBars().setGlobalActionHandler(ActionFactory.COPY.getId(), myAction)
However, this in itself was useless, unless I specifically registered an action in my applications ActionBar:

Code:
register(ActionFactory.COPY.create(window))
Which unfortunately seemed to remove the global handler for ctrl-c completely, and suddenly CTRL-C was available in a KeyListener on the custom component, and standard copy in the text field did not work. (I must also point out, that there is no global edit menu, and no need either at this moment)

I duplicated the experiment with the selectAll() method, and found that if I register an action in the ActionBar:

Code:
register(ActionFactory.SELECT_ALL.create(window))
The selectAll functionality no longer works in neither the canvas nor the text field, however, the CTRL-A was available in a KeyListener on the custom component. Needless to say, this behaviour is unacceptable, as I do not trap the selectAll action specifically in the view, and have no intention to, but other view parts of the application may want to, at a later stage, to introduce this and this would without doubt introduce a subtle bug.

Turning it around, I tried to see if i could register the new wizard action (CTRL-N) in the ActionBar, so I could avoid the dialog popping up:

Code:
register(ActionFactory.NEW_WIZARD_DROP_DOWN.create(window))
However, this did not seem to work.

My questions are therefore:

a) First of all, Am I barking up the right tree at all?

b) is it correct that the WidgetMethodHandler/SelectHandler is replaced upon registering a global action in the action bar, and is it not a bug?

c) To what extent is this problem? So far I've only used CTRL-A, CTRL-C and CTRL-N, but I suspect there be more (beside CTRL-X and CTRL-V, which I already suspect are handled similar to CTRL-C).

Does anybody have any comments, or is it just me :-)
Reply With Quote
Reply

Tags
action, eclipse, keybinding, rcp

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing a custom calendarcombo widget bustercap911 Eclipse 1 05-26-2009 06:44 AM
how to insert check box in nebula Gallery widget? jeggu Eclipse 1 11-26-2008 06:59 AM
How to implement EMF redo/undo actions??? Larutan81 Eclipse 0 07-10-2008 09:11 AM
Actions for IExecutionListener dertl Eclipse 0 04-28-2008 01:08 PM
Displaying unicode characters in org.eclipse.swt.widgets.Table widget digital2k8 Eclipse 0 03-05-2008 09:11 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com