Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Can't bring cut/copy/paste to work...
Can't bring cut/copy/paste to work... [message #463895] Mon, 19 February 2007 14:02
Eclipse UserFriend
Originally posted by: unidad.gmx.net

Hi!

I'm expanding the Shapes-Editor-Example to work as a standalone RCP-App.
One big thing that won't work is the action-stuff.

I'm quite confused and dont't find the right way through it.

One problem is that I want to add cut/copy/paste menu-items to
the Edit-menu and the context-menu.

To add it to the context-menu I've added the
following lines to the EditorContextMenuProvider:

menu.appendToGroup(
GEFActionConstants.GROUP_COPY,
getAction(ActionFactory.CUT.getId()));

menu.appendToGroup(
GEFActionConstants.GROUP_COPY,
getAction(ActionFactory.COPY.getId()));

menu.appendToGroup(
GEFActionConstants.GROUP_COPY,
getAction(ActionFactory.PASTE.getId()));


If I start now, the context-menu won't appear, because these new actions
are not created.

So I try to create it in MyEditor.createActions();
(This is where the example actions for the context-menu are created too.)

But what actions shall I create there?
There is an org.eclipse.ui.views.navigator.CopyAction, but this is not
visible in my package.

There is an org.eclipse.gef.ui.actions.CopyRetargetAction,
but the constructor is deprecated and I shall use
org.eclipse.ui.actions.ActionFactory instead.

If I try the ActionFactory I need an instance of IWorkbenchWindow, which
I don't have, because I'm in the editor. Furthermore I get a
IWorkbenchAction but I need a RetargetAction. *sigh*

Maybe anyone can give me a hint...

Greetings, Hermann
Previous Topic:Difference between Actionfactory.QUIT and normal Close
Next Topic:DataBinding
Goto Forum:
  


Current Time: Sat Mar 15 01:43:38 EDT 2025

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

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

Back to the top