Review for config.xml
Anakreon <[email protected]> Tue, 06 Jul 2004 01:01:27 +0300
| Newsgroups | gmane.comp.java.luxor-xul.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------030605080806060403000300
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hello all.
I'd like to know your opinion on the current configuration for the code generation process.
The file attached, describes the tags which the generated XulManager will recognize, and the attributes
and css attributes the element supports. I hope the syntax is understandable, and there are some
comments included.
The configuration was based on the xul.dtd file, and the code of the corresponding *Def and *Peer source files.
The dtd seems to be out of sync, because some elements like progressmeter are not defined. Note that I have
defined few css style attributes for each element.I only included those attributes which are used by the
*Def and *Peer classes. If you think that more attributes should be supported, please let me know.
Also, you could test how the generated classes behave in producing the UI.
Download the sources via CVS from the module luxor2 and after compiling run a modified version
of the shell script attached.
I'm looking forward for your opinion.
Anakreon.
--------------030605080806060403000300
Content-Type: text/xml;
name="config.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="config.xml"
<config>
<!--
Each tag or css attribute has a name and optionally a type.
If type is not defined, then it is assumed to be String.
attribute tags supports a label, which is defines the name of the generated
methods and a required property. Furthermore, value should be defined for
attributes of alias tags, and default value can be defined also for other
tags.
-->
<!-- Define all known css attributes -->
<css name="width" type="int" />
<css name="min-height" type="int" />
<css name="max-height" type="int" />
<css name="min-width" type="int" />
<css name="max-width" type="int" />
<css name="height" type="int" />
<css name="margin" type="int" />
<css name="border" type="javax.swing.border.Border" />
<css name="padding" type="int" />
<css name="background" type="java.awt.Color" />
<css name="color" type="java.awt.Color" />
<css name="font" type="java.awt.Font" />
<css name="align" type="int" />
<css name="vertical-align" type="int" />
<css name="visibility" type="boolean" />
<!-- Define all known tag attributes -->
<attribute name="id" />
<attribute name="orient" type="int" />
<attribute name="flex" type="int" />
<attribute name="label" />
<attribute name="command" type="java.awt.event.ActionListener" />
<attribute name="tooltip" />
<attribute name="icon" type="javax.swing.ImageIcon" />
<attribute name="accesskey" type="int" />
<attribute name="group" type="javax.swing.ButtonGroup" />
<attribute name="href" />
<attribute name="target" />
<attribute name="checked" type="boolean" />
<attribute name="cols" type="int" />
<attribute name="value" />
<attribute name="rows" type="int" />
<attribute name="context" />
<attribute name="mask"
type="javax.swing.JFormattedTextField.AbstractFormatter" />
<attribute name="ind" type="javax.swing.JLabel" />
<attribute name="disable" type="boolean" />
<attribute name="sizemode" type="int" />
<attribute name="sort" type="boolean" />
<attribute name="colspan" type="int" />
<attribute name="rowspan" type="int" />
<attribute name="horz" type="int" />
<attribute name="vert" type="int" />
<attribute name="ref" />
<attribute name="src" />
<attribute name="title" />
<attribute name="list" type="java.util.List" />
<attribute name="map" type="java.util.Map" />
<attribute name="key" type="javax.swing.KeyStroke" />
<attribute name="keychar" />
<attribute name="datasource" />
<attribute name="keycode" />
<attribute name="maskchar" />
<attribute name="modifiers" />
<attribute name="type" />
<!--
each tag has attributes:
alias - if attribute name is not defined then the tag is just a placeholder
for common attributes, css attributes and children. If this is the case then
no other attributes can be defined for the tag. If attribute name is defined
then the tag is treated as an alias to an other tag.
name - The name of the tag (mandatory unless is placeholder).
extends - The tag which extends
type - The component type of the tag(mandatory unless is placeholder).
constructor - The method which creates an Object of the same type as the
tag's type.
Children of tag are:
attribute - defines an attribute the tag supports.
css - defines an css attribute the tag supports.
child - the name of a tag which can be nested inside this tag.
selectattr - defines cases where based on an attribute's value, different
components are created.
-->
<tag alias="core">
<attribute name="id" />
</tag>
<tag alias="container" extends="core">
<child name="box" />
<child name="vbox" />
<child name="hbox" />
<child name="groupbox" />
<child name="tabbox" />
<child name="grid" />
<child name="table" />
<child name="stack" />
<child name="deck" />
<child name="button" />
<child name="checkbox" />
<child name="label" />
<child name="textbox" />
<child name="textarea" />
<child name="choice" />
<child name="mchoice" />
<child name="password" />
<child name="separator" />
<child name="spacer" />
<!--
<child name="componentref" />
<child name="gadget" />
-->
<child name="image" />
<child name="iframe" />
<child name="datagrid" />
</tag>
<tag name="box" type="javax.swing.JPanel" extends="container">
<css name="color" />
<css name="background" />
<css name="border" />
<attribute name="orient" />
<attribute name="flex" />
</tag>
<tag name="hbox" alias="box">
<attribute name="orient" value="horizontal" />
</tag>
<tag name="vbox" alias="box">
<attribute name="orient" value="vertical" />
</tag>
<tag name="groupbox" extends="box" type="javax.swing.JPanel">
<attribute name="orient" default="vertical" />
<!-- Check this -->
<css name="border" default="lower_bevel_border" />
<child name="caption" />
</tag>
<tag name="caption" type="luxor.swing.StringWrapper" extends="core">
<attribute name="label" required="true"/>
</tag>
<!-- The JPanel should have a GridBagLayout -->
<tag name="grid" type="javax.swing.JPanel" extends="core"
constructor="getGridBagPanel">
<child name="columns" />
<child name="rows" />
</tag>
<tag name="columns" type="java.util.List" constructor="createList">
<child name="column" />
</tag>
<tag name="column" type="java.util.List" constructor="createList"
extends="container" />
<tag name="rows" type="java.util.List" constructor="createList">
<child name="row" />
</tag>
<tag name="row" type="java.util.List" constructor="createList"
extends="container" />
<!-- The JPanel should have a GridBagLayout -->
<tag name="table" type="javax.swing.JPanel" extends="core"
constructor="getGridBagPanel">
<attribute name="colspan" />
<attribute name="rowspan" />
<child name="tr" />
</tag>
<tag name="tr" type="java.util.List" constructor="createList">
<child name="td" />
</tag>
<tag name="td" type="java.util.List" constructor="createList" extends="container">
<attribute name="horz" />
<attribute name="vert" />
</tag>
<tag name="tabbox" type="javax.swing.JTabbedPane" extends="core">
<child name="tabs" />
<child name="tabpanels" />
</tag>
<tag name="tabs" type="javax.swing.JPanel">
<child name="tab" />
</tag>
<tag name="tab" type="luxor.swing.StringWrapper">
<attribute name="label" required="true" />
</tag>
<tag name="tabpanels" type="java.util.List" constructor="createList">
<child name="tabpanel" />
</tag>
<tag name="tabpanel" alias="box" />
<!-- layout should be StackLayout -->
<tag name="stack" type="javax.swing.JLayeredPane" extends="container"
constructor="getStackLayoutPanel">
<css name="color" />
<css name="background" />
<css name="border" />
</tag>
<!-- should have a CardLayout -->
<tag name="deck" type="javax.swing.JPanel" extends="box"
constructor="getCardLayoutPanel"/>
<tag name="window" type="javax.swing.JFrame" extends="container">
<css name="width" />
<css name="height" />
<attribute name="title" />
<attribute name="icon" />
<attribute name="sizemode" />
</tag>
<tag name="button" type="javax.swing.AbstractButton" extends="core">
<css name="font" />
<css name="color" />
<css name="background" />
<attribute name="label" required="true" />
<attribute name="command" />
<attribute name="icon" />
<attribute name="accesskey" />
<selectattr name="type">
<attrval value="radio" type="javax.swing.JRadioButton">
<attribute name="group" />
</attrval>
<attrval value="checkbox" type="javax.swing.JCheckBox" />
<attrval type="javax.swing.JButton">
<attribute name="href" />
<attribute name="target" />
</attrval>
</selectattr>
</tag>
<tag name="checkbox" type="javax.swing.JCheckBox" extends="core">
<css name="font" />
<css name="color" />
<css name="background" />
<attribute name="label" required="true" />
<attribute name="checked" />
</tag>
<tag name="choice" type="luxor.swing.Choise" extends="core">
<css name="font" />
<css name="color" />
<css name="background" />
<attribute name="orient" />
<attribute name="map" />
<attribute name="list" />
<attribute name="type" />
</tag>
<tag name="mchoice" type="luxor.swing.Choise" extends="choise"
constructor="createMChoise"/>
<tag name="label" type="javax.swing.JLabel" extends="core"
usecontent="true">
<css name="font" />
<css name="color" />
<css name="background" />
<css name="align" />
<css name="vertical-align" />
<!--
DTD says value is required attribute.
The box example however is full of label elements without value defined.
Besides, the label can use the content of the element as it's label
-->
<attribute name="value"/>
<attribute name="tooltip" />
</tag>
<tag name="password" type="javax.swing.JPasswordField" extends="core">
<css name="font" />
<css name="color" />
<css name="background" />
<attribute name="value" />
<attribute name="cols" />
</tag>
<tag name="separator" type="javax.swing.JSeparator">
<attribute name="orient" />
</tag>
<tag name="spacer" type="javax.swing.JLabel" extends="core" />
<tag name="textbox" type="javax.swing.JTextField" extends="core">
<css name="font" />
<css name="color" />
<css name="background" />
<css name="align" />
<attribute name="value" />
<attribute name="cols" />
<attribute name="ind" />
<selectattr name="mask">
<attrval notnull="true" type="javax.swing.JFormattedTextField">
<attribute name="mask" />
</attrval>
<attrval type="javax.swing.JTextField" />
</selectattr>
</tag>
<tag name="textarea" type="javax.swing.JTextArea" text="true" extends="core">
<css name="font" />
<css name="color" />
<css name="background" />
<attribute name="cols" />
<attribute name="rows" />
</tag>
<!--
<tag name="componentref" type="" extends="core" />
<tag name="gadget" type="" extends="core" />
-->
<tag name="image" type="javax.swing.JLabel" extends="core">
<css name="border" />
<attribute name="src" required="true" />
<attribute name="href" required="true" />
<attribute name="target" required="true" />
</tag>
<tag name="datagrid" type="javax.swing.JTable" extends="core">
<attribute name="datasource" required="true" />
</tag>
<tag name="iframe" type="javax.swing.JEditorPane" extends="core"
usecontent="true">
<attribute name="src" required="true" />
</tag>
<tag name="menubar" type="javax.swing.JMenuBar" extends="core">
<child name="menu" />
<child name="menuref" />
</tag>
<tag name="menu" type="javax.swing.JMenu" extends="core">
<attribute name="label" required="true" />
<attribute name="accesskey" />
<attribute name="icon" />
<child name="menupopup" />
</tag>
<tag name="menuref" type="javax.swing.JMenu" extends="core">
<attribute name="label" required="true" />
<attribute name="accesskey" />
<attribute name="icon" />
</tag>
<tag name="menupopup" type="javax.swing.JMenu">
<child name="menu" />
<child name="menuref" />
<child name="menuitem" />
</tag>
<tag name="menuitem" type="javax.swing.JMenuItem" extends="core">
<attribute name="label" required="true" />
<attribute name="command" />
<attribute name="accesskey" />
<attribute name="key" />
<attribute name="icon" />
<attribute name="href" />
<attribute name="target" />
<attribute name="disable" />
<selectattr name="type">
<attrval value="radio" type="javax.swing.JRadioButtonMenuItem">
<attribute name="checked" />
<attribute name="group" />
</attrval>
<attrval value="checkbox" type="javax.swing.JCheckBoxMenuItem">
<attribute name="checked" />
</attrval>
<attrval type="javax.swing.JMenuItem" />
</selectattr>
</tag>
<tag name="menuseparator" type="javax.swing.JSeparator" />
<tag name="popup" type="javax.swing.JPopupMenu" extends="core">
<child name="menu" />
<child name="menuref" />
<child name="menuitem" />
</tag>
<tag name="toolbar" type="javax.swing.JToolBar" extends="core">
<attribute name="orient" />
<child name="toolbarbutton" />
<child name="toolbarseparator" />
</tag>
<tag name="toolbarbutton" type="javax.swing.AbstractButton"
extends="core">
<css name="align" />
<css name="vertical-align" />
<attribute name="label" required="true" />
<attribute name="command" />
<attribute name="icon" />
<attribute name="tooltip" />
<attribute name="accesskey" />
<attribute name="disable" />
<selectattr name="type">
<attrval value="radio" type="javax.swing.JRadioButton">
<attribute name="checked" />
<attribute name="group" />
</attrval>
<attrval value="checkbox" type="javax.swing.JCheckBox">
<attribute name="checked" />
</attrval>
<attrval type="javax.swing.JButton" />
</selectattr>
</tag>
<tag name="toolbarseparator" type="javax.swing.JSeparator" />
<tag alias="coreid">
<attribute name="id" required="true" />
</tag>
<!-- Data -->
<tag name="map" type="java.util.Map" constructor="createMap"
extends="coreid">
<attribute name="sort" />
<child name="entry" />
</tag>
<tag name="list" type="java.util.List" constructor="createList"
extends="coreid">
<attribute name="sort" />
<child name="entry" />
</tag>
<tag name="entry" type="luxor.swing.EntryWrapper">
<attribute name="value" />
<attribute name="key" required="true" />
</tag>
<tag name="keyset" type="java.util.Map" constructor="createMap">
<child name="key" />
</tag>
<tag name="key" type="luxor.swing.KeyStrokeWrapper" extends="coreid">
<attribute name="keychar" label="key" />
<attribute name="modifiers" />
<attribute name="keycode" />
</tag>
<!--
<tag name="portal" type="" extends="coreid">
<child name="portlet" />
</tag>
<tag name="portlet" type="" extends="core" />
<tag name="anim" type="" extends="core">
<child name="icon" />
</tag>
<tag name="command" type="" extends="core" />
-->
<tag name="icon" type="javax.swing.ImageIcon" extends="coreid">
<attribute name="ref" required="true" />
</tag>
<!--
<tag name="mask" type="" extends="coreid">
<attribute name="mask" required="true" />
<attribute name="maskchar" />
<attribute name="type" />
</tag>
-->
<tag name="pre" type="javax.swing.JLabel" text="true" />
</config>
--------------030605080806060403000300
Content-Type: text/x-sh;
name="test.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.sh"
#!/bin/bash
PROJECT_PATH=lib/bsh.jar:\
lib/jdom-1.0-b8.jar:\
lib/commons-collections.jar:\
build/classes/:\
lib/commons-logging.jar:\
/home/e/code/java/aspParser/lib/log4j-1.2.7.jar
java -cp $PROJECT_PATH luxor.Test ~/tmp/ramses/src/chrome/$1
--------------030605080806060403000300--
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com