| Re: [pmf-dev] [Wazaabi] Introduce dataObject attribute |
On 28.04.10 12.29, Olivier Moïses wrote:I noticed the Context class, but didn't realize it had this purpose. I can see that this is a useful design. The drawback is that it's difficult to listen to (all) changes that affect a specific widget, since such a change can happen in many places:
A such mechanism exists already in wazaabi. In the core metamodel, the
runtime package owns Context which is an interface implemented by Widget.
The Context has a content which a transient collection on
ContextContent. The ContextContet is a key/value pair.
- the key of a ContextContent can change
- the value of a ContextContent can change
- a set of ContextContent-objects in a Context can change
- these changes can happen at any point above a widget
Perhaps you have implemented a kind of adapter that helps you listen to the Context and ContextContent objects?
BTW, the Context looks and feels like a Map. I think EMF has a way of actually generating a map implementation, see http://wiki.eclipse.org/EMF/FAQ#How_do_I_create_a_Map_in_EMF.3FIn TM, the ResourceSet containing the TM model could also contain a data resource. The top-level object of this resource was automatically set as the dataObject of the top-level TM container. This would then trigger a script attached to this object, that would set the dataObject of contained widgets (containers and controls). This would propagate down to the leaf nodes of the hiearchy. Of course, there would also be scripts that set visible features like text and icon, selected element etc. based on the dataObject. Fairly simple, put powerful. I think this indicates a difference between TM and Wazaabi: TM utilizes scripting for many purposes (event-handling, databinding, ...), while Wazaabi provide more special-purpose and declarative mechanisms.
The missing point, at the moment, is a mechanism (based on annotation)
which 'fills' the context at runtime when the UI is (first) displayed.
Hallvard
_______________________________________________
pmf-dev mailing list
pmf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pmf-dev