Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to stop resizing?
How to stop resizing? [message #211179] Wed, 08 March 2006 20:14 Go to next message
Martin Holmes is currently offline Martin HolmesFriend
Messages: 79
Registered: July 2009
Member
Hi all
Anyone know how to stop resizing.

I have stopped the element resizing by not including
RequestConstants.REQ_RESIZE in the command

public boolean canExecute() {
Object type = request.getType();
return (RequestConstants.REQ_MOVE.equals(type)
||
RequestConstants.REQ_MOVE_CHILDREN.equals(type));
}



However I still get the gray shaded box that indicates resize!

thanks

Martin
Re: How to stop resizing? [message #211219 is a reply to message #211179] Thu, 09 March 2006 01:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: uniera.gmail.com

I think you should install a NonResizableEditPolicy to the editpart with
key=EditPolicy.LAYOUT_ROLE.

Martin Holmes wrote:
> Hi all
> Anyone know how to stop resizing.
>
> I have stopped the element resizing by not including
> RequestConstants.REQ_RESIZE in the command
>
> public boolean canExecute() {
> Object type = request.getType();
> return (RequestConstants.REQ_MOVE.equals(type)
> ||
> RequestConstants.REQ_MOVE_CHILDREN.equals(type));
> }
>
>
>
> However I still get the gray shaded box that indicates resize!
>
> thanks
>
> Martin
>
>
>
Re: How to stop resizing? [message #211236 is a reply to message #211219] Thu, 09 March 2006 02:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brandonchen.realtek.com.tw

Hi,

You can use setResizeDirections(...) to specify the direction to resize.
The below is from the logic exmaple..


protected EditPolicy createChildEditPolicy(EditPart child) {

if (child instanceof LEDEditPart || child instanceof OutputEditPart) {
ResizableEditPolicy policy = new LogicResizableEditPolicy();
policy.setResizeDirections(PositionConstants.EAST |
PositionConstants.WEST | PositionConstants.SOUTH |PositionConstants.NORTH);
return policy;
}
return new LogicResizableEditPolicy();
}


Brandon

"Uniera" <uniera@gmail.com> ??? news:duo0fb$4mj$1@utils.eclipse.org ???...
> I think you should install a NonResizableEditPolicy to the editpart with
> key=EditPolicy.LAYOUT_ROLE.
>
> Martin Holmes wrote:
> > Hi all
> > Anyone know how to stop resizing.
> >
> > I have stopped the element resizing by not including
> > RequestConstants.REQ_RESIZE in the command
> >
> > public boolean canExecute() {
> > Object type = request.getType();
> > return (RequestConstants.REQ_MOVE.equals(type)
> > ||
> > RequestConstants.REQ_MOVE_CHILDREN.equals(type));
> > }
> >
> >
> >
> > However I still get the gray shaded box that indicates resize!
> >
> > thanks
> >
> > Martin
> >
> >
> >
Re: How to stop resizing? [message #211293 is a reply to message #211179] Thu, 09 March 2006 09:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gmittendorferREMOVETHISTEXT.web.de

Martin Holmes wrote:
> Hi all
> Anyone know how to stop resizing.
>
> I have stopped the element resizing by not including
> RequestConstants.REQ_RESIZE in the command
>
> public boolean canExecute() {
> Object type = request.getType();
> return (RequestConstants.REQ_MOVE.equals(type)
> ||
> RequestConstants.REQ_MOVE_CHILDREN.equals(type));
> }
>
>
>
> However I still get the gray shaded box that indicates resize!
>
> thanks
>
> Martin

Hi,

if you don't want your child edit parts resizable you can override
createChildEditPolicy in the parents layout edit policy. By default it
returns a ResizableEditPolicy.

E.g.:

@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
return new NonResizableEditPolicy();
}

Regards,

Georg
Re: How to stop resizing? [message #211301 is a reply to message #211179] Thu, 09 March 2006 12:48 Go to previous message
Martin Holmes is currently offline Martin HolmesFriend
Messages: 79
Registered: July 2009
Member
Thanks

I set the in the layout policy of the parent edit part with.

@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
return new NonResizableEditPolicy();
}



Interesting .... So I have the option for a parent to manage child policies
when dealing with subclasses of LayoutEditPolicy.

But what kind of policies should be set within
createChildEditPolicy(EditPart child) {} ?

thanks again for your help!

Martin




"Martin Holmes" <martincanbe@hotmail.com> wrote in message
news:dune76$imh$1@utils.eclipse.org...
> Hi all
> Anyone know how to stop resizing.
>
> I have stopped the element resizing by not including
> RequestConstants.REQ_RESIZE in the command
>
> public boolean canExecute() {
> Object type = request.getType();
> return (RequestConstants.REQ_MOVE.equals(type)
> ||
> RequestConstants.REQ_MOVE_CHILDREN.equals(type));
> }
>
>
>
> However I still get the gray shaded box that indicates resize!
>
> thanks
>
> Martin
>
>
Previous Topic:New to GEF need help
Next Topic:Change default PropertySheetPage to use on-top editor
Goto Forum:
  


Current Time: Sun Nov 27 17:03:08 GMT 2022

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

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

Back to the top