Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » To prevent manual selection of elements on editor
To prevent manual selection of elements on editor [message #487955] Fri, 25 September 2009 03:57 Go to next message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
I have 2 different perspectives and in of the perspective i do not want to allow the user to be able to select any element on the editor manually. Could this be achieved in any way.
Re: To prevent manual selection of elements on editor [message #488180 is a reply to message #487955] Fri, 25 September 2009 18:50 Go to previous messageGo to next message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello sowmya,

Try to remove EditPolicy.PRIMARY_DRAG_ROLE EditPolicy from corresponding
diagram elements (EditParts).

-----------------
Alex Shatalin
Re: To prevent manual selection of elements on editor [message #488819 is a reply to message #488180] Wed, 30 September 2009 12:27 Go to previous messageGo to next message
Vikas Goyal is currently offline Vikas GoyalFriend
Messages: 34
Registered: July 2009
Member
Hello Alex ,

I added "removeEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);" in corresponding editpart , but still I am able to select the element and I am able to drag as well.

Best Regards,
Vikas
Re: To prevent manual selection of elements on editor [message #488901 is a reply to message #488819] Wed, 30 September 2009 16:11 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Hello,

> I added "removeEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);" in
> corresponding editpart , but still I am able to select the element and I
> am able to drag as well.

I faced a similar issue and here is the workaround I used:
I couldn't successfully override the PRIMARY_DRAG_ROLE from any EditPolicyProvider, whatever its priority is. It seems that this role is set up on elements by the container's XYLayoutPolicy, in the createChildEditPolicy() method.
Then it is possible to override the container's EditPolicy by Overriding the LAYOUT_ROLE on containers and providing a custom XYLayoutPolicy with a custom createChildEditPolicy method.

I used a ResizableShapeEditPolicy, with some method overriden (showSelection, getMoveCommand...) and it helped me.

HTH
Mickael
Previous Topic:Copy diagram screenshot to clipboard
Next Topic:[Announce] GMF 2.3.0M2 is available
Goto Forum:
  


Current Time: Fri Apr 26 03:36:55 GMT 2024

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

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

Back to the top