Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to use NonResizableEditPolicy?
How to use NonResizableEditPolicy? [message #187540] Wed, 13 July 2005 13:31 Go to next message
Eclipse UserFriend
Originally posted by: wiesej.upb.de

Hello.

I want to make a figure to be not resizeable. I found the EditPolicy
NonResizableEditPolicy. I tried to install this Policy for the
corresponding EditPart via:
protected void createEditPolicies() {
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new
StartNodeNonResizableEditPolicy());
}

I tried other Roles like GRAPHICAL_NODE_ROLE but this also
didn't work...

Thanks in advance.
Jörg Wiese
Re: How to use NonResizableEditPolicy? [message #187548 is a reply to message #187540] Wed, 13 July 2005 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Sometimes the LayoutEditPolicy adds that role to the child. Maybe it is
getting overwritten?

"Wiese" <wiesej@upb.de> wrote in message
news:db353r$bp6$1@news.eclipse.org...
> Hello.
>
> I want to make a figure to be not resizeable. I found the EditPolicy
> NonResizableEditPolicy. I tried to install this Policy for the
> corresponding EditPart via:
> protected void createEditPolicies() {
> installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new
> StartNodeNonResizableEditPolicy());
> }
>
> I tried other Roles like GRAPHICAL_NODE_ROLE but this also
> didn't work...
>
> Thanks in advance.
> J
Re: How to use NonResizableEditPolicy? [message #187565 is a reply to message #187540] Wed, 13 July 2005 14:23 Go to previous message
Steve Jones is currently offline Steve JonesFriend
Messages: 95
Registered: July 2009
Member
Wiese wrote:

> Hello.
>
> I want to make a figure to be not resizeable. I found the EditPolicy
> NonResizableEditPolicy. I tried to install this Policy for the
> corresponding EditPart via:
> protected void createEditPolicies() {
> installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new
> StartNodeNonResizableEditPolicy());
> }
>
> I tried other Roles like GRAPHICAL_NODE_ROLE but this also
> didn't work...
>
> Thanks in advance.
> Jörg Wiese

Hi,

I had problems determining which policy did what. I found that overloading
the method AbstractEditPart#understandsRequest(Request) with the following
cleared up a lot of my problems.

/*
* Just for debug
*/

public boolean understandsRequest(Request req) {
EditPolicyIterator iter = getEditPolicyIterator();
while (iter.hasNext()) {
EditPolicy ep = iter.next();
if (ep.understandsRequest(req)) {
System.out.println(className(this) + "/" +
className(ep) + " understands " +
className(req) + "/" + req.getType());
return true;
}
}
System.out.println(className(this) +
" has no policy for " +
className(req) + "/" +
req.getType());
return false;
}

/*
*
*/

public static String className(Object cls) {
String className = cls.getClass().getName();
return className.substring(className.lastIndexOf('.')+1);
}

Hope it helps.

Steve.
Previous Topic:one editor wait until the another editor is opened completely
Next Topic:Sticky ToolEntry
Goto Forum:
  


Current Time: Fri Dec 13 03:55:50 GMT 2024

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

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

Back to the top