Re: [Thinlet-development] Latest documentation on widgets.
Brought to you by:
bajzat
From: Andrzej B. <ab...@ge...> - 2003-04-25 20:21:57
|
KD...@tw... wrote: > Is there documentation on the latest version of Thinlets 1.13. Something > that will tell me easily all the attributes for each widgets. The one that > I downloaded is way out of date. > > Please have a look at the end of Thinlet.java. There is a "private static Object[] dtd" there. As far as I understand it, it shows you the following: * component name * component parent * attributes: - attribute type - attribute name - mode for updating the contents - a bit mysterious to me... - default value (or enumeration of allowed choices) So, based on this structure, it is easy to figure out the proper DTD, and proper XML to use. If you take for example "button". The dtd section defines it as follows: ... "button", "label", new Object[][] { { "choice", "alignment", "validate", new String[] { "center", "left", "right" } }, { "method", "action", "", null }, { "choice", "type", "", new String[] { "normal", "default", "cancel" } } }, ... From this you can see that the formal DTD can be defined as follows: <!ELEMENT button EMPTY> <!ATTLIST button &label-attributes; alignment (center | left | right) "left" action CDATA #IMPLIED type (normal | default | cancel) "normal" > where &label-attributes; means to include all attributes defined for "label". Based on this DTD, it is now easy to construct proper XML: <button alignment="center" action="myAction" type="default"/> Now, a separate problem is to understand the semantics of the above example. For now I'm afraid you have to consult the source code... but as soon as the documentation is in CVS (Robert?), there are people willing to bring it up-to-date... BTW: in this case, the type="default" means that the button will be selected by default, and if you press Enter, the action="myAction" will be invoked. Pretty much what you would expect, but the default implementation doesn't handle it... -- Best regards, Andrzej Bialecki ------------------------------------------------- Software Architect, System Integration Specialist CEN/ISSS EC Workshop, ECIMF project chair EU FP6 E-Commerce Expert/Evaluator ------------------------------------------------- FreeBSD developer (http://www.freebsd.org) |