I am developing a RCP application and I need cut/copy/paste in this app. As there are already commands which are delivered by eclipse (org.eclipse.ui.edit.copy, ...) I want to use them (I already added them to the toolbar, e.g.) in an editor. I played around a little, but I don't get it how I can react to the copy/paste command. E.g. how do I get informed in an editor if something was copied or pasted?
Is there an easy way to use the commands like the Save Command. There I just have to implement the ISaveablePart and then the doSave() or doSaveAs() methods are called...I really like this, but I didn't find ICopyablePart,... interfaces ;)
If you need specific behaviour to copy (or any command) within your editor or view, you would activate a handler for it. Usually in your
createPartControl(Composite)
method:The other common way is to provide a handler through your plugin.xml:
Then in your handler, you would get the active part and call your copy implementation on it. ex: