Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » dropdown menu in view toolbar
dropdown menu in view toolbar [message #331005] Thu, 21 August 2008 01:16 Go to next message
Eclipse UserFriend
Originally posted by: marc.esher.comcast.net

Greetings all.
I'd like to add a dynamic dropdown menu into the toolbar of my view,
similar to the "test history" dropdown in the junit view. My question is, is
there anything special I need to know -- any gotchas -- about creating menus
dynamically every time the dropdown is clicked? Essentially, it'll be a
"history" dropdown that shows a last XXX items. so that menu can't be
static.
I seem to remember reading/hearing something about a memory leak in this
area; possibly I read it in a bug in bugzilla, but I can't remember.

thanks for any pointers on creating dynamic dropdown menus in views.

best,

marc
Re: dropdown menu in view toolbar [message #331217 is a reply to message #331005] Thu, 28 August 2008 14:22 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It can be done with commands and menu contributions or
IViewActionDelegates and popupMenus, or simply by adding the appropriate
IAction to the views toolbar during createPartControl().

The first way uses a subclass of CompoundContributionItem and other
IContributionItems, the second 2 ways involve using IMenuCreator and SWT
directly.

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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: dropdown menu in view toolbar [message #331287 is a reply to message #331217] Thu, 28 August 2008 21:42 Go to previous message
Eclipse UserFriend
Originally posted by: marc.esher.comcast.net

Thanks Paul. I ended up figuring this out and it works quite nicely. I'm
really happy with how easy it was to get it going. One thing I found though
was some code on koders to fix a leak of memory items in dynamic menus, i
believe from the junit test history action. glad i found that.

cheers,

marc



"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:g96cl4$4q7$1@build.eclipse.org...
> It can be done with commands and menu contributions or
> IViewActionDelegates and popupMenus, or simply by adding the appropriate
> IAction to the views toolbar during createPartControl().
>
> The first way uses a subclass of CompoundContributionItem and other
> IContributionItems, the second 2 ways involve using IMenuCreator and SWT
> directly.
>
> 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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Previous Topic:BusyIndicator vs ProgressMonitorDialog
Next Topic:Enable disable action set
Goto Forum:
  


Current Time: Sat Oct 19 10:05:25 GMT 2024

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

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

Back to the top