Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] Few questions please

Dear VE Team:

Many thanks for the help provided. Some more questions please:

---------------------------------------------------------------------
1. We are trying to define an EClass in an ecore file like the
ConstraintComponent Class (pl see the attachment):

a. How to create a JavaObjectInstance of this class?
   We looked up the code for ConstrainComponent but it is creating an
EObject.
   Is there a way to get a JavaObjectInstance or conver an EObject to
JavaObjectInstance?

b. The EClass has some SFs of type int. How do we specify int eType?

----------------------------------------------------------------------------
-
2. We have debugged the JPanel/BorderLayout/JButton code that generates the
expression:

	jPanel.add(getJButton(), Border.NORTH);

Two Commands are Created:

i. ApplyAttributeSettingCmd (which adds button to ConstraintComponent) by
setting the component SF of ConstraintComponent.

ii. VCEPresetCommand & ApplyAttributeSettingCommand commands which sets the
SF components of container JPanel and adds ConstraintComponent to JPanel.

We observed that for the 1st command no CodeGen adapters are called because
the "owner" ConstraintComponent is not notified  "if
(owner.eNotificationRequired())" while setting the SF "component" with the
child object (JButton). The stack trace is as follows:

EStructuralFeatureImpl$InternalSettingDelegateSingleEObjectResolving(EStruct
uralFeatureImpl$InternalSettingDelegateSingleEObject).dynamicSet(InternalEOb
ject, EStructuralFeature$Internal$DynamicValueHolder, int, Object) line:
2132
EObjectImpl(BasicEObjectImpl).eDynamicSet(EStructuralFeature, Object) line:
524
EObjectImpl(BasicEObjectImpl).eSet(EStructuralFeature, Object) line: 508
ApplyAttributeSettingCommand.execute() line: 70.

We would like to have a similar behaviour when we set SF "containment" on
our ULCComponent with a layout value object while we are adding it to a
conatiner. We would not like our ULCComponent to be notified while this SF
is being set. Is there a way to do this declaratively or through code?

At present whenever we try to set the SF "containment" on a ULCComponent
that is being added to a container, expressionDecoder is called. Since there
is no source to be generated we return null expression as a result of which
the SF is disposed() from the model.

We got over this by defining our own expressionDecoder and decoderHelper
that for SF "containment" returns null expression and marks the expression
as NO_SRC thus avoiding the dispose() of the SF from Model. See the code
snippet from AbstractExpressionDecoder.generate(EStructuralFeature,
Object[]) below:

	String result = null;
		try {
			result = fhelper.generate(args);
		} catch (CodeGenException e) {
		}

		if (fExprRef.isStateSet(CodeExpressionRef.STATE_NO_SRC)) {
			fhelper.adaptToCompositionModel(this);
			return result ;
		}

		if (result == null && !(fhelper instanceof SimpleAttributeDecoderHelper))
{
			// Specialized decoder may not be applicable, try a vanilla one
			fhelper = new SimpleAttributeDecoderHelper(fbeanPart, fExpr,
fFeatureMapper, this);
			JavaVEPlugin.log("generate():  *Defaulting* to a SimpleAttr. Helper",
Level.FINE); //$NON-NLS-1$
			result = fhelper.generate(args);
		}

		if (result != null) {
			fExprRef.setState(CodeExpressionRef.STATE_EXIST, true);
			fExprRef.setState(CodeExpressionRef.STATE_IN_SYNC, true);
			fhelper.adaptToCompositionModel(this);
		} else {
			fExprRef.dispose();
		}
--------------------------------------------------------------

3. In reply to our question about probable release date for VE 1.0 you
mentioned that you are wrapping it up. Could you please tell us the probable
date of release? It will help us to plan the release date of ULC VE for
Eclipse 3.0.

-------------------------------------------------------------------

Many thanks,

Janak

Attachment: boxPaneContainment.ecore
Description: Binary data


Back to the top