Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how do dynamic popup menus
how do dynamic popup menus [message #168314] Tue, 15 January 2008 18:20 Go to next message
John Yotka is currently offline John YotkaFriend
Messages: 144
Registered: July 2009
Senior Member
I have a need to create a dynamic submenu off of the popup menu for my
diagram. The items for the popup submenu are determined by the items
selected and the current state of a database table. In the EMF editor I
could do this with the menuAboutToShow method of the
<model>ActionBarContributor class.

How can you do this in GMF?
Re: how do dynamic popup menus [message #168376 is a reply to message #168314] Wed, 16 January 2008 11:48 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
We've recently done something similar. These may be of assistance:

(plugin.xml)
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/plugin.xml?revision=1.3& ;root=Technology_Project&view=markup

and

(the class that contributes the sub-menu items)
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/src/org/epsilon/ewl/eclipse /gmf/ContributeWizardsAction.java?revision=1.7&root=Tech nology_Project&view=markup

Cheers,
Dimitrios

John Yotka wrote:
> I have a need to create a dynamic submenu off of the popup menu for my
> diagram. The items for the popup submenu are determined by the items
> selected and the current state of a database table. In the EMF editor I
> could do this with the menuAboutToShow method of the
> <model>ActionBarContributor class.
>
> How can you do this in GMF?
Re: how do dynamic popup menus [message #168437 is a reply to message #168376] Wed, 16 January 2008 13:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Hi Dimitrios

That looks very cool :) I think I need to try that out..

I just have a follow-up question to this:
Is it possible to launch an editor (a diagram) from such a popup menuitem ?

Basicaly: just refer to, or copy, the behavior that gets initialized
when you select a new diagram from the main menu


Regards,

Tomas Zijdemans

Dimitrios Kolovos wrote:
> We've recently done something similar. These may be of assistance:
>
> (plugin.xml)
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/plugin.xml?revision=1.3& ;root=Technology_Project&view=markup
>
>
> and
>
> (the class that contributes the sub-menu items)
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/src/org/epsilon/ewl/eclipse /gmf/ContributeWizardsAction.java?revision=1.7&root=Tech nology_Project&view=markup
>
>
> Cheers,
> Dimitrios
>
> John Yotka wrote:
>> I have a need to create a dynamic submenu off of the popup menu for my
>> diagram. The items for the popup submenu are determined by the items
>> selected and the current state of a database table. In the EMF editor
>> I could do this with the menuAboutToShow method of the
>> <model>ActionBarContributor class.
>>
>> How can you do this in GMF?
Re: how do dynamic popup menus [message #168453 is a reply to message #168437] Wed, 16 January 2008 14:05 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
The dynamic menu items are just actions, so if GMF supports this you
should be able to do it from within those actions as well. Does your
question relate to this thread?

http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg03651.html

Cheers,
Dimitrios

Tomas Zijdemans wrote:
> Hi Dimitrios
>
> That looks very cool :) I think I need to try that out..
>
> I just have a follow-up question to this:
> Is it possible to launch an editor (a diagram) from such a popup menuitem ?
>
> Basicaly: just refer to, or copy, the behavior that gets initialized
> when you select a new diagram from the main menu
>
>
> Regards,
>
> Tomas Zijdemans
>
> Dimitrios Kolovos wrote:
>> We've recently done something similar. These may be of assistance:
>>
>> (plugin.xml)
>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/plugin.xml?revision=1.3& ;root=Technology_Project&view=markup
>>
>>
>> and
>>
>> (the class that contributes the sub-menu items)
>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/src/org/epsilon/ewl/eclipse /gmf/ContributeWizardsAction.java?revision=1.7&root=Tech nology_Project&view=markup
>>
>>
>> Cheers,
>> Dimitrios
>>
>> John Yotka wrote:
>>> I have a need to create a dynamic submenu off of the popup menu for
>>> my diagram. The items for the popup submenu are determined by the
>>> items selected and the current state of a database table. In the EMF
>>> editor I could do this with the menuAboutToShow method of the
>>> <model>ActionBarContributor class.
>>>
>>> How can you do this in GMF?
Re: how do dynamic popup menus [message #168482 is a reply to message #168453] Wed, 16 January 2008 14:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Dimitrios Kolovos wrote:
> The dynamic menu items are just actions, so if GMF supports this you
> should be able to do it from within those actions as well.

Of course, I should have thought of that. However, I need the new
diagram to be related/synced to the diagram you launch it from (As can
be done with "Load Resource" or like it happens with diagram
partitioning). Is this possible in principle ?

Does your
> question relate to this thread?

Yes. I use double click (diagram partitioning) to relate 4 subdiagrams
to a superdiagram (To ensure that all diagrams work on the same resource
set). However, when I try to make a new diagram and set it as sub of one
of the above subdiagram (3 levels of diagrams) - it won't work (see my
other thread for details). This is the reason I'm trying to launch a
diagram from a popup - but as mentioned it needs to relate to the other
diagrams.


Thanks for helping

Tomas Zijdemans

>
> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg03651.html
>
> Cheers,
> Dimitrios
>
> Tomas Zijdemans wrote:
>> Hi Dimitrios
>>
>> That looks very cool :) I think I need to try that out..
>>
>> I just have a follow-up question to this:
>> Is it possible to launch an editor (a diagram) from such a popup
>> menuitem ?
>>
>> Basicaly: just refer to, or copy, the behavior that gets initialized
>> when you select a new diagram from the main menu
>>
>>
>> Regards,
>>
>> Tomas Zijdemans
>>
>> Dimitrios Kolovos wrote:
>>> We've recently done something similar. These may be of assistance:
>>>
>>> (plugin.xml)
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/plugin.xml?revision=1.3& ;root=Technology_Project&view=markup
>>>
>>>
>>> and
>>>
>>> (the class that contributes the sub-menu items)
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/src/org/epsilon/ewl/eclipse /gmf/ContributeWizardsAction.java?revision=1.7&root=Tech nology_Project&view=markup
>>>
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> John Yotka wrote:
>>>> I have a need to create a dynamic submenu off of the popup menu for
>>>> my diagram. The items for the popup submenu are determined by the
>>>> items selected and the current state of a database table. In the
>>>> EMF editor I could do this with the menuAboutToShow method of the
>>>> <model>ActionBarContributor class.
>>>>
>>>> How can you do this in GMF?
Re: how do dynamic popup menus [message #168497 is a reply to message #168482] Wed, 16 January 2008 14:42 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Tomas,

I'm afraid that my limited knowledge of GMF is not sufficient for
answering your questions :(. I hope someone else can help you with that.

Cheers,
Dimitrios

Tomas Zijdemans wrote:
> Dimitrios Kolovos wrote:
>> The dynamic menu items are just actions, so if GMF supports this you
>> should be able to do it from within those actions as well.
>
> Of course, I should have thought of that. However, I need the new
> diagram to be related/synced to the diagram you launch it from (As can
> be done with "Load Resource" or like it happens with diagram
> partitioning). Is this possible in principle ?
>
> Does your
>> question relate to this thread?
>
> Yes. I use double click (diagram partitioning) to relate 4 subdiagrams
> to a superdiagram (To ensure that all diagrams work on the same resource
> set). However, when I try to make a new diagram and set it as sub of one
> of the above subdiagram (3 levels of diagrams) - it won't work (see my
> other thread for details). This is the reason I'm trying to launch a
> diagram from a popup - but as mentioned it needs to relate to the other
> diagrams.
>
>
> Thanks for helping
>
> Tomas Zijdemans
>
>>
>> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg03651.html
>>
>> Cheers,
>> Dimitrios
>>
>> Tomas Zijdemans wrote:
>>> Hi Dimitrios
>>>
>>> That looks very cool :) I think I need to try that out..
>>>
>>> I just have a follow-up question to this:
>>> Is it possible to launch an editor (a diagram) from such a popup
>>> menuitem ?
>>>
>>> Basicaly: just refer to, or copy, the behavior that gets initialized
>>> when you select a new diagram from the main menu
>>>
>>>
>>> Regards,
>>>
>>> Tomas Zijdemans
>>>
>>> Dimitrios Kolovos wrote:
>>>> We've recently done something similar. These may be of assistance:
>>>>
>>>> (plugin.xml)
>>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/plugin.xml?revision=1.3& ;root=Technology_Project&view=markup
>>>>
>>>>
>>>> and
>>>>
>>>> (the class that contributes the sub-menu items)
>>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/org.epsilon.ewl.eclipse.gmf/src/org/epsilon/ewl/eclipse /gmf/ContributeWizardsAction.java?revision=1.7&root=Tech nology_Project&view=markup
>>>>
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> John Yotka wrote:
>>>>> I have a need to create a dynamic submenu off of the popup menu for
>>>>> my diagram. The items for the popup submenu are determined by the
>>>>> items selected and the current state of a database table. In the
>>>>> EMF editor I could do this with the menuAboutToShow method of the
>>>>> <model>ActionBarContributor class.
>>>>>
>>>>> How can you do this in GMF?
Previous Topic:Read-only diagram
Next Topic:Need Help with Link Constraints
Goto Forum:
  


Current Time: Fri Mar 29 14:34:33 GMT 2024

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

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

Back to the top