Home » Modeling » GMF (Graphical Modeling Framework) » ContributionItemService problem
ContributionItemService problem [message #146551] |
Tue, 14 August 2007 15:43 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #150288 is a reply to message #149079] |
Wed, 12 September 2007 07:19 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Axel Guckelsberger![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=info%40guite.de) 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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Hao Zhang![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=bjzhanghao%4021cn.com) 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 Go to previous message](theme/Solstice/images/up.png) |
Axel Guckelsberger![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=info%40guite.de) 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
>>>>>
>>>
>
>
|
|
|
Goto Forum:
Current Time: Sat Aug 17 19:22:31 GMT 2024
Powered by FUDForum. Page generated in 0.03131 seconds
|