Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF Context menu and plugin.xml
GEF Context menu and plugin.xml [message #155913] Wed, 27 October 2004 18:52 Go to next message
Eclipse UserFriend
Originally posted by: gayatri.us.ibm.com

Hi,
I have a situation where I have created a GEF context menu class similar
to the GEF examples and added some actions like cut,copy,paste, delete,
align etc. Some other group that is using my code wants to use the
context menu, but they have their own cut and paste actions that they
wish to use. They have action delegate classes for these actions. But
when they contribute via plugin.xml, they get two cut entries and two
paste entries in the context menu.

My question is, is there a way that we can use the GEF context menu but
just replace or override a couple of actions on the menu?

thanks!
gayatri
Re: GEF Context menu and plugin.xml [message #155963 is a reply to message #155913] Wed, 27 October 2004 21:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mward.harmonia.com

This is probly a bad idea, but maybe after you have instantiated all the
GEF stuff, get the corresponding action registry and replace the actions
you are overriding with your own ( but use the same registry key ). That
way your action is called instead of the one in the action registry by
default.

Gayatri Renganathan wrote:

> Hi,
> I have a situation where I have created a GEF context menu class similar
> to the GEF examples and added some actions like cut,copy,paste, delete,
> align etc. Some other group that is using my code wants to use the
> context menu, but they have their own cut and paste actions that they
> wish to use. They have action delegate classes for these actions. But
> when they contribute via plugin.xml, they get two cut entries and two
> paste entries in the context menu.

> My question is, is there a way that we can use the GEF context menu but
> just replace or override a couple of actions on the menu?

> thanks!
> gayatri
Re: GEF Context menu and plugin.xml [message #156472 is a reply to message #155913] Mon, 01 November 2004 18:58 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
You could try using a RetargetAction on the context menu that gets
retargeted to the newer actions.

"Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
news:cloqpf$cc6$1@eclipse.org...
> Hi,
> I have a situation where I have created a GEF context menu class similar
> to the GEF examples and added some actions like cut,copy,paste, delete,
> align etc. Some other group that is using my code wants to use the
> context menu, but they have their own cut and paste actions that they
> wish to use. They have action delegate classes for these actions. But
> when they contribute via plugin.xml, they get two cut entries and two
> paste entries in the context menu.
>
> My question is, is there a way that we can use the GEF context menu but
> just replace or override a couple of actions on the menu?
>
> thanks!
> gayatri
>
Re: GEF Context menu and plugin.xml [message #156674 is a reply to message #156472] Wed, 03 November 2004 19:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gayatri.us.ibm.com

Thanks for your response. But I still don't understand how to do this.
The other team writes the new actions, but uses our context menu which
is the GEF Contextmenu.He wants to contribute his actions so that he can
replace just one or two of the actions on the context menu with his actions.

I saw that there is an overrideActionId parameter in the extension point
for popup menus. Would that work in such a situation?

thanks!

Pratik Shah wrote:

> You could try using a RetargetAction on the context menu that gets
> retargeted to the newer actions.
>
> "Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
> news:cloqpf$cc6$1@eclipse.org...
>
>>Hi,
>>I have a situation where I have created a GEF context menu class similar
>>to the GEF examples and added some actions like cut,copy,paste, delete,
>>align etc. Some other group that is using my code wants to use the
>>context menu, but they have their own cut and paste actions that they
>>wish to use. They have action delegate classes for these actions. But
>>when they contribute via plugin.xml, they get two cut entries and two
>>paste entries in the context menu.
>>
>>My question is, is there a way that we can use the GEF context menu but
>>just replace or override a couple of actions on the menu?
>>
>>thanks!
>>gayatri
>>
>
>
>
Re: GEF Context menu and plugin.xml [message #157025 is a reply to message #156674] Fri, 05 November 2004 17:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gayatri.us.ibm.com

Can someone please share any thoughts on this one? Please?
thx.

Gayatri Renganathan wrote:

> Thanks for your response. But I still don't understand how to do this.
> The other team writes the new actions, but uses our context menu which
> is the GEF Contextmenu.He wants to contribute his actions so that he can
> replace just one or two of the actions on the context menu with his
> actions.
>
> I saw that there is an overrideActionId parameter in the extension point
> for popup menus. Would that work in such a situation?
>
> thanks!
>
> Pratik Shah wrote:
>
>> You could try using a RetargetAction on the context menu that gets
>> retargeted to the newer actions.
>>
>> "Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
>> news:cloqpf$cc6$1@eclipse.org...
>>
>>> Hi,
>>> I have a situation where I have created a GEF context menu class similar
>>> to the GEF examples and added some actions like cut,copy,paste, delete,
>>> align etc. Some other group that is using my code wants to use the
>>> context menu, but they have their own cut and paste actions that they
>>> wish to use. They have action delegate classes for these actions. But
>>> when they contribute via plugin.xml, they get two cut entries and two
>>> paste entries in the context menu.
>>>
>>> My question is, is there a way that we can use the GEF context menu but
>>> just replace or override a couple of actions on the menu?
>>>
>>> thanks!
>>> gayatri
>>>
>>
>>
>>
>
Re: GEF Context menu and plugin.xml [message #157360 is a reply to message #156674] Tue, 09 November 2004 05:48 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
I've never done anything like this, so I can't say anything for sure. But
if you add two actions with the same ID, won't the second one override the
first one? Alternatively, something like a retarget action might solve your
problem. A retarget action delegates to some other action based on the
current selection. Your retarget action could switch between your cut
action and the one contributed by your clients. BTW, which cut/paste action
is executed when you use the menu bar?

"Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
news:cmbbln$qdu$1@eclipse.org...
> Thanks for your response. But I still don't understand how to do this.
> The other team writes the new actions, but uses our context menu which
> is the GEF Contextmenu.He wants to contribute his actions so that he can
> replace just one or two of the actions on the context menu with his
actions.
>
> I saw that there is an overrideActionId parameter in the extension point
> for popup menus. Would that work in such a situation?
>
> thanks!
>
> Pratik Shah wrote:
>
> > You could try using a RetargetAction on the context menu that gets
> > retargeted to the newer actions.
> >
> > "Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
> > news:cloqpf$cc6$1@eclipse.org...
> >
> >>Hi,
> >>I have a situation where I have created a GEF context menu class similar
> >>to the GEF examples and added some actions like cut,copy,paste, delete,
> >>align etc. Some other group that is using my code wants to use the
> >>context menu, but they have their own cut and paste actions that they
> >>wish to use. They have action delegate classes for these actions. But
> >>when they contribute via plugin.xml, they get two cut entries and two
> >>paste entries in the context menu.
> >>
> >>My question is, is there a way that we can use the GEF context menu but
> >>just replace or override a couple of actions on the menu?
> >>
> >>thanks!
> >>gayatri
> >>
> >
> >
> >
>
Re: GEF Context menu and plugin.xml [message #157429 is a reply to message #156674] Tue, 09 November 2004 16:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

First validate that I understand what you want.

YOU have a menu with actions in it that you have created or that are
under your control. The Other group wants to, when they plugin, take
over control of your actions.

If this is the case, you need to create an extension point for your
plugin, and they can by use of that extension point, tell your plugin of
their desire to override your methods. Your plugin can then pass
control to them for those methods.

Gayatri Renganathan wrote:
> Thanks for your response. But I still don't understand how to do this.
> The other team writes the new actions, but uses our context menu which
> is the GEF Contextmenu.He wants to contribute his actions so that he can
> replace just one or two of the actions on the context menu with his
> actions.
>
> I saw that there is an overrideActionId parameter in the extension point
> for popup menus. Would that work in such a situation?
>
> thanks!
>
> Pratik Shah wrote:
>
>> You could try using a RetargetAction on the context menu that gets
>> retargeted to the newer actions.
>>
>> "Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
>> news:cloqpf$cc6$1@eclipse.org...
>>
>>> Hi,
>>> I have a situation where I have created a GEF context menu class similar
>>> to the GEF examples and added some actions like cut,copy,paste, delete,
>>> align etc. Some other group that is using my code wants to use the
>>> context menu, but they have their own cut and paste actions that they
>>> wish to use. They have action delegate classes for these actions. But
>>> when they contribute via plugin.xml, they get two cut entries and two
>>> paste entries in the context menu.
>>>
>>> My question is, is there a way that we can use the GEF context menu but
>>> just replace or override a couple of actions on the menu?
>>>
>>> thanks!
>>> gayatri
>>>
>>
>>
>>
>


--
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
Re: GEF Context menu and plugin.xml [message #157532 is a reply to message #157429] Wed, 10 November 2004 16:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gayatri.us.ibm.com

Hi! You have understood it correctly. Except, the other group only wants
to replace one or two of the actions. So for instance, I have a GEF
context menu for my graphical editor, and it has my actions for cut and
paste, along with several other actions, including the alignment actions.
Now, the other group wants to use all of my actions, except for cut and
paste. What they want is to somehow when they click on cut, it should be
their cut action that gets triggered and not ours. Does that make sense?

Do I still need to have an extension point for my context menu? Is there
any other way to achieve this?

thanks!

CL [dnoyeb] Gilbert wrote:
> First validate that I understand what you want.
>
> YOU have a menu with actions in it that you have created or that are
> under your control. The Other group wants to, when they plugin, take
> over control of your actions.
>
> If this is the case, you need to create an extension point for your
> plugin, and they can by use of that extension point, tell your plugin of
> their desire to override your methods. Your plugin can then pass
> control to them for those methods.
>
> Gayatri Renganathan wrote:
>
>> Thanks for your response. But I still don't understand how to do this.
>> The other team writes the new actions, but uses our context menu which
>> is the GEF Contextmenu.He wants to contribute his actions so that he
>> can replace just one or two of the actions on the context menu with
>> his actions.
>>
>> I saw that there is an overrideActionId parameter in the extension
>> point for popup menus. Would that work in such a situation?
>>
>> thanks!
>>
>> Pratik Shah wrote:
>>
>>> You could try using a RetargetAction on the context menu that gets
>>> retargeted to the newer actions.
>>>
>>> "Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
>>> news:cloqpf$cc6$1@eclipse.org...
>>>
>>>> Hi,
>>>> I have a situation where I have created a GEF context menu class
>>>> similar
>>>> to the GEF examples and added some actions like cut,copy,paste, delete,
>>>> align etc. Some other group that is using my code wants to use the
>>>> context menu, but they have their own cut and paste actions that they
>>>> wish to use. They have action delegate classes for these actions. But
>>>> when they contribute via plugin.xml, they get two cut entries and two
>>>> paste entries in the context menu.
>>>>
>>>> My question is, is there a way that we can use the GEF context menu but
>>>> just replace or override a couple of actions on the menu?
>>>>
>>>> thanks!
>>>> gayatri
>>>>
>>>
>>>
>>>
>>
>
>
Re: GEF Context menu and plugin.xml [message #157555 is a reply to message #157532] Wed, 10 November 2004 17:54 Go to previous message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Yes you need an extension point. Your plugin must create the ability
for them to override whatever you want them to be able to override.
They can only do to/with your plugin what you let them.

When you show your context menu, you should check the implementers of
your extension point. If there are any, call a method that gives them
the opportunity to fill out the menu. Perhaps a visitor. Its not too
hard to do.


Gayatri Renganathan wrote:
> Hi! You have understood it correctly. Except, the other group only wants
> to replace one or two of the actions. So for instance, I have a GEF
> context menu for my graphical editor, and it has my actions for cut and
> paste, along with several other actions, including the alignment actions.
> Now, the other group wants to use all of my actions, except for cut and
> paste. What they want is to somehow when they click on cut, it should be
> their cut action that gets triggered and not ours. Does that make sense?
>
> Do I still need to have an extension point for my context menu? Is there
> any other way to achieve this?
>
> thanks!
>
> CL [dnoyeb] Gilbert wrote:
>
>> First validate that I understand what you want.
>>
>> YOU have a menu with actions in it that you have created or that are
>> under your control. The Other group wants to, when they plugin, take
>> over control of your actions.
>>
>> If this is the case, you need to create an extension point for your
>> plugin, and they can by use of that extension point, tell your plugin
>> of their desire to override your methods. Your plugin can then pass
>> control to them for those methods.
>>
>> Gayatri Renganathan wrote:
>>
>>> Thanks for your response. But I still don't understand how to do
>>> this. The other team writes the new actions, but uses our context
>>> menu which is the GEF Contextmenu.He wants to contribute his actions
>>> so that he can replace just one or two of the actions on the context
>>> menu with his actions.
>>>
>>> I saw that there is an overrideActionId parameter in the extension
>>> point for popup menus. Would that work in such a situation?
>>>
>>> thanks!
>>>
>>> Pratik Shah wrote:
>>>
>>>> You could try using a RetargetAction on the context menu that gets
>>>> retargeted to the newer actions.
>>>>
>>>> "Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
>>>> news:cloqpf$cc6$1@eclipse.org...
>>>>
>>>>> Hi,
>>>>> I have a situation where I have created a GEF context menu class
>>>>> similar
>>>>> to the GEF examples and added some actions like cut,copy,paste,
>>>>> delete,
>>>>> align etc. Some other group that is using my code wants to use the
>>>>> context menu, but they have their own cut and paste actions that they
>>>>> wish to use. They have action delegate classes for these actions. But
>>>>> when they contribute via plugin.xml, they get two cut entries and two
>>>>> paste entries in the context menu.
>>>>>
>>>>> My question is, is there a way that we can use the GEF context menu
>>>>> but
>>>>> just replace or override a couple of actions on the menu?
>>>>>
>>>>> thanks!
>>>>> gayatri
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>


--
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
Previous Topic:ConnectionRouter help
Next Topic:Font Style
Goto Forum:
  


Current Time: Tue May 07 21:55:02 GMT 2024

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

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

Back to the top