Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » can dynamic menus exist in global menubar?
can dynamic menus exist in global menubar? [message #331265] Thu, 28 August 2008 17:15 Go to next message
Matt Anderson is currently offline Matt AndersonFriend
Messages: 6
Registered: July 2009
Junior Member
My apologies if I don't get the terminology correct (first time poster)
but I have a plugin that is lazy-loaded and I want to place a dynamic menu
in the global menubar. The contributionclass that supplies the dynamic
tag is in my plugin.

<menuContribution locationURI="menu:file?after=file.New">
<menu
id="package.Label1"
label="ParentMenu">
<dynamic
class="plugin.package.ContributionItem1"
id="plugin.package.ContributionItem1">
<visibleWhen>
<reference
definitionId="plugin.inMainView">
</reference>
</visibleWhen>
</dynamic>
</menu>
</menuContribution>

I get a runtime error that the class can't be found.

org.eclipse.core.runtime - org.eclipse.ui - 0 - Class load Failure:
'plugin.package.ContributionItem1'

org.eclipse.core.runtime.CoreException: Plug-in plugin was unable to load
class plugin.package.ContributionItem1.

If I make the dynamic a pop up or view specific, it works however I have a
hard requirement that our functionality exists in the global menubar.

Any suggestions?
Re: can dynamic menus exist in global menubar? [message #331280 is a reply to message #331265] Thu, 28 August 2008 18:17 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Matt Anderson wrote:
> My apologies if I don't get the terminology correct (first time poster)
> but I have a plugin that is lazy-loaded and I want to place a dynamic
> menu in the global menubar. The contributionclass that supplies the
> dynamic tag is in my plugin.

Aside from file.New being file.new I don't think it should make a
difference. Is the menu contribution in the same plugin that has the
class plugin.package.ContributionItem1?


PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: can dynamic menus exist in global menubar? [message #331340 is a reply to message #331280] Tue, 02 September 2008 15:24 Go to previous messageGo to next message
Matt Anderson is currently offline Matt AndersonFriend
Messages: 6
Registered: July 2009
Junior Member
Sorry for the long delay in response, holidaze weekend...

the file.New/new was a code scrub fat finger(my fault, not an issue) and
the menu contribution and the class are in the same plugin...

Any suggestions?
Re: can dynamic menus exist in global menubar? [message #331498 is a reply to message #331280] Wed, 10 September 2008 12:32 Go to previous messageGo to next message
kevin miles is currently offline kevin milesFriend
Messages: 9
Registered: July 2009
Junior Member
Paul and Matt,

I've been working with Matt on this issue and i've found 2 things.

1. A plugin that contributes a dynamic menu is started at bootup i.e.
doesn't seem to lazy load.
2. Having a plugin that contributes a dynamic menu in your RCP can
reorganize the activation order of the all plugins compared to an RCP
that has none.

In short, matt's original prob had nothing to do w/ eclipse dynamic
menus and everything to do w/ some of our core plugins asking for a
workbenchwindow before it should.

But... should the observation #1 from above be true? Should i put all
dynamic CompoundContributionItems in a sep plugin?

kjm

Paul Webster wrote:
> Matt Anderson wrote:
>> My apologies if I don't get the terminology correct (first time
>> poster) but I have a plugin that is lazy-loaded and I want to place a
>> dynamic menu in the global menubar. The contributionclass that
>> supplies the dynamic tag is in my plugin.
>
> Aside from file.New being file.new I don't think it should make a
> difference. Is the menu contribution in the same plugin that has the
> class plugin.package.ContributionItem1?
>
>
> PW
>
Re: can dynamic menus exist in global menubar? [message #331537 is a reply to message #331498] Thu, 11 September 2008 13:21 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

kevin j miles wrote:
> Paul and Matt,
>
> I've been working with Matt on this issue and i've found 2 things.
>
> 1. A plugin that contributes a dynamic menu is started at bootup i.e.
> doesn't seem to lazy load.
> 2. Having a plugin that contributes a dynamic menu in your RCP can
> reorganize the activation order of the all plugins compared to an RCP
> that has none.
> But... should the observation #1 from above be true? Should i put all
> dynamic CompoundContributionItems in a sep plugin?
>


Hi Kevin,

Yes, the dynamic contribution item will be instantiated on the workbench
window creation, and that will force the plugin to start. Obviously it
should be instantiated when it needs to fill a menu or toolbar (in 3.4 I
believe it supports the more general ContributionItem). Since the main
menus aren't updated until they are actually shown, I think that we
could proxy the IContributionItem to delay loading as much as possible.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=246999

Later,
PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:extension points without OSGi?
Next Topic:Creating a perspective on Runtime
Goto Forum:
  


Current Time: Mon Aug 19 14:22:30 GMT 2024

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

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

Back to the top