Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] AbstractContainerAddDecoderHelper




------------
Dr. Gili Mendel
IBM
Software Development
RTP Raleigh, NC
(919)543 6408, tie: 441 6408



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

12/05/2005 08:15 AM

Please respond to
Discussions people developing code for the Visual Editor project

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





Hi VE Team,

AbstractContainerAddDecoderHelper class has changed between VE 1.0 and VE
1.1.

ULC VE does not use this class but copies its behavior when adding
components to a container.

In VE 1.1, the above class's decode() method calls addComponent().

In this method, the added component is obtained by parsing the code (e.g.
panel.add(getButton());)

1. Could you please explain what is "smart decoding" and shouldCommit() ?
 Should we also implement ( or copy) this code?


> "smart decode" is a term we use in snippet analysis.  If code has changed (offset, spaces, formattting and such),
> we used to always reDrive the decoder and update the model.
> This caused the target VM to remove/add that node and caused the GUI
> to fliker.
>
> "smart decode" is where a decoder determines if the "changed code" really needs to updathe the model.  
>  If not, that it will not do anyting.

2. Could you please explain the following code:

  EObject referencedInstance = null;

                                 clearOtherReferencesIfNeeded();

                                 if (fAddedPart != null){
                                                  fAddedPart.addToJVEModel();
                                                  referencedInstance = fAddedPart.getEObject();
                                 }else{
                                                  fbeanPart.getInitMethod().getCompMethod().getProperties().add(fAddedInsta
nce);
                                                  referencedInstance = fAddedInstance;
                                 }

                                 // Update list of references for this _expression_
                                 List references = fOwner.getExprRef().getReferences();
                                 if(referencedInstance!=null && !references.contains(referencedInstance))
                                                  references.add(referencedInstance);

This code seems to be new.


>  The CodeMethodRef.addExpressionToSortedList() is the guys that determines where will a new _expression_ (that is added)
>  will be placed withing the init-method.   In 1.1, it will also look at inter dependencies.  i.e., if an
>  _expression_ Ex references bean B, Ex will be place After the decleration/init  _expression_
>  of B.  Hence, a decoder now will collect All of the beans it is
>  dependant on.

3. In VE 1.0, in decode() I was adding the child object to the model by
setting the relevant structural feature
of the container e.g.:

                CodeGenUtil.eSet(fbeanPart.getEObject(), fFmapper.getFeature(null),
fChildBeanPart.getEObject(), -1);

This was about it.

The setting of "_expression_ references Bean" relation ship seems to be new.
Is that so?


> In 1.1 that "value" that you set for that feature (fChildBeanPart) may be a dependency.... Assume that you have an instance
> variable for a Color, C.  If you X.setBackgroundColor(C), than this _expression_ is dependant on the C instance
> and can not come before C is constructed.
>

I found this out the hard way. Scenario:

1. Drop Table, drop a column in table - works as expected.

2. Do a refresh/reload - the model does not show column, columnBean is
unreferenced and has been deactivated.


>
> When you press the reload button, VE will not use the cache, and will do a complete reverse parse.
> Need to have more information to understand the problem; is the code all there/
>

Could you please give some hints about other such major changes in the
CodeGen/_expression_ Decoder?


> Smart decode and references, is the main sementic changes.




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


Back to the top