Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] Override and Inheritance

Hi Rich,


Yes, we have a different model as far as ULCFrame is concerned - we don't
have explicit content pane in the model at present and we allow only one
component in a ULCFrame (hence the upperbound 1 for "components" SF of
ULCRootPane).


>I don't remember changing anything. Merging of features from two different
components was done by the
>BeanPropertySourceAdapter for the component, wrappering those that came
from a different component.

Does this mean that if two classes in the hierarchy had the same SF (e.g.
"components" in our case) then both of them will be added to the model?

Can you suggest where should I set breakpoints to debug?

We are specifying mergeIntrospection= false in ULCContainer.override as
follows:

<eAnnotations mergeIntrospection="false"
xsi:type="org.eclipse.jem.internal.beaninfo.beaninfo:PropertyDecorator"/>

What does it mean? Should we be setting mergeIntrospection in
ULCRootPane.override? If so to what?

Thanks and regards,

Janak

-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Rich Kulp
Sent: Saturday, November 18, 2006 3:30 AM
To: Discussions people developing code for the Visual Editor project
Subject: Re: [ve-dev] Override and Inheritance



Hi,

I don't know. You're doing something different than what we do. We show the
root pane (actually content pane) as a separate child of the frame. So there
is no "components" on the JFrame, just the content pane. Then "components"
is on the content pane.

I don't remember changing anything. Merging of features from two different
components was done by the BeanPropertySourceAdapter for the component,
wrappering those that came from a different component.

Rich


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx
11/17/2006 04:41 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] Override and Inheritance







Hi Rich,

Thanks for your help.

I have another question:

We have the following hierarchy:

ULCFrame extends ULCWindow extends ULCRootPane extends ULCContainer

Bean ULCContainer has an attribute "components".

In addition, in ULCContainer.override we have a StructuralFeature
"components" with upperBound -1:

<objectsToAttach changeable="true" containment="false" eType="ecore:EClass
java:/com.ulcjava.base.application#ULCComponent" name="components"
unsettable="false" upperBound="-1" xmi:id="_eStructuralFeatures"
xsi:type="ecore:EReference">
                                   <eAnnotations hidden="true"
xsi:type="org.eclipse.ve.internal.cde.decorators:PropertyDescriptorDecorator
"/>
        <eAnnotations linkType="CHILD"
xsi:type="org.eclipse.ve.internal.jcm:BeanFeatureDecorator"/>
                                   <eAnnotations mergeIntrospection="false"
xsi:type="org.eclipse.jem.internal.beaninfo.beaninfo:PropertyDecorator"/>
   </objectsToAttach>
</change:ChangeDescription>


In ULCRootPane.override we have a StructuralFeature "components" with
upperBound 1:

<objectsToAttach changeable="true" containment="false" eType="ecore:EClass
java:/com.ulcjava.base.application#ULCComponent" name="components"
unsettable="false" upperBound="1" xmi:id="_eStructuralFeatures"
xsi:type="ecore:EReference">
                                  <eAnnotations hidden="true"
xsi:type="org.eclipse.ve.internal.cde.decorators:PropertyDescriptorDecorator
"/>
       <eAnnotations linkType="CHILD"
xsi:type="org.eclipse.ve.internal.jcm:BeanFeatureDecorator"/>
   </objectsToAttach>
<objectsToAttach name="menuBar" unsettable="true"
xmi:id="_eStructuralFeatures1" xsi:type="ecore:EReference">
     <eAnnotations linkType="CHILD"
xsi:type="org.eclipse.ve.internal.jcm:BeanFeatureDecorator"/>
   </objectsToAttach>
</change:ChangeDescription>


In VE 1.1, ULCFrame's IJavaObjectInstance had two structural features with
name "components" - one from ULCContainer (bean's attribute) and one from
ULCRootPane ("components" SF in override).

While in VE 1.2, ULCFrame's IJavaObjectInstance has only one structural
feature with name "components" - one from ULCContainer (bean's attribute).
The one from ULCRootPane ("components" SF in override) is missing.

Is the handling of beans and merging of overrides changed in VE 1.2? Should
I specify something more in ULCRootPane.override so that its "components" SF
will be added to ULCFrame?

Thanks and regards,

Janak



-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Rich Kulp
Sent: Friday, November 17, 2006 9:11 PM
To: ve-dev@xxxxxxxxxxx
Subject: 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)) {
                                                                  IExpressi
on 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

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



Back to the top