Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] CompositionProxyAdapter changes since 1.1


Hi,

You need to take a look at jfc.ComponentProxyAdapter's addToFreeForm and removeFromFreeForm. You shouldn't release any freeform stuff in a release. The removeFromFreeForm will tell you when you leaving the freeform.

We use something called an ffHost (FreeFormHost) to handle hosting a non-frame component on the free form.

Rich


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

11/16/2006 03:30 PM

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

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] CompositionProxyAdapter changes since 1.1





Hi Rich,

The problem:

Suppose I add a button to a frame. Then I drag the button out of the frame
on to the
canvas. The following happens:

1. The button loses the text that was set on it. The property sheet shows
the text but not the graphic on the canvas i.e. the model has the text
setting.
2. The graphic on the canvas is just and icon and not the image from Free
Form
3. I can no longer resize the button on the canvas
4. Refresh of canvas sets everything right.

On debugging I traced the problem to CompositionProxyAdapter.notifyChanged:

>>>>>>>>>
                case Notification.SET:
                                 if (isCompositionFeature(msg)) {
                                                  if (!CDEUtilities.isUnset(msg)) {
                                                                   IExpression _expression_ =
proxyDomain.getProxyFactoryRegistry().getBeanProxyFactory().createExpression
();
                                                                   try {
                                                                                    if (!msg.isTouch() && msg.getOldValue() != null)
                                                                                                     releaseSetting(msg.getOldValue(), _expression_, false);
                                                                                    Object newSetting = msg.getNewValue();
                                                                                    IInternalBeanProxyHost ib = (IInternalBeanProxyHost)
BeanProxyUtilities.getBeanProxyHost((IJavaInstance) newSetting);
                                                                                    ib.addToFreeForm(this);
                                                                                    initSetting(newSetting, _expression_, false)
>>>>>>>>>>>

In the above code,

ib.addToFreeForm : (this was not so in 1.1)
initSetting() : is called on MemeberContainerProxyAdapter instead of on
CompositionProxyAdapter itself.
This initSetting does:

                if (ib.isBeanProxyInstantiated())
                                 ib.releaseBeanProxy(_expression_);
                _expression_.createTry();
                ib.instantiateBeanProxy(_expression_);

In 1.1, ib.addToFreeForm was done after release and before
instantiateBeanProxy

I create an _expression_ to add component to free form in instantiateBeanProxy
only if addToFreeForm is true but releaseBeanProxy is setting it to false
and hence my code never creates that _expression_.

Could you please explain these changes in CompositionProxyAdapter?

1. Sequence of calls to addToFreeForm, releaseBeanProxy and
instantiateBeanProxy
2. MemberContainerProxyAdapter

Thanks and regards,

Janak







-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Rich Kulp
Sent: Wednesday, November 15, 2006 8:16 PM
To: Discussions people developing code for the Visual Editor project
Subject: RE: [ve-dev] IContainmentHandler and IConstraintHandler



Hi Janak,

Sorry but I have no idea.

It sounds more like a timing problem. If the model has it, then preset
should not be causing the problem. It could be the text was applied after
the image was gathered. Are you applying the text through an IExpression or
directly? In 1.2 everything should be going through the IExpression. It
could be that there is a problem in your code that when the text is set that
the ComponentAdapter is not written correctly to invalidate the component in
the adapter. That would normally cause a refresh of the image.

Rich


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx
11/14/2006 07:12 PM Please respond to
Discussions people developing code for the Visual Editor project
<ve-dev@xxxxxxxxxxx>

To"Discussions people developing code for the Visual Editor project"
<ve-dev@xxxxxxxxxxx>
cc<ve-dev-bounces@xxxxxxxxxxx>
SubjectRE: [ve-dev] IContainmentHandler and IConstraintHandler







Hi Rich,

Thanks. But I need to bother you some more (please bear with me).

Ok. I will have one ModelAdapter that implements both Containment and
Constrain handlers.

Now the problem I am facing:

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. The following happens:

1. The button loses the text that was set on it. The property sheet shows
the text but not the graphic on the canvas i.e. the model has the text
setting.
2. As a result its size shrinks.
3. I can no longer resize the button on the canvas

One difference I saw was the kind of commands that are generated when I drag
the child out of frame on to canvas:

In VE 1.1

CancelAttribute (Frame, SF: components)
ApplyAttribute   (BeanSubClassComposition, SF: components)
ApplyVisualInfo

In VE 1.2:

CancelAttribute (Frame, SF: components)
VCEPresetCommand    <<<<<
ApplyAttribute   (BeanSubClassComposition, SF: components)
ApplyVisualInfo


Could this VCEPreset be affecting the behaviour? I will have to figure out
why it is genearted?

Thanks and regards,

Janak

-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Rich Kulp
Sent: Wednesday, November 15, 2006 5:05 AM
To: Discussions people developing code for the Visual Editor project
Cc: Discussions people developing code for the Visual Editor project;
ve-dev-bounces@xxxxxxxxxxx
Subject: RE: [ve-dev] IContainmentHandler and IConstraintHandler



Hi Janak,

Not really. It is because there can only be ONE IModelAdapter on a type, so
you can't have one that is an IContainmentHandler and one that is an
IConstraintHandler.

Also you need two IConstraintHandler's, one is the IModelAdapter on the type
because at the time of dropping there is no editpart yet. It hasn't been
added yet. So we need to go somewhere to handle the constraint info. So we
go to the model adapter if it implements IConstraintHandler.

But once it is dropped, then the edit part will be consulted to return the
IConstraintHandler. That is because once it is dropped and active, then a
different set of methods will be called, and these may depend on the
editpart,or they may depend on the edit layout policy. So a very different
IConstraintHandler is used in that case.

Rich


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx
11/14/2006 06:15 PM Please respond to
Discussions people developing code for the Visual Editor project
<ve-dev@xxxxxxxxxxx>

To"Discussions people developing code for the Visual Editor project"
<ve-dev@xxxxxxxxxxx>
cc
SubjectRE: [ve-dev] IContainmentHandler and IConstraintHandler








Hi Rich,

Please ignore the previous mail. There is a correction.

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. The property sheet shows
the text but not the graphic on the canvas.
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

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

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

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


Back to the top