Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Cut/Copy/Paste problem within the GEF canvas
Cut/Copy/Paste problem within the GEF canvas [message #185023] Tue, 21 June 2005 22:52 Go to next message
Ravi is currently offline RaviFriend
Messages: 19
Registered: July 2009
Junior Member
Hi,

We have registered our own cut/copy/paste actions on the eclipse
actionregistry (so they can be invoked from the Menu or CTRL->A, CTRL->V
etc.) Each of these actions work based on selections in the GEF editor. They
work well as long as we have draw2d objects on the canvas. The problem comes
when we embed an SWT control within the canvas, for example when we start
editing a Label in the Logic Example.

When we start editing a label, the SWT text control is embedded into the
bounds of the label. But when we do a copy/paste within the Text control,
the problem is the copy/paste which we have registered with the eclipse
action registry gets invoked. So, the result is i can never copy or paste
text within the Text control.

Is there a way around this problem ? Looks like the LogicEditor example has
the same problem, except that no copy/paste actions get registered in that
example. If those actions get registered, i think there will be the same
problem

One way i can think of is to unregister these actions when the Text control
has the focus and register these actions as the Text control loses focus.
But we are embedding a lot of SWT controls on our canvas, and i hate to do
this for every single Text control i create.

thanks,
-Ravi
Re: Cut/Copy/Paste problem within the GEF canvas [message #185033 is a reply to message #185023] Wed, 22 June 2005 00:37 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The Logic example should have action delegates for all global action which
can be forwarded to a celleditor, including cut/copy/paste/undo, etc. You
can do the same. You can also write your own implementation of an Undo
action which looks at keyboard focus when it is invoked and delegates
accordingly. You also could try having NO undo action, and allowing widgets
to simply receive the keybinding and behave in a native way. Then, if your
canvas has focus you could use a key listener to handle undo in that case.

You should ask on the platform newsgroup what editors like the PDE do to
handle so many SWT Text widgets.

"Ravi" <rshankark@hotmail.com> wrote in message
news:d9a5mn$hk6$1@news.eclipse.org...
> Hi,
>
> We have registered our own cut/copy/paste actions on the eclipse
> actionregistry (so they can be invoked from the Menu or CTRL->A, CTRL->V
> etc.) Each of these actions work based on selections in the GEF editor.
> They work well as long as we have draw2d objects on the canvas. The
> problem comes when we embed an SWT control within the canvas, for example
> when we start editing a Label in the Logic Example.
>
> When we start editing a label, the SWT text control is embedded into the
> bounds of the label. But when we do a copy/paste within the Text control,
> the problem is the copy/paste which we have registered with the eclipse
> action registry gets invoked. So, the result is i can never copy or paste
> text within the Text control.
>
> Is there a way around this problem ? Looks like the LogicEditor example
> has the same problem, except that no copy/paste actions get registered in
> that example. If those actions get registered, i think there will be the
> same problem
>
> One way i can think of is to unregister these actions when the Text
> control has the focus and register these actions as the Text control loses
> focus. But we are embedding a lot of SWT controls on our canvas, and i
> hate to do this for every single Text control i create.
>
> thanks,
> -Ravi
>
>
>
>
>
>
Previous Topic:Must I use draw2d or swt for my plugin ?
Next Topic:Do I need EditPolicy.LAYOUT_ROLE just to select a child?
Goto Forum:
  


Current Time: Thu Dec 12 20:36:18 GMT 2024

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

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

Back to the top