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 :-)