| Home » Modeling » GMF (Graphical Modeling Framework) » ContributionItemService problem
 Goto Forum:| 
| ContributionItemService problem [message #146551] | Tue, 14 August 2007 11:43  |  | 
| Eclipse User  |  |  |  |  | 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 03:19   |  | 
| Eclipse User  |  |  |  |  | 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 04:10   |  | 
| Eclipse User  |  |  |  |  | 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 02:26   |  | 
| Eclipse User  |  |  |  |  | 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 05:42  |  | 
| Eclipse User  |  |  |  |  | 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
 >>>>>
 >>>
 >
 >
 |  |  |  | 
 
 
 Current Time: Fri Oct 31 04:03:01 EDT 2025 
 Powered by FUDForum . Page generated in 0.06423 seconds |