Hi Eric
You've been too quick for me here ;)
Anyway, congrats !
& I've improved the doc so that your experience can help other
people :
http://wiki.eclipse.org/JWT_Metamodel_Extension#How_to_programmatically_set_custom_properties_.28or_any_other_aspect.29
Regards,
Marc
Le 27/04/2011 15:49, Eric Phetteplace a écrit :
Never mind :) I didn't have the node added to the
module, yet. As soon as I added it, the aspects were available.
Thanks again for your help!
On Wed, Apr 27, 2011 at 9:36 AM, Eric
Phetteplace <eric.phetteplace@xxxxxxxxx>
wrote:
I'm sorry, on the last part, I omitted
that the node is:
node = ProcessesFactoryImpl.init().createAction();
On Wed, Apr 27, 2011 at 9:35 AM,
Eric Phetteplace <eric.phetteplace@xxxxxxxxx>
wrote:
Hi Marc,
I'm very close:) Perhaps you have an idea on what I'm
missing, here?
I created my model:
org.eclipse.jwt.meta.model.core.Model rootPackage =
CoreFactory.eINSTANCE.createModel();
I add it to the Resource, so the
ConfeModelResourceManager can load:
fileResource.getContents().add(rootPackage);
further along:
ConfModel
newlyLoadedConfModel =
ConfModelResourceManager.INSTANCE.loadConfModelOfModel(rootPackage,
true);
That results in the following console messages, but
the file is created at this point. The last instance
of the message is not in red, so I'm assuming it's not
really severe, as stated:
org.eclipse.jwt.we.conf.model.resource.internal.ConfModelResourceManagerImpl
handleResourceLoadingError
SEVERE: ConfModel resource doesn't exist for
ConfModel file
platform:/resource/jwt-1-0-test/workflows/test2.workflow_conf
while looking for expected ConfModel of model
platform:/resource/jwt-1-0-test/workflows/test2.workflow
I successfully get my Profile:
Profile arcaProfile = null;
for (Profile p:
ConfRegistry.INSTANCE.getInstalledProfiles()) {
if(p.getName().equals("com.gotarca.jwt.we.view.callflow.aspect"))
arcaProfile = p;
}
Is this correct?
AspectManager.INSTANCE.activateProfile(newlyLoadedConfModel,
arcaProfile);
The problem, here, is that aspects is always an empty
list:
List<Aspect>
aspects = AspectManager.INSTANCE.getAspects(node);
Thanks for your help!
Eric
|