// look for your custom property aspect
List<Aspect> aspects = getAspects(EObject
modelElement)
Property myCustomPropertyAspect = null;
String myCustomPropertyAspectId = "my.aspect.id"
for (Aspect aspect : aspects) {
if (myCustomPropertyAspectId.equals(aspect.getId())) {
myCustomPropertyAspect = (Property) aspect;
}
}
and
Property myCustomPropertyInstance =
AspectManager.INSTANCE.getAspectInstance(modelElement,
myCustomPropertyAspect)
or (if multiple or not autocreated)
Property myCustomPropertyInstance =
AspectManager.INSTANCE.createAndAddAspectInstance(myCustomPropertyAspect,
modelElement)
// set the value
myCustomPropertyInstance.setValue("wizard value");
// don't forget to save the model at the end of the
wizard, that will also save the custom properties
I created an Import Wizard, based on the
CreationWizard and WizardHelper classes. It
parses a non-OO file and generates a JWT model and
diagram. It works well. I also defined my own
properties via aspect, and I can save custom
properties, too (using the diagram editor, after
the wizard finishes).
I'd like to save the custom properties during the
wizard, and I'm trying to figure out how to
programmatically set the custom properties. I figure it should be
fairly easy. With a lot of the javadoc being
boilerplate, I'm struggling to understand what I
should do.
I tried looking for jwt-we-conf-model.editor-tests
in SVN, but I couldn't find it.