adding action to editparts [message #210216] |
Fri, 31 October 2008 19:25 |
Eclipse User |
|
|
|
Originally posted by: kelvinng.db.gmail.com
Can someone give me a quick overview of how I can add context menu
actions to editparts?
I managed to get an action to show up for my editpart, but I'm trying
to place that in sub-menu in the context menu.
~Kelvin Ng
|
|
|
|
|
Re: Fw: Re: adding action to editparts [message #210447 is a reply to message #210404] |
Wed, 05 November 2008 14:43 |
Linda Damus Messages: 85 Registered: July 2009 |
Member |
|
|
Viktor,
The implementation in
org.eclipse.gmf.runtime.diagram.ui.actions.AbstractDiagramMo delActionDelegate#getElements(ISelection)
might be what you're looking for. Your action delegate could extend
this one and inherit the behaviour.
Regards,
Linda
Viktor Kazakov wrote:
> Hello!
>
> I've created the class that implements the action, added by me to the
> edit part.
>
> The question is: how to get a reference to the edit part in the run()
> method (or anywhere else)? I need to know the values of some properties
> of the domain element, which edit part is the "owner" of the popup.
>
> So, how to do it better?
>
> Thanks!
>
> Viktor
>
> Jeff пишет:
>> hi Kelvin, I don't know whether that's what you want, wish help:
>>
>> <extension point="org.eclipse.ui.popupMenus">
>> <?gmfgen generated="false"?>
>> <objectContribution
>> adaptable="false"
>> id="...your objectContribution id"
>> objectClass="...your editpart full class name">
>> <action
>> class="...your action full class name"
>> enablesFor="..."
>> icon="..."
>> id="your action id"
>> label="..."
>> menubarPath="...">
>> </action>
>> </objectContribution>
>> </extension>
>>
>> as an action, you have to implement the interface IObjectActionDelegate
>>
>>
>>
>>
>> Kelvin Ng :
>>> Can someone give me a quick overview of how I can add context menu
>>> actions to editparts?
>>>
>>> I managed to get an action to show up for my editpart, but I'm trying
>>> to place that in sub-menu in the context menu.
>>>
>>> ~Kelvin Ng
>>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04355 seconds