Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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?

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.

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?

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.


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

The only way I find out about such changes is by testing to see if something
is broken.

Thanks and regards,

Janak




Back to the top