|HandlerUtil.currentSelection returns null [message #542337]
||Thu, 24 June 2010 14:49
| david borsodi
Registered: July 2009
I'm quite new to RPC dev, and also to this forum. (So I hope "Come here to participate in technical discussions about how to use the Rich Client Platform (RCP)." covers my question as well, if not, please tell me where to post it)
I have the following problem:
1. I have a view with a treeviewer.
2. a command, which adds a new element to the tree
so far, it works.
In the handler, I call
TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
to get the current selection so if a node is selected, that one will be the default parent. But! This returns null, even if I already selected a node.
After debugging it turned out that the selection variable is set to a plain "Object" object in the runtime framework, and at this point, in HandlerUtil.getVariable()
return var == IEvaluationContext.UNDEFINED_VARIABLE ? null : var;
null is returned.
I think, this might be the source of the problem, but I don't know why this happens...
My command handler is registered through the plugin.xml for my plugin.
please help me. If more details are required I can post them
Powered by FUDForum
. Page generated in 0.02006 seconds