+Suggestion:
Add namespaces to Swixml renderings. Basically, this means that
SwingEngine would get additional new render() methods that would add a
"String namespace" argument. Likewise, a new find() method would be
added to allow component lookup based upon the namespace and the
component's ID. Similar changes would be made to other SwingEngine methods.
For backwards compatibility, existing render() methods would create
place components in a namespace named something like "global" or
"unnamed" or something. The existing find() method could either look
exclusively in the "global" namespace, or in all namespaces (the latter
is probably preferable, given the existing allComponentIterator() and
such). SwingEngine would therefore contain a list of namespaces, each
namespace containing a map of (id, component) instead of just one map of
(id, component).
+Benefits:
Multiple documents can be rendered even if they contain components with
the same ID.
+Downfalls:
?Adds some processing time to find()?
+Background:
I want to separate fully my model, view, and controller. My view is
nicely separated with Swixml (or any of the other XULs). Right now, my
controller logic must have intimate knowledge of the view in order to
bind listeners to the view. I want to bind listeners from an external
file--i.e. I want to create a binding language. My goal is to create
bindings between logical tasks and Listeners using something like
Netscape's XBL, then use CSS to connect elements in the Swixml files to
methods in the XBL-like file. In order to do this, I need to be able to
look up objects based upon the file that defines them. Adding the above
to Swixml would allow me to look up objects in exactly this manner.
Besides, I think it adds a nice bit of flexibility to Swixml without
adding much if any to the complexity.