Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Default Cut/Copy/Paste/Rename/DeleteCommands disabled
Default Cut/Copy/Paste/Rename/DeleteCommands disabled [message #695687] Tue, 12 July 2011 10:24 Go to next message
Alexander May is currently offline Alexander MayFriend
Messages: 20
Registered: March 2011
Junior Member
Hi everybody,

in my RCP application I use a CNF Navigator to display my workspace resources. It is configured using ResourcesPlugin.getWorkspace().getRoot() as RootElement and thus displays IResources. I successfully added several filters, sorters etc and extended the PopUpMenu with some custom commands. Everything works fine so far.

What I can not get working are the default commands to cut/copy/paste/rename/delete resources. Which means they are added to the menu but never get active, so I can't use them. On the other hand I use the NavigatorView the according commands are enabled on my resources and work as expected.

This is the code I used in plugin.xml to add the commands
<extension
      point="org.eclipse.ui.menus">
   <menuContribution
         locationURI="popup:{popupMenu.location}?after=group.edit">
      <command
            commandId="org.eclipse.ui.edit.delete"
            id="cnf.popupmenu.delete"
            label="Delete"
            mnemonic="D"
            style="push">
      </command>
      <command
            commandId="org.eclipse.ui.edit.rename"
            id="cnf.popupmenu.rename"
            label="Rename"
            mnemonic="R"
            style="push">
      </command>
   </menuContribution>
 </extension> 


So my question is how to enable these commands?
I found some advice to add Handlers for that, but this allways included writing an own handler, which is not exactly what I want.
I thought a default handler would be added by the defining plugin that works on IResources.
If explicit adding of a Handler is required where do I find the alredy existing handlers to reference them?

Thanks in advance,
Alexander
Re: Default Cut/Copy/Paste/Rename/DeleteCommands disabled [message #698068 is a reply to message #695687] Mon, 18 July 2011 17:56 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

When using the Common Navigator framework is there not an actionGroup (like the edit action group) that will add the standard cut/copy/paste to the CNF? I thought it was configured through the CNF extension points.

PW


Re: Default Cut/Copy/Paste/Rename/DeleteCommands disabled [message #698266 is a reply to message #698068] Tue, 19 July 2011 06:51 Go to previous messageGo to next message
Alexander May is currently offline Alexander MayFriend
Messages: 20
Registered: March 2011
Junior Member
I did not find an actionGroup that integates that easy. When using the default edit action group it simply did not show.

But while trying to do that I found a workaround for the time beeing. I use the inheritBindingsFromViewer attribute of the CNF viewer.
 <viewer inheritBindingsFromViewer="org.eclipse.ui.navigator.ProjectExplorer" ...


But this adds several commands I don't need/want in my navigator. So I'm still interessted in a solution.

Alexander

[Updated on: Tue, 19 July 2011 06:52]

Report message to a moderator

Re: Default Cut/Copy/Paste/Rename/DeleteCommands disabled [message #698409 is a reply to message #698266] Tue, 19 July 2011 12:41 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

How did you try and integrate the editor action group? Are you resource based, using org.eclipse.ui.navigator.resources?

If so, how did you try and add org.eclipse.ui.navigator.resources.actions.EditActions ?

PW


Re: Default Cut/Copy/Paste/Rename/DeleteCommands disabled [message #700384 is a reply to message #698409] Sat, 23 July 2011 10:13 Go to previous message
Philipp M. Fischer is currently offline Philipp M. FischerFriend
Messages: 67
Registered: November 2010
Location: Germany
Member
Hi Alexander,

I just placed a topic, because i am having the opposite problem. I was able to enable "cut,copy,paste,delete", but i am currently failing on "save,undo" and "redo". So i actually defined my commandHandlers to react accordingly on the selected objects in the CNF. But for my Problem I am not referencing to the original or default commandHandlers. Do you have a clue how to get the "save,undo" and "redo" enabled in the main menu? They are working perfectly in my popup of the CNF Wink

Cheers

Phil
Previous Topic:Correct way to access IWorkbenchThemeConstants
Next Topic:propertyTester crashes on different objects
Goto Forum:
  


Current Time: Sat Apr 20 03:35:40 GMT 2024

Powered by FUDForum. Page generated in 0.02607 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top