|Re: Copy/Paste on the Toolbar [message #179839 is a reply to message #179744]
||Sun, 01 May 2005 22:17
| Pratik Shah
Registered: July 2009
Step 1 below is not required for step 2. That is, if you don't add the|
retarget actions in buildActions(), the copy/paste will still show up on the
toolbar. Look at the getAction() code to see why that is.
However, you'd still want to add the retarget actions in buildActions() show
that the ones on the edit menu work properly, and so do the keybindings.
You can get to the WorkbenchWindow via PlatformUI.
"Sapna George" <firstname.lastname@example.org> wrote in message
> I want to add Copy/Paste Tool items onto my editor's toolbar. So, i tried
> to add CopyRetargetAction and PasteRetargetAction to my
> ActionBarContributor. But the documentation states that these are
> deprecated and that we should use org.eclipse.ui.actions.ActionFactory
> instead. How should we use this?
> I tried the following:
> 1. in my ActionBarContributor's buildActions() method, i put the following
> where the variable 'editor' has been set to MY editor using the
> setActiveEditor method.
> 2. In the method contributeToToolBar(IToolBarManager toolBarManager), i
> added the following:
> BUT, upon execution, i get a NullPointerException at the call to create
> the COPY action -
> So, how else should i be doing this?
Powered by FUDForum
. Page generated in 16.14691 seconds