Closed GoogleCodeExporter closed 8 years ago
Another question is, if I want to use the widget in the toolbar the
"SketchDomainModel"-Class should known all the widget class in ecore, is it?
Original comment by dowbar2...@googlemail.com
on 2 Apr 2013 at 8:45
Hi Dowbar,
you can actually structure your domain model this way:
SketchDomainModel
* tabs : Tab [0..*]
* pages : Page [0..*]
* widgets : Widget [0..*]
* subWidgets : Widget [0..*]
* Toolbar extends Widget
* Button extends Widget
In Spray you define the mapping this way:
diagram spray for SketchDomainModel style SprayDefaultStyle
class Tab icon "ecore/EClass.gif" {
shape TabShape {
reference pages into tabCompartment
}
behavior {
create into tabs palette "Container";
}
}
class Page icon "ecore/EClass.gif" {
shape PageShape {
reference widgets into pageCompartment
}
behavior {
create palette "Container";
}
}
class Toolbar icon "ecore/EClass.gif" {
shape ToolbarShape {
reference subWidgets into toolbarCompartment
}
behavior {
create palette "Widget";
}
}
class Button icon "ecore/EClass.gif" {
shape ButtonShape {
name into buttonID
}
behavior {
create palette "Widget";
}
}
You see, you only have to leave off the "into ..." part. Adding a button to a
toolbar inside the diagram will add the button domain object to the subWidgets
of the toolbar domain object as the mapping definition for Toolbar states
"reference subWidgets into ...".
Best regards,
Joerg
Original comment by de.abg.r...@gmail.com
on 7 Apr 2013 at 1:48
Original issue reported on code.google.com by
dowbar2...@googlemail.com
on 2 Apr 2013 at 8:37Attachments: