Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF4] Disable default selection policy
[GEF4] Disable default selection policy [message #1732912] Mon, 23 May 2016 01:54 Go to next message
Colin Sharples is currently offline Colin SharplesFriend
Messages: 96
Registered: July 2009
Location: Wellington, New Zealand
Member

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?


Colin Sharples
CTG Games Ltd
Wellington, New Zealand
Re: [GEF4] Disable default selection policy [message #1733060 is a reply to message #1732912] Tue, 24 May 2016 07:14 Go to previous message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
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: Fri Apr 26 05:28:17 GMT 2024

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

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

Back to the top