Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » ContributionItemService problem
ContributionItemService problem [message #146551] Tue, 14 August 2007 15:43 Go to next message
Eclipse UserFriend
Originally posted by: zzhangh.cn.ibm.com

Hi,
I want to add an editor action to my gmf editor and I found
contributionItemProviders extension point can be used for this purpose.
However I tried to mimic logic example without success, the
"CustomContributionItemProvider" class's createTool() method was never get
called and of course no editor action showed up.

I listed the plugin.xml fragment below, anyone can give some suggestion?

<extension
id="contribution1"
name="contribution1"

point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
<contributionItemProvider
class="com.my.CustomContributionItemProvider">
<Priority
name="Low">
</Priority>
<partContribution
class="com.ibm.crl.bo.rule.diagram.part.RuleDiagramEditor">
<partAction
id="exampleAction"
menubarPath="/file/print"
toolbarPath="/">
</partAction>
</partContribution>
</contributionItemProvider>
</extension>


Regards,
Hao
Re: ContributionItemService problem [message #149079 is a reply to message #146551] Wed, 05 September 2007 14:23 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Hao,

Did you get this working yet?

Regards,
Cherie

Hao Zhang wrote:
> Hi,
> I want to add an editor action to my gmf editor and I found
> contributionItemProviders extension point can be used for this purpose.
> However I tried to mimic logic example without success, the
> "CustomContributionItemProvider" class's createTool() method was never
> get called and of course no editor action showed up.
> I listed the plugin.xml fragment below, anyone can give some suggestion?
>
> <extension
> id="contribution1"
> name="contribution1"
>
> point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
>
> <contributionItemProvider
> class="com.my.CustomContributionItemProvider">
> <Priority
> name="Low">
> </Priority>
> <partContribution
> class="com.ibm.crl.bo.rule.diagram.part.RuleDiagramEditor">
> <partAction
> id="exampleAction"
> menubarPath="/file/print"
> toolbarPath="/">
> </partAction>
> </partContribution>
> </contributionItemProvider>
> </extension>
>
>
> Regards,
> Hao
>
Re: ContributionItemService problem [message #149440 is a reply to message #146551] Thu, 06 September 2007 15:15 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Hao,

You can use either the id or the class of the editor. However, the id
and class of your editor for this purpose will be the values returned in
your DiagramActionBarContributor class's getEditorClass() and
getEditorID() methods. Your DiagramActionBarContributor class is
specified in your editor extension. Take a look a the
LogicDiagramActionBarContributor.

<extension point="org.eclipse.ui.editors">
<editor class="MyEditor"
contributorClass="MyDiagramActionBarContributor"
...
</editor>
</extension>

I hope this helps.

Regards,
Cherie

Hao Zhang wrote:
> Hi,
> I want to add an editor action to my gmf editor and I found
> contributionItemProviders extension point can be used for this purpose.
> However I tried to mimic logic example without success, the
> "CustomContributionItemProvider" class's createTool() method was never
> get called and of course no editor action showed up.
> I listed the plugin.xml fragment below, anyone can give some suggestion?
>
> <extension
> id="contribution1"
> name="contribution1"
>
> point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
>
> <contributionItemProvider
> class="com.my.CustomContributionItemProvider">
> <Priority
> name="Low">
> </Priority>
> <partContribution
> class="com.ibm.crl.bo.rule.diagram.part.RuleDiagramEditor">
> <partAction
> id="exampleAction"
> menubarPath="/file/print"
> toolbarPath="/">
> </partAction>
> </partContribution>
> </contributionItemProvider>
> </extension>
>
>
> Regards,
> Hao
>
Re: ContributionItemService problem [message #150288 is a reply to message #149079] Wed, 12 September 2007 07:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zzhangh.cn.ibm.com

Hi Cherie,
My current situation is, I can contribute items from generated xxx.diagram
plugin, as logic and taipan examples did, but I can't contribute any item
in an outer plugin project, say xxx.diagram.custom which I created by
myself and depends xxx.diagram project. And I found no example for this
situation, yet I do need this because my actions has been defined in the
xxx.diagram.custom project and I don't want to modify much codes in
xxx.diagram project.

The other fact is if I implement IContributionItemProvider directly rather
than inherit AbstractContributionItemProvider, the
contributeToActionBars() method can get called when editor opens, so I
guess likely there is some logic in AbstractContributionItemProvider not
suitable for contributionItemProvider defined in outer plugin.. I'm trying
to locate..

Cherie Revells wrote:

> Hao,

> Did you get this working yet?

> Regards,
> Cherie

> Hao Zhang wrote:
>> Hi,
>> I want to add an editor action to my gmf editor and I found
>> contributionItemProviders extension point can be used for this purpose.
>> However I tried to mimic logic example without success, the
>> "CustomContributionItemProvider" class's createTool() method was never
>> get called and of course no editor action showed up.
>> I listed the plugin.xml fragment below, anyone can give some suggestion?
>>
>> <extension
>> id="contribution1"
>> name="contribution1"
>>
>>
point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
>>
>> <contributionItemProvider
>> class="com.my.CustomContributionItemProvider">
>> <Priority
>> name="Low">
>> </Priority>
>> <partContribution
>> class="com.ibm.crl.bo.rule.diagram.part.RuleDiagramEditor">
>> <partAction
>> id="exampleAction"
>> menubarPath="/file/print"
>> toolbarPath="/">
>> </partAction>
>> </partContribution>
>> </contributionItemProvider>
>> </extension>
>>
>>
>> Regards,
>> Hao
>>
Re: ContributionItemService problem [message #150315 is a reply to message #150288] Wed, 12 September 2007 08:10 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi Hao,

I am facing exactly the same situation: I want to add a new action to
menubar and toolbar, but defined within an external plugin.
I also wonder at which point the visual aspects are defined (i.e. the
toolbar icon).
Please let us know if you cope with this problem.


Hao Zhang schrieb:
> Hi Cherie,
> My current situation is, I can contribute items from generated
> xxx.diagram plugin, as logic and taipan examples did, but I can't
> contribute any item in an outer plugin project, say xxx.diagram.custom
> which I created by myself and depends xxx.diagram project. And I found
> no example for this situation, yet I do need this because my actions has
> been defined in the xxx.diagram.custom project and I don't want to
> modify much codes in xxx.diagram project.
>
> The other fact is if I implement IContributionItemProvider directly
> rather than inherit AbstractContributionItemProvider, the
> contributeToActionBars() method can get called when editor opens, so I
> guess likely there is some logic in AbstractContributionItemProvider not
> suitable for contributionItemProvider defined in outer plugin.. I'm
> trying to locate..
>
> Cherie Revells wrote:
>
>> Hao,
>
>> Did you get this working yet?
>
>> Regards,
>> Cherie
>
>> Hao Zhang wrote:
>>> Hi,
>>> I want to add an editor action to my gmf editor and I found
>>> contributionItemProviders extension point can be used for this
>>> purpose. However I tried to mimic logic example without success, the
>>> "CustomContributionItemProvider" class's createTool() method was
>>> never get called and of course no editor action showed up.
>>> I listed the plugin.xml fragment below, anyone can give some suggestion?
>>>
>>> <extension
>>> id="contribution1"
>>> name="contribution1"
>>>
> point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
>
>>>
>>> <contributionItemProvider
>>> class="com.my.CustomContributionItemProvider">
>>> <Priority
>>> name="Low">
>>> </Priority>
>>> <partContribution
>>>
>>> class="com.ibm.crl.bo.rule.diagram.part.RuleDiagramEditor">
>>> <partAction
>>> id="exampleAction"
>>> menubarPath="/file/print"
>>> toolbarPath="/">
>>> </partAction>
>>> </partContribution>
>>> </contributionItemProvider>
>>> </extension>
>>>
>>>
>>> Regards,
>>> Hao
>>>
>
>
Re: ContributionItemService problem [message #150887 is a reply to message #150315] Sun, 16 September 2007 06:26 Go to previous messageGo to next message
Hao Zhang is currently offline Hao ZhangFriend
Messages: 161
Registered: July 2009
Senior Member
Axel,

Cherie helped me out, the key is to add

checkPluginLoaded="false"

in my contribution item provider extension, hope this also helps for you.

Regards,
Hao

"Axel Guckelsberger" <info@guite.de>
??????:fc86tl$auq$1@build.eclipse.org...
> Hi Hao,
>
> I am facing exactly the same situation: I want to add a new action to
> menubar and toolbar, but defined within an external plugin.
> I also wonder at which point the visual aspects are defined (i.e. the
> toolbar icon).
> Please let us know if you cope with this problem.
>
>
> Hao Zhang schrieb:
>> Hi Cherie,
>> My current situation is, I can contribute items from generated
>> xxx.diagram plugin, as logic and taipan examples did, but I can't
>> contribute any item in an outer plugin project, say xxx.diagram.custom
>> which I created by myself and depends xxx.diagram project. And I found
>> no example for this situation, yet I do need this because my actions has
>> been defined in the xxx.diagram.custom project and I don't want to
>> modify much codes in xxx.diagram project.
>>
>> The other fact is if I implement IContributionItemProvider directly
>> rather than inherit AbstractContributionItemProvider, the
>> contributeToActionBars() method can get called when editor opens, so I
>> guess likely there is some logic in AbstractContributionItemProvider not
>> suitable for contributionItemProvider defined in outer plugin.. I'm
>> trying to locate..
>>
>> Cherie Revells wrote:
>>
>>> Hao,
>>
>>> Did you get this working yet?
>>
>>> Regards,
>>> Cherie
>>
>>> Hao Zhang wrote:
>>>> Hi,
>>>> I want to add an editor action to my gmf editor and I found
>>>> contributionItemProviders extension point can be used for this
>>>> purpose. However I tried to mimic logic example without success, the
>>>> "CustomContributionItemProvider" class's createTool() method was
>>>> never get called and of course no editor action showed up.
>>>> I listed the plugin.xml fragment below, anyone can give some
>>>> suggestion?
>>>>
>>>> <extension
>>>> id="contribution1"
>>>> name="contribution1"
>>>>
>> point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
>>
>>>>
>>>> <contributionItemProvider
>>>> class="com.my.CustomContributionItemProvider">
>>>> <Priority
>>>> name="Low">
>>>> </Priority>
>>>> <partContribution
>>>>
>>>> class="com.ibm.crl.bo.rule.diagram.part.RuleDiagramEditor">
>>>> <partAction
>>>> id="exampleAction"
>>>> menubarPath="/file/print"
>>>> toolbarPath="/">
>>>> </partAction>
>>>> </partContribution>
>>>> </contributionItemProvider>
>>>> </extension>
>>>>
>>>>
>>>> Regards,
>>>> Hao
>>>>
>>
>>
Re: ContributionItemService problem [message #150898 is a reply to message #150887] Sun, 16 September 2007 09:42 Go to previous message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hao,

I solved it by overriding the ActionBarAdvisor XPand template.


Hao Zhang schrieb:
> Axel,
>
> Cherie helped me out, the key is to add
>
> checkPluginLoaded="false"
>
> in my contribution item provider extension, hope this also helps for you.
>
> Regards,
> Hao
>
> "Axel Guckelsberger" <info@guite.de>
> ??????:fc86tl$auq$1@build.eclipse.org...
>> Hi Hao,
>>
>> I am facing exactly the same situation: I want to add a new action to
>> menubar and toolbar, but defined within an external plugin.
>> I also wonder at which point the visual aspects are defined (i.e. the
>> toolbar icon).
>> Please let us know if you cope with this problem.
>>
>>
>> Hao Zhang schrieb:
>>> Hi Cherie,
>>> My current situation is, I can contribute items from generated
>>> xxx.diagram plugin, as logic and taipan examples did, but I can't
>>> contribute any item in an outer plugin project, say xxx.diagram.custom
>>> which I created by myself and depends xxx.diagram project. And I found
>>> no example for this situation, yet I do need this because my actions has
>>> been defined in the xxx.diagram.custom project and I don't want to
>>> modify much codes in xxx.diagram project.
>>>
>>> The other fact is if I implement IContributionItemProvider directly
>>> rather than inherit AbstractContributionItemProvider, the
>>> contributeToActionBars() method can get called when editor opens, so I
>>> guess likely there is some logic in AbstractContributionItemProvider not
>>> suitable for contributionItemProvider defined in outer plugin.. I'm
>>> trying to locate..
>>>
>>> Cherie Revells wrote:
>>>
>>>> Hao,
>>>> Did you get this working yet?
>>>> Regards,
>>>> Cherie
>>>> Hao Zhang wrote:
>>>>> Hi,
>>>>> I want to add an editor action to my gmf editor and I found
>>>>> contributionItemProviders extension point can be used for this
>>>>> purpose. However I tried to mimic logic example without success, the
>>>>> "CustomContributionItemProvider" class's createTool() method was
>>>>> never get called and of course no editor action showed up.
>>>>> I listed the plugin.xml fragment below, anyone can give some
>>>>> suggestion?
>>>>>
>>>>> <extension
>>>>> id="contribution1"
>>>>> name="contribution1"
>>>>>
>>> point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
>>>
>>>>> <contributionItemProvider
>>>>> class="com.my.CustomContributionItemProvider">
>>>>> <Priority
>>>>> name="Low">
>>>>> </Priority>
>>>>> <partContribution
>>>>>
>>>>> class="com.ibm.crl.bo.rule.diagram.part.RuleDiagramEditor">
>>>>> <partAction
>>>>> id="exampleAction"
>>>>> menubarPath="/file/print"
>>>>> toolbarPath="/">
>>>>> </partAction>
>>>>> </partContribution>
>>>>> </contributionItemProvider>
>>>>> </extension>
>>>>>
>>>>>
>>>>> Regards,
>>>>> Hao
>>>>>
>>>
>
>
Previous Topic:Again, how to change diagram layout?
Next Topic:Element creation
Goto Forum:
  


Current Time: Sat Aug 17 19:15:31 GMT 2024

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

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

Back to the top