Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How to associate keyboard shortcuts with custom features?
How to associate keyboard shortcuts with custom features? [message #1099314] Sun, 01 September 2013 13:39 Go to next message
Surya Kathayat is currently offline Surya KathayatFriend
Messages: 44
Registered: July 2012
Member
Hi,

Can we associate keyboard shortcuts with custom features?

If yes, how it can be done.?

Best Regards
Surya
Re: How to associate keyboard shortcuts with custom features? [message #1100616 is a reply to message #1099314] Tue, 03 September 2013 10:46 Go to previous messageGo to next message
Felix Velasco is currently offline Felix VelascoFriend
Messages: 43
Registered: July 2009
Member
Yes, you can.

See org.eclipse.graphiti.testtool.sketch plug-in for an example.

In the plugin.xml the key binding is created to the org.eclipse.graphiti.ui.featureExecutionCommand commandId, and in SketchToolBehavior#getCommandFeature, the custom feature to execute is selected. The hint parameter let's you select the specific feature so you can use different bindings for different features.

Since this approach uses the command infrastructure, it can be used for key bindings, menu entries, toolbar buttons, etc...
Re: How to associate keyboard shortcuts with custom features? [message #1141878 is a reply to message #1100616] Thu, 17 October 2013 08:48 Go to previous messageGo to next message
Surya Kathayat is currently offline Surya KathayatFriend
Messages: 44
Registered: July 2012
Member
Hi,

There is no getCommandFeature method in DefaultToolBehaviorProvider.
Which version of Graphitti that you are using?

Best Regards
Surya
Re: How to associate keyboard shortcuts with custom features? [message #1141879 is a reply to message #1100616] Thu, 17 October 2013 08:50 Go to previous messageGo to next message
Surya Kathayat is currently offline Surya KathayatFriend
Messages: 44
Registered: July 2012
Member
Hi

There is no getCommandFeature method available in DefaultToolBehaviorProvider.
Which version of Graphitti you are using?

Best Regards
Surya
Re: How to associate keyboard shortcuts with custom features? [message #1143635 is a reply to message #1141879] Fri, 18 October 2013 10:14 Go to previous message
Felix Velasco is currently offline Felix VelascoFriend
Messages: 43
Registered: July 2009
Member
It got added in 0.10.0, but if you're using an older version you may add this functionality to your own plugin. Just see commit bf0cfafed440a4cea.

You'd need to define your own command, and provide a handler similar to FeatureExecutionHandler, but probably hardcoded to the specific feature you want to invoke.
Previous Topic:Add connection without palette
Next Topic: CASE-Tool and Code Generation (NON-EMF)
Goto Forum:
  


Current Time: Fri Apr 19 14:31:33 GMT 2024

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

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

Back to the top