Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Custom Feature on Menu Bar(Custom Feature on Menu Bar)
Custom Feature on Menu Bar [message #1464333] Fri, 07 November 2014 12:33 Go to next message
Ken Mersado is currently offline Ken MersadoFriend
Messages: 19
Registered: October 2014
Junior Member
Hi All,

Is there a way to call a custom feature in a menu bar? I am trying to call several custom features i created into the menu bar.

Thanks
Re: Custom Feature on Menu Bar [message #1512992 is a reply to message #1464333] Tue, 16 December 2014 06:10 Go to previous messageGo to next message
venu gopal is currently offline venu gopalFriend
Messages: 2
Registered: December 2014
Junior Member
I am new to Eclipse plug in.... am working GEF framework.Can you help me on add Custom menu?
Re: Custom Feature on Menu Bar [message #1591057 is a reply to message #1512992] Thu, 29 January 2015 09:41 Go to previous message
Ken Mersado is currently offline Ken MersadoFriend
Messages: 19
Registered: October 2014
Junior Member
Hi Venu,

You can add a custom menu by creating a custom feature and return it in your default feature provider. You can create custom feature by extending AbstractCustomFeature.
For example:
public class MyCustomFeature extends AbstractCustomFeature {
}


And return it in your default feature provider.
public class MyFeatureProvider extends DefaultFeatureProvider {
	// other methods
	public ICustomFeature[] getCustomFeatures(ICustomContext context) {
		return new ICustomFeature[] { new MyCustomFeature(this) };
	}
}


You can see the added custom menu in the popup menu of the diagram editor. Hope it helps you Smile

Thanks,
Ken
Previous Topic:How to Trigger Action from an Action
Next Topic:How to allow drag & drop of a file on the hard disk into GEF editor?
Goto Forum:
  


Current Time: Thu Apr 25 09:22:55 GMT 2024

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

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

Back to the top