Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » popupStructuredContributionCriteria & multiple selection
popupStructuredContributionCriteria & multiple selection [message #179089] Wed, 26 March 2008 11:52 Go to next message
Eclipse UserFriend
Originally posted by: nico.lammers.gmail.com

I have created an action that will create a new shape attached to a 1-n
selection of elements (kind of like the note). The problem is that I can
only give the popupStructuredContributionCriteria one objectClass
attribute, while the selection may consist of different types of shapes.

Right now I derived my editparts and made them implement the same
interface. When I set the objectClass to the interface, the action will
appear in my context menu when I select multiple nodes, so, so far so good.

My question -- is there a way to do this without creating the interface?
As in doing it in the XML definition?

~ Nico
Re: popupStructuredContributionCriteria & multiple selection [message #180224 is a reply to message #179089] Tue, 01 April 2008 19:24 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Nico,

Alternatively, the objectClass could be the first common editpart in the
parent hierarchy of both editpart types and you could use a method in
the XML to narrow down to the specific type of editpart. Depending on
if there is a suitable method to call this may or may not be easier/cleaner.

- Cherie

Nico Lammers wrote:
> I have created an action that will create a new shape attached to a 1-n
> selection of elements (kind of like the note). The problem is that I can
> only give the popupStructuredContributionCriteria one objectClass
> attribute, while the selection may consist of different types of shapes.
>
> Right now I derived my editparts and made them implement the same
> interface. When I set the objectClass to the interface, the action will
> appear in my context menu when I select multiple nodes, so, so far so good.
>
> My question -- is there a way to do this without creating the interface?
> As in doing it in the XML definition?
>
> ~ Nico
Re: popupStructuredContributionCriteria & multiple selection [message #180690 is a reply to message #180224] Thu, 03 April 2008 09:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nico.lammers.gmail.com

The editparts' parents are the GMF base ShapeNodeEditPart, so that would
be too general. I'll experiment a bit with this method thing, not sure
how this works yet.

Thanks.


Cherie Revells wrote:
> Nico,
>
> Alternatively, the objectClass could be the first common editpart in the
> parent hierarchy of both editpart types and you could use a method in
> the XML to narrow down to the specific type of editpart. Depending on
> if there is a suitable method to call this may or may not be
> easier/cleaner.
>
> - Cherie
>
> Nico Lammers wrote:
>> I have created an action that will create a new shape attached to a
>> 1-n selection of elements (kind of like the note). The problem is that
>> I can only give the popupStructuredContributionCriteria one
>> objectClass attribute, while the selection may consist of different
>> types of shapes.
>>
>> Right now I derived my editparts and made them implement the same
>> interface. When I set the objectClass to the interface, the action
>> will appear in my context menu when I select multiple nodes, so, so
>> far so good.
>>
>> My question -- is there a way to do this without creating the
>> interface? As in doing it in the XML definition?
>>
>> ~ Nico
Re: popupStructuredContributionCriteria & multiple selection [message #180718 is a reply to message #180224] Thu, 03 April 2008 11:22 Go to previous message
Eclipse UserFriend
Originally posted by: nico.lammers.gmail.com

Right now I solved it using a PopupMenuContributionPolicy (policyClass
in the XML) which appears to work nicely, too!

by the way, there is not "method" attribute in
popupStructuredContributionCriteria ... ;)

Cherie Revells wrote:
> Nico,
>
> Alternatively, the objectClass could be the first common editpart in the
> parent hierarchy of both editpart types and you could use a method in
> the XML to narrow down to the specific type of editpart. Depending on
> if there is a suitable method to call this may or may not be
> easier/cleaner.
>
> - Cherie
>
> Nico Lammers wrote:
>> I have created an action that will create a new shape attached to a
>> 1-n selection of elements (kind of like the note). The problem is that
>> I can only give the popupStructuredContributionCriteria one
>> objectClass attribute, while the selection may consist of different
>> types of shapes.
>>
>> Right now I derived my editparts and made them implement the same
>> interface. When I set the objectClass to the interface, the action
>> will appear in my context menu when I select multiple nodes, so, so
>> far so good.
>>
>> My question -- is there a way to do this without creating the
>> interface? As in doing it in the XML definition?
>>
>> ~ Nico
Previous Topic:the Problem of Compartment's compartment's Layout! GMF's Bug????
Next Topic:Figure with a compartment
Goto Forum:
  


Current Time: Fri Apr 26 17:27:43 GMT 2024

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

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

Back to the top