Skip to main content



      Home
Home » Eclipse Projects » GEF » [GEF4] Disable default selection policy
[GEF4] Disable default selection policy [message #1732912] Sun, 22 May 2016 21:54 Go to next message
Eclipse UserFriend
I have a default FXFocusAndSelectOnClickPolicy installed on all my parts to handle basic selection (create selection handles etc).

There's various times when I'd like to disable this policy while some action is happening, and then turn it on again when finished.

For example, when creating shapes, I use an IFXOnClickPolicy on the root part so that the user can create a shape by clicking on the places where bendpoints will go. If this happens to be where an existing part sits (it's perfectly valid in my model for shapes to overlap), then that existing part gets selected, which i don't want. In some cases, I will need to be able to use a different selection policy, e.g. to attach the new part to an existing part.

Another case is where I add some widgets to manipulate shape properties in a context menu - for something like the width of a line I use a Spinner. I would prefer the context menu to stay open until the user clicks away from the part, but currently the context menu is dismissed after every click on the Spinner, because it seems that even clicking on the Spinner generates change in selection.

Can I mark a policy as being not active? Or would it be better to do something with the FXClickDragTool?
Re: [GEF4] Disable default selection policy [message #1733060 is a reply to message #1732912] Tue, 24 May 2016 03:14 Go to previous message
Eclipse UserFriend
There is currently no way of inactivating a policy (as its passive by design), only behaviors are IActivatable. I think it would be best to bind a different ITargetPolicyResolver implementation in which you can properly filter the target parts.
Previous Topic:Some figures aren't drawn. Why?
Next Topic:Undo/Redo model property
Goto Forum:
  


Current Time: Wed Jul 23 22:02:30 EDT 2025

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

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

Back to the top