Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF5] Click policies chain
[GEF5] Click policies chain [message #1760757] Tue, 02 May 2017 16:33 Go to next message
Maxim Martynov is currently offline Maxim MartynovFriend
Messages: 22
Registered: February 2017
Junior Member
I have Pane with another Pane children. I want to add OnClickHandler which will add another componentns as childrens on TOP Pane. When i click on TOP pane which has parent Pane several OnClick events invoked by ClickDragGesture. How i can skip all events on parent Pane and handle only last event in chain to add children only to TOP Panel?

[Updated on: Tue, 02 May 2017 16:34]

Report message to a moderator

Re: [GEF5] Click policies chain [message #1760789 is a reply to message #1760757] Wed, 03 May 2017 03:31 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
What you mean is that the ClickDragGesture invokes multiple IOnClickHandlers (for all panes in the hierarchy), right? What you have to do in this case is to bind a different IHandlerResolver, which adjusts the default behavior by only forwarding it to a single pane (instead of all in the chain).
Re: [GEF5] Click policies chain [message #1760817 is a reply to message #1760789] Wed, 03 May 2017 09:46 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Alternatively, you can simply use the AbstractHandler#isRegistered(EventTarget) and #isRegisteredForHost(EventTarget) methods to guard the IOnClickHandler implementations from running when the received event is not designated for their host. For a usage example, you can take a look at the FocusAndSelectOnClickPolicy:

// check if the host is the explicit event target
if (isRegistered(e.getTarget())
		&& !isRegisteredForHost(e.getTarget())) {
	// do not process events for other parts
	return;
}


Best regards,
Matthias

[Updated on: Wed, 03 May 2017 09:49]

Report message to a moderator

Previous Topic:Drag & drop in parent - child relation
Next Topic:Connections in gef4
Goto Forum:
  


Current Time: Tue Apr 16 17:58:32 GMT 2024

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

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

Back to the top