Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Renaming an EditPart global action
Renaming an EditPart global action [message #182373] Tue, 24 May 2005 17:25 Go to next message
Eclipse UserFriend
Originally posted by: brett.bock.embarcadero.com

Hello,

I have code working that allows the user to edit the label figure in an
EditPart via an EditPolicy derived from DirectEditPolicy. Now I would like
to hook this up to a global rename action. The Logic & Flow examples appear
to just hook into key press events and process via an F2 key press.
Shouldn't we be able to hook into the global action registry?

I also noticed there is a DirectEditAction class, but I don't see any
examples where it is used.

Thank you for your help,
Brett
Re: Renaming an EditPart global action [message #182597 is a reply to message #182373] Wed, 25 May 2005 23:24 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Sure, you can. Look at declareGlobalActionKeys() and addGlobalActionKey()
in your ActionBarContributor. The action that you would add to your action
registry would be the same as the DirectEditAction, but with the correct ID.

However, I think that doing this is not a good idea. The Rename action
shows up under the File menu, and can be confusing since it's really only
meant for renaming files. I don't think JDT hooks into that actions when
renaming methods, variables, etc. Only for Java class files. You might
want to follow their example.


"Brett Bock" <brett.bock@embarcadero.com> wrote in message
news:d6vo7h$c2r$1@news.eclipse.org...
> Hello,
>
> I have code working that allows the user to edit the label figure in an
> EditPart via an EditPolicy derived from DirectEditPolicy. Now I would
like
> to hook this up to a global rename action. The Logic & Flow examples
appear
> to just hook into key press events and process via an F2 key press.
> Shouldn't we be able to hook into the global action registry?
>
> I also noticed there is a DirectEditAction class, but I don't see any
> examples where it is used.
>
> Thank you for your help,
> Brett
>
>
Previous Topic:Property Viewer for Connection
Next Topic:can i set the Alpha value of Figure?
Goto Forum:
  


Current Time: Tue Dec 03 09:44:39 GMT 2024

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

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

Back to the top