Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Selectable but non dragable editpart
Selectable but non dragable editpart [message #900270] Mon, 06 August 2012 09:40 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

I want my editpart's children to be selectable(get the selection border on selection) but not dragable.
if i donot implement EditPolicy.LAYOUT_ROLE then editparts are not dragable but on selection border does not change

Any idea?

Cheers,
Re: Selectable but non dragable editpart [message #900303 is a reply to message #900270] Mon, 06 August 2012 12:25 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi,

on your parent's layout policy:
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
    if (child instanceof ...) {
	return new NonResizableEditPolicy() {

	    @Override
	    public boolean isDragAllowed() {
		return false;
	    }

	};
    ...
    }
}
Re: Selectable but non dragable editpart [message #900310 is a reply to message #900303] Mon, 06 August 2012 12:58 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Thanks!

it worked fine. I have FlowLayoutEditPolicy as policy and i do not want children to move. Currently selected child can be draged with in parent to change the possition. Can i also disable this behavior?

Cheers,
Re: Selectable but non dragable editpart [message #900325 is a reply to message #900310] Mon, 06 August 2012 13:45 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Using the code I posted to you, it should works just like that.
Previous Topic:using GEF rich text in Graphiti application
Next Topic:Native DND drag over effect
Goto Forum:
  


Current Time: Tue Mar 19 06:37:35 GMT 2024

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

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

Back to the top