Renaming an EditPart global action [message #182373] |
Tue, 24 May 2005 17:25 |
Eclipse User |
|
|
|
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 |
Pratik Shah 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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05127 seconds