Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] IContainmentHandler and IConstraintHandler

Hi Rich,
 
In Swing VE, the same class implements IContainmenthandler and IConstraintHandler.
 
Can I have separate classes for above?
 
I tried this: ModelAdapter class implements IContainmentHandler. An iner class of ULCComponentGraphicalEditPart implements IConstraintHandler and getAdapter() method returns this object whenever the framework needs an IConstraintHandler.
 
But I have a problem:
 
Suppose I add a button to a frame. The button has text defined from contributeToDropRequest. Then I drag the button out of the frame on to the canvas. Two things happen:
 
1. The button loses the text that was set on it.
2. As a result its size shrinks
3. I can no longer resize the button on the canvas (seems like I am losing some adapters too).
 
Can you tell me what is wrong? Why should the button lose its text? Can you please give me a bigger picture of what has changed in this context w.r.t 1.1?
 
Thanks and regards,
 
Janak
-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On Behalf Of Rich Kulp
Sent: Tuesday, November 14, 2006 10:18 PM
To: Discussions people developing code for the Visual Editor project
Subject: Re: [ve-dev] IContainmentHandler and IConstraintHandler


Hi,

On a drop there is no graphical edit part yet, it hasn't been dropped yet to have a graphical editpart (size on drop happens BEFORE the part is actually added to the model). Because of that there is no editpart to ask to get the IConstraintHandler, so it must instead ask the model adapter which is based upon the type of the child. The jfc.AbstractComponentModelContainmentHandler already implements IConstraintHandler. If you have your own version of jfc.AbstractComponentModelContainmentHandler then you should take a look at the jfc one to see what you need.

Thanks,
Rich


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

11/14/2006 11:26 AM

Please respond to
Discussions people developing code for the Visual Editor project        <ve-dev@xxxxxxxxxxx>

To
"ve-Dev@Eclipse. Org" <ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] IContainmentHandler and IConstraintHandler





Hi VE Team,

In VE 1.1:

1. I was defining creation policy in override file to set title on Frame,
text on button etc. on drop on the canvas.

2. For resize on drop, I  had a IConstraintHandler implementation in
ULCComponentGraphicalEditPart to contributSizeCommand() etc. The
getAdapter() method of ULCComponentGraphicalEditpart used to return that
object.

In VE 1.2:

I now define:

1. ULCVEContainmentHandler extends AbstractComponentModelContainmentHandler
which is specified in override as :

  modelAdapterClassname="com.canoo.ulc.visualeditor/com.canoo.ulc.visualedi
tor.propertysheet.ULCVEContainmentHandler"

   This class now sets title on Frame, text on button etc. on drop on the
canvas.

2. Now when I resize on drop, VE expects this class to
contributeSizeCommand(). My old IConstraintHandler in
ULCComponetGraphicalEditPart is not called any more.

Question:

1.Should I now implement all the methods of IConstrainHandler in
ULCVEContainmentHandler?

Basically the same class implements IContainmentHandler and
IConstraintHandler. Is this correct?

2. What should I now return in ULCComponentGraphicalEditPart.getAdapter()
for IConstraintHandler?

Thanks and regards,

Janak

_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top