popupStructuredContributionCriteria & multiple selection [message #179089] |
Wed, 26 March 2008 11:52 |
Eclipse User |
|
|
|
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 #180690 is a reply to message #180224] |
Thu, 03 April 2008 09:35 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds