hi,
I would like to create multiple windows.
That's why I need a scope for each window..
But it doesen't work.
I think the getScope function will not be called.
I hope you can help me. Is the getScope function correct?
Here is my gui-dsl:
DomainModel:
(elements+=PackageDeclaration);
PackageDeclaration:
'package' name=QualifiedName '{'
elements+=Window*
'}';
QualifiedName:
ID ('.' ID)*;
Window:
'window' name=ID '{'
& 'sizeX' sizeX = INTEGER & 'sizeY' sizeY = INTEGER & ('title' title = STRING)? &
((tabContainer=TabContainer) | (panel+=Panel)+)
'}'
;
public IScope getScope(Window w, EReference eRef) {
// Go to graph root
EObject root = w;
while(root.eContainer() != null) {
root = root.eContainer();
}
// Traverse whole model-graph and save Containers to List
List<Container> container = new ArrayList<Container>();
for(TreeIterator<EObject> it = root.eAllContents(); it.hasNext();) {
EObject o = it.next();
if(o instanceof Container) {
container.add((Container)o);
}
}
return scopeFor(container);
}
[Updated on: Tue, 20 December 2011 00:06]
Report message to a moderator