Skip to main content



      Home
Home » Eclipse Projects » GEF » [GEF5] Click policies chain
[GEF5] Click policies chain [message #1760757] Tue, 02 May 2017 12:33 Go to next message
Eclipse UserFriend
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 12:34] by Moderator

Re: [GEF5] Click policies chain [message #1760789 is a reply to message #1760757] Tue, 02 May 2017 23:31 Go to previous messageGo to next message
Eclipse UserFriend
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 05:46 Go to previous message
Eclipse UserFriend
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 05:49] by Moderator

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


Current Time: Fri Apr 18 13:40:47 EDT 2025

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

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

Back to the top