Skip to main content



      Home
Home » Eclipse Projects » GEF » Activating Undo, Redo & Delete in MenuBar?
Activating Undo, Redo & Delete in MenuBar? [message #146292] Tue, 03 August 2004 11:54 Go to next message
Eclipse UserFriend
Originally posted by: mastr.arcor.de

Hey @ll!

How can I activate the menuitems "Undo", "Redo", "Delete" for Menu "Edit"?

I have an ActionRegistry, Actions added to it, a CommandStack and a
CommandStackListener. (I don't have sth. like an UpdateAction)

Do I need a gef.ActionBarContributor for that?
...If yes, how do I implement it for GEF 2.0.3 (com.ibm.etools).
Or does it work with only implementing ui.part.EditorActionBarContributor?

Else what is missing?

Thanks in advance.
Martin
Re: Activating Undo, Redo & Delete in MenuBar? [message #146479 is a reply to message #146292] Wed, 04 August 2004 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Hi,

> How can I activate the menuitems "Undo", "Redo", "Delete" for Menu =

> "Edit"?
>
> I have an ActionRegistry, Actions added to it, a CommandStack and a
> CommandStackListener. (I don't have sth. like an UpdateAction)
>
> Do I need a gef.ActionBarContributor for that?
> ..If yes, how do I implement it for GEF 2.0.3 (com.ibm.etools).
> Or does it work with only implementing =

> ui.part.EditorActionBarContributor?
>
> Else what is missing?
>
> Thanks in advance.
> Martin

You have to tell to Eclipse what it has to do when you editor is active =
=

and when the
user selects the undo, redo, delete...menu items. This is implemented by=
=

"retargetable actions"
("global actions"). I don't remember the code to contribute to them, but=
I =

remember
it is very well explained in the Eclipse doc. There are just some lines =
of =

code to add
in your EditorPart class.

I hope this will help,

r=E9gis
Re: Activating Undo, Redo & Delete in MenuBar? [message #146513 is a reply to message #146479] Wed, 04 August 2004 12:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mastr.arcor.de

rlemaigr@ulb.ac.be wrote:

> You have to tell to Eclipse what it has to do when you editor is active
> and when the
> user selects the undo, redo, delete...menu items. This is implemented by
> "retargetable actions"
> ("global actions"). I don't remember the code to contribute to them, but I
> remember
> it is very well explained in the Eclipse doc. There are just some lines of
> code to add
> in your EditorPart class.

So what I finally did now, was to set the "contributorClass" value in the
plugin.xml file's editor extension to
"com.ibm.etools.gef.ui.actions.ActionBarContributor".

After adding this "Undo", "Redo" and "Delete" are now available for the
"Edit" Menu if my EditPart provides the ComponentEditPolicy and the
Create-/DeleteCommand implements undo/redo functions.

Thanks
Re: Activating Undo, Redo & Delete in MenuBar? [message #146535 is a reply to message #146513] Wed, 04 August 2004 13:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

> So what I finally did now, was to set the "contributorClass" value in =
the
> plugin.xml file's editor extension to
> "com.ibm.etools.gef.ui.actions.ActionBarContributor".
>
> After adding this "Undo", "Redo" and "Delete" are now available for th=
e
> "Edit" Menu if my EditPart provides the ComponentEditPolicy and the
> Create-/DeleteCommand implements undo/redo functions.
>
> Thanks

ah ok...I didn't know about that at all...maybe it is a 3.0 change or I =
=

have
always done it the wrong way...sorry...
Re: Activating Undo, Redo & Delete in MenuBar? [message #146549 is a reply to message #146535] Wed, 04 August 2004 14:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mastr.arcor.de

rlemaigr@ulb.ac.be wrote:

> ah ok...I didn't know about that at all...maybe it is a 3.0 change or I
> have
> always done it the wrong way...sorry...

I think we missunderstood a bit. I'm using IBM GEF 2.0.3. Your solution
provided will work for 2.1 and higher I think.
The API for gef.ActionBarContributer changed a lot, so it's a bit tricky
to simply add RetargetActions etc.

I'm happy to get it worked this easy way
still waiting for the next adventure ;-)

CU, Martin.
Re: Activating Undo, Redo & Delete in MenuBar? [message #146562 is a reply to message #146292] Wed, 04 August 2004 17:55 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

These actions are probably working with the logic example for that release.
That would be the best source for answers. It is probably the same as now,
you must register a global action handler.

"mastr" <mastr@arcor.de> wrote in message news:ceocft$3av$1@eclipse.org...
> Hey @ll!
>
> How can I activate the menuitems "Undo", "Redo", "Delete" for Menu "Edit"?
>
> I have an ActionRegistry, Actions added to it, a CommandStack and a
> CommandStackListener. (I don't have sth. like an UpdateAction)
>
> Do I need a gef.ActionBarContributor for that?
> ..If yes, how do I implement it for GEF 2.0.3 (com.ibm.etools).
> Or does it work with only implementing ui.part.EditorActionBarContributor?
>
> Else what is missing?
>
> Thanks in advance.
> Martin
>
Previous Topic:How do i draw graph on the viewpart!!
Next Topic:Label location with main figure
Goto Forum:
  


Current Time: Fri Apr 25 19:15:14 EDT 2025

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

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

Back to the top