<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text" indent="no"/>
<xsl:preserve-space elements="*"/>

<xsl:template match="keyval">/*----------------------------------------------------------------
 * AUTOMATICALLY GENERATED FROM XML - DO NOT EDIT!
 * 
 * (c) 2004 - Vaisala */
//----------------------------------------------------------------

package <xsl:value-of select="(@package)"/>;

import com.ccg.values.*;

//----------------------------------------------------------------
/** &#60;p&#62;A {@link ValuesEditor} implementation for the <xsl:value-of select="(@class)"/> objects.&#60;/p&#62;
 *
 * &#60;p&#62;This class is automatically generated from a XML document
 * which defines the configuration entries used by the application.&#60;/p&#62; */
//----------------------------------------------------------------

public class <xsl:value-of select="(@class)"/>ValuesEditor extends ValuesEditorBean {

  //----------------------------------------------------------------
  /** &#60;p&#62;Constructor for the <xsl:value-of select="(@class)"/>ValuesEditor class.&#60;/p&#62; */
  //----------------------------------------------------------------

  public <xsl:value-of select="(@class)"/>ValuesEditor() throws InstantiationException, IllegalAccessException {
    super(<xsl:value-of select="(@class)"/>.class);
  }

  //----------------------------------------------------------------
  /** Allows one to invoke the editor from the command line.
   * 
   * &#60;p&#62;This method allows one to try out the editor directly by
   * issuing the following on the command line:&#60;/p&#62;
   *
   * &#60;pre&#62;
   * java com.glatmos.lp.cfg.<xsl:value-of select="(@class)"/>ValuesEditor
   * &#60;/pre&#62;
   * 
   * @param	args
   * 
   * 	Array of command line arguments (which we ignore).
   * 
   * @since	1.0 */
  //----------------------------------------------------------------

  public static void main(String[] args) {
    try {
      if (false) {
        ValuesFactoryTree vft = new ValuesFactoryTree();
        Object o = new <xsl:value-of select="(@class)"/>();
        ValuesEditor ve = new <xsl:value-of select="(@class)"/>ValuesEditor();
        ValuesConfig vc = new <xsl:value-of select="(@class)"/>ValuesConfig();
        vft.add(o.toString(),ve,vc,o);

        javax.swing.JFrame frame = new javax.swing.JFrame(o.toString()+" Config Editor");
        frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
        frame.setContentPane(vft.getComponent());
        frame.pack();
        frame.show();
      } else {
	ValuesConfigModel vcm = new ValuesConfigModel();
	vcm.setValuesConfigClass(<xsl:value-of select="(@class)"/>ValuesConfig.class);
	ValuesConfigEditor vce = new ValuesConfigEditor();
	vce.setModel(vcm);
	vce.setEditor(new <xsl:value-of select="(@class)"/>ValuesEditor());
	vce.setButtons(ValuesConfigEditor.ALL_BUTTONS);
	try {
	  vce.selectAndLoad("default");
        } catch (Exception e) { }
        vce.showDialog("<xsl:value-of select="(@class)"/> Config Editor",true);
	System.exit(0);
      }

    } catch (Throwable t) {
      t.printStackTrace();
    }
  }
}
</xsl:template>

</xsl:stylesheet>
