|
Re: Manipulating GmfMap from Ecore2GMF [message #639252 is a reply to message #639194] |
Mon, 15 November 2010 18:18 |
|
I'm using something like this to remove Feature Label Mappings myself, starting from the name of the Diagram Label:
var diagLabels = findDiagramLabelsByName(diagramLabelName);
var labelMappings = findLabelMappingsByDiagramLabels(diagLabels);
for (labelMapping in labelMappings) {
if (labelMapping.isDefined()) {
delete labelMapping;
}
}
Basically, first you find the diagram labels by their name, and then look for the label mappings which include those labels. Once you have those, you can just delete them. I can't quite remember now why I checked that they were defined first, though: maybe it's not necessary.
You'll need these two operations:
operation findDiagramLabelsByName(labelName : String) : Collection {
return GmfGraph!DiagramLabel.all.select(r|r.name = labelName);
}
operation findLabelMappingsByDiagramLabels(diagramLabels : Collection) : Collection {
return GmfMap!LabelMapping.all.select(r|diagramLabels.includes(r.diagramLabel));
}
|
|
|
|
|
Re: Manipulating GmfMap from Ecore2GMF [message #639664 is a reply to message #639660] |
Wed, 17 November 2010 11:54 |
|
I also find the EPackage Registry view (part of Epsilon, IIRC) quite useful: you can inspect the structure of a registered metamodel without having to create an instance at all. Do not forget to hit "Refresh" after you open it: it is initially empty.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03237 seconds