How does DeleteAction works in Network example? [message #118493] |
Thu, 19 February 2004 16:18 |
Eclipse User |
|
|
|
Originally posted by: yong.dong.sympatico.ca
In NetworkEditor.createActions(), the DeleteAction is added, but it is
always disabled.
When I create a ContextMenuProvdier, and in buildContextMenu Method,
action = getActionRegistry().getAction(IWorkbenchActionConstants.DELE TE);
if (action.isEnabled())
manager.appendToGroup(GEFActionConstants.GROUP_EDIT, action);
I found action.isEnabled() always return false;
In ScrollingGraphicalViewer.fireSelectionChange(), the DeleteAction does
refresh() to
setEnabled(calculateEnabled()),
In calculateEnabled(), the command is created, but the
cmd.canExecute() always return False, even though I select the Node in the
Viewer and I also can
see the selection in debugger. This causes the DeleteAction to be always
disabled.
Any idea can fix it? Thanks a lot.
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.02412 seconds