The Voice Tools Project has a set of custom editors we use to create different artifacts. We have been trying to implement cut/copy/paste in the main application editor which displays a visual representation of the workflow (not EMF/GEF) but it appears the workbench is getting confused as to which handler should be used for which editor instance or class. I'm sure we are doing something wrong.
The editor registers the handlers in the init(IEditorSite, IEditorInput) method like this:
site.getActionBars().setGlobalActionHandler(ActionFactory.COPY.getId(), new Action("Copy")
public void run()
final SelectionStructure selection = currentCanvas.renderedCanvas.getSelection();
if(selection.getPrimarySelection() instanceof ConnectorFrame)
The editor instances are not shared, so each document would have it's own local handler. I assumed that the workbench maintained a scoped set of handlers for each editor instance. I think this assumption is probably wrong. Under certain circumstances it appears the handler for other editors, either other instances of our custom editor part or other classes all together, are being called instead. This is happening for cut/copy/paste actions.
It doesn't appear to be happening with our undo/redo actions. We are swapping out the undo contexts of our local actions and everything seems to work perfectly for those. Any help would be appreciated.
I have no idea if this is the proper way to do things, but I think i have at least a workaround in place. I added a part listener to the editor site page which forcibly registers new handlers for all action ids each time the editor part is activated. This seems a little onerous so I'm probably still doing something inherently wrong.