Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jwt-dev] Importing to JWT Custom Aspect Properties

You're welcome, keep me in touch.

And a warm welcome to the JWT community !


Le 26/04/2011 14:29, Eric Phetteplace a écrit :
Great, thanks!

From studying the code, this all looks familiar.  I'll try this out in a few hours.


On Tue, Apr 26, 2011 at 5:46 AM, Marc Dutoo <marc.dutoo@xxxxxxxxxxx> wrote:
Hi Eric

You're right, some links have not been updated since we migrated to the SOA top level project ! I'm doing that right now.

In the meantime, I think you have to use AspectManager (in  ) which is the entry point to aspects, including custom properties, and
* if you didn't do it yet, define a profile describing on which model elements you want which custom properties (see the wiki at )
* activate this profile on your model (see )
* set the custom properties you want on the model elements they decorate, and finally save it all :

   // look for your custom property aspect
   List<Aspect> aspects = getAspects(EObject modelElement)
   Property myCustomPropertyAspect = null;
   String myCustomPropertyAspectId = ""
   for (Aspect aspect : aspects) {
      if (myCustomPropertyAspectId.equals(aspect.getId())) {
         myCustomPropertyAspect = (Property) aspect;

   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

& you can have a look at :
* which uses AspectManager in
* the logging sample in


Le 25/04/2011 17:41, Eric Phetteplace a écrit :

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.

Do you have any suggestions on how to do this? 



_______________________________________________ jwt-dev mailing list jwt-dev@eclipse.orgttps://

Back to the top