[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] UndoRetargetAction and UndoAction?

Hi,

What is the difference between these two UndoActions?

The GraphicalEditor#createActions() already add the UndoAction to the
ActionRegistry.  Why I still need to addRetargetAction (new
UndoRetargetAction ()) in the ActionBarContributor::buildActions call?

Similarly, DeleteAction is also added in the
GraphicalEditor#createActions().  But I still need to call KeyHandler.put
(KeyStroke.getpressed (SWT.DEL, 127, 0),
getActionRegistry().getAction(ActionFactory.DELETE.getId())); to make the
DEL key working.

The ActionBarContributor#setActiveEditor already get the list of Actions
from the ActionRegistry and call the setGlobalActionHandler, why do we need
to do the extra work above?

I find it confusing to do that simple task of ON_COMMAND and
ON_UPDATE_COMMAND_UI tasks.

Thanks,

Kevin.