Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF4] How to add a global policy to handle shortcuts
[GEF4] How to add a global policy to handle shortcuts [message #1713898] Sat, 07 November 2015 17:45 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Hi

I try to add a policy to handle keyboard short cuts.
What is the best/preferred way?

I tried to
	@Override
	protected void bindAbstractRootPartAdapters(MapBinder<AdapterKey<?>, Object> adapterMapBinder) {
		super.bindAbstractRootPartAdapters(adapterMapBinder);
		adapterMapBinder
			.addBinding( AdapterKey.get( FXTypeTool.TOOL_POLICY_KEY, "GlobalOnTypePolicy"))
			.to( GlobalOnTypePolicy.class);
	}


This works, as long as nothing is selected. Otherwise not.

thanks
Frank

Re: [GEF4] How to add a global policy to handle shortcuts [message #1713960 is a reply to message #1713898] Mon, 09 November 2015 07:41 Go to previous message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
Up to now, the policies of the focus part (i.e. the one referred to in the FocusModel) receives those key events. The policies of the root part will only receive the events if there is no root part. This means that up to now, you will have to register a respective delegating policies at those parts that may have focus. We are planning to enhance the behavior (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=481678).
Previous Topic:[GEF4 MVC] concept for adding items
Next Topic:[GEF4] drag relocation, how to update the model
Goto Forum:
  


Current Time: Thu Apr 25 22:15:03 GMT 2024

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

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

Back to the top