Thread: [Ejtools-cvs] CVS: libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors XmlBooleanEditor.ja
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-05 20:22:25
|
Update of /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors In directory usw-pr-cvs1:/tmp/cvs-serv10705/xmlweb/src/main/net/sourceforge/ejtools/xml/editors Modified Files: XmlBooleanEditor.java XmlIntegerEditor.java XmlLongEditor.java XmlObjectNameEditor.java XmlPropertyEditor.java XmlPropertyEditorManager.java XmlPropertyEditorSupport.java XmlStringEditor.java Log Message: Add some JavaDocs Index: XmlBooleanEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlBooleanEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlBooleanEditor.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlBooleanEditor.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 8,19 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public class XmlBooleanEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlBooleanEditor() { --- 8,21 ---- /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public class XmlBooleanEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlBooleanEditor() { Index: XmlIntegerEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlIntegerEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlIntegerEditor.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlIntegerEditor.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 8,19 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public class XmlIntegerEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlIntegerEditor() { --- 8,21 ---- /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public class XmlIntegerEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlIntegerEditor() { *************** *** 22,25 **** } } - --- 24,26 ---- Index: XmlLongEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlLongEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlLongEditor.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlLongEditor.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 8,19 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public class XmlLongEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlLongEditor() { --- 8,21 ---- /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public class XmlLongEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlLongEditor() { *************** *** 22,25 **** } } - --- 24,26 ---- Index: XmlObjectNameEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlObjectNameEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlObjectNameEditor.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlObjectNameEditor.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 7,19 **** package net.sourceforge.ejtools.xml.editors; /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public class XmlObjectNameEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlObjectNameEditor() { --- 7,24 ---- package net.sourceforge.ejtools.xml.editors; + import javax.management.ObjectName; + + /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public class XmlObjectNameEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlObjectNameEditor() { *************** *** 22,25 **** } } - --- 27,29 ---- Index: XmlPropertyEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlPropertyEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlPropertyEditor.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlPropertyEditor.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 10,24 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public interface XmlPropertyEditor { /** ! * Setter for the value attribute * ! * @param value The new value */ public void setValue(Object value); --- 10,26 ---- /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public interface XmlPropertyEditor { /** ! * Setter for the value attribute * ! * @param value The new value */ public void setValue(Object value); *************** *** 26,32 **** /** ! * Setter for the asText attribute * ! * @param text The new value */ public void setAsText(String text); --- 28,34 ---- /** ! * Setter for the asText attribute * ! * @param text The new value */ public void setAsText(String text); *************** *** 34,40 **** /** ! * Getter for the asText attribute * ! * @return The value */ public String getAsText(); --- 36,42 ---- /** ! * Getter for the asText attribute * ! * @return The value */ public String getAsText(); *************** *** 42,48 **** /** ! * Getter for the tags attribute * ! * @return The value */ public String[] getTags(); --- 44,50 ---- /** ! * Getter for the tags attribute * ! * @return The value */ public String[] getTags(); *************** *** 50,56 **** /** ! * Description of the Method * ! * @return Description of the Returned Value */ public boolean supportsCustomRenderer(); --- 52,58 ---- /** ! * Description of the Method * ! * @return Description of the Returned Value */ public boolean supportsCustomRenderer(); *************** *** 58,64 **** /** ! * Getter for the customRenderer attribute * ! * @return The value */ public XmlComponent getCustomRenderer(); --- 60,66 ---- /** ! * Getter for the customRenderer attribute * ! * @return The value */ public XmlComponent getCustomRenderer(); Index: XmlPropertyEditorManager.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlPropertyEditorManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlPropertyEditorManager.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlPropertyEditorManager.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 9,48 **** import java.util.Hashtable; /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public class XmlPropertyEditorManager { ! private static String searchPath[] = {"com.etiemble.xml.editors"}; private static Hashtable registry; /** ! * Setter for the editorSearchPath attribute * ! * @param path The new value */ ! public static synchronized void setEditorSearchPath(String path[]) { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! { ! sm.checkPropertiesAccess(); ! } ! if (path == null) { ! path = new String[0]; } ! searchPath = path; } /** ! * Getter for the editorSearchPath attribute * ! * @return The value */ public static synchronized String[] getEditorSearchPath() --- 9,62 ---- import java.util.Hashtable; + import javax.management.ObjectName; + /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public class XmlPropertyEditorManager { ! /** Description of the Field */ private static Hashtable registry; + /** Description of the Field */ + private static String searchPath[] = {"com.etiemble.xml.editors"}; /** ! * Description of the Method * ! * @param targetType Description of Parameter ! * @return Description of the Returned Value */ ! public static synchronized XmlPropertyEditor findXmlEditor(Class targetType) { ! initialize(); ! Class xmlEditorClass = (Class) registry.get(targetType); ! if (xmlEditorClass != null) { ! try ! { ! Object o = xmlEditorClass.newInstance(); ! return (XmlPropertyEditor) o; ! } ! catch (Exception ex) ! { ! System.err.println("Couldn't instantiate type editor \"" + xmlEditorClass.getName() + "\" : " + ex); ! } } ! ! // We couldn't find a suitable Editor. ! return null; } /** ! * Getter for the editorSearchPath attribute * ! * @return The value */ public static synchronized String[] getEditorSearchPath() *************** *** 59,66 **** /** ! * Description of the Method * ! * @param targetType Description of Parameter ! * @param xmlEditorClass Description of Parameter */ public static void registerXmlEditor(Class targetType, Class xmlEditorClass) --- 73,80 ---- /** ! * Description of the Method * ! * @param targetType Description of Parameter ! * @param xmlEditorClass Description of Parameter */ public static void registerXmlEditor(Class targetType, Class xmlEditorClass) *************** *** 84,119 **** /** ! * Description of the Method * ! * @param targetType Description of Parameter ! * @return Description of the Returned Value */ ! public static synchronized XmlPropertyEditor findXmlEditor(Class targetType) { ! initialize(); ! Class xmlEditorClass = (Class) registry.get(targetType); ! if (xmlEditorClass != null) { ! try ! { ! Object o = xmlEditorClass.newInstance(); ! return (XmlPropertyEditor) o; ! } ! catch (Exception ex) ! { ! System.err.println("Couldn't instantiate type editor \"" + xmlEditorClass.getName() + "\" : " + ex); ! } } ! // We couldn't find a suitable Editor. ! return null; } /** ! * Description of the Method * ! * @param targetType Description of Parameter ! * @param name Description of Parameter */ private static synchronized void load(Class targetType, String name) --- 98,143 ---- /** ! * Setter for the editorSearchPath attribute * ! * @param path The new value */ ! public static synchronized void setEditorSearchPath(String path[]) { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) { ! sm.checkPropertiesAccess(); } + if (path == null) + { + path = new String[0]; + } + searchPath = path; + } ! ! /** Description of the Method */ ! private static synchronized void initialize() ! { ! if (registry != null) ! { ! return; ! } ! registry = new java.util.Hashtable(); ! ! load(Integer.TYPE, "XmlIntegerEditor"); ! load(Long.TYPE, "XmlLongEditor"); ! load(Boolean.TYPE, "XmlBooleanEditor"); ! load(java.lang.String.class, "XmlStringEditor"); ! ! load(javax.management.ObjectName.class, "XmlObjectNameEditor"); } /** ! * Description of the Method * ! * @param targetType Description of Parameter ! * @param name Description of Parameter */ private static synchronized void load(Class targetType, String name) *************** *** 136,157 **** // This shouldn't happen. System.err.println("load of " + xmlEditorName + " failed"); - } - - - /** Description of the Method */ - private static synchronized void initialize() - { - if (registry != null) - { - return; - } - registry = new java.util.Hashtable(); - - load(Integer.TYPE, "XmlIntegerEditor"); - load(Long.TYPE, "XmlLongEditor"); - load(Boolean.TYPE, "XmlBooleanEditor"); - load(java.lang.String.class, "XmlStringEditor"); - - load(javax.management.ObjectName.class, "XmlObjectNameEditor"); } } --- 160,163 ---- Index: XmlPropertyEditorSupport.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlPropertyEditorSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlPropertyEditorSupport.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlPropertyEditorSupport.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 11,101 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public class XmlPropertyEditorSupport implements XmlPropertyEditor { ! /** Description of the Field */ protected XmlEditor renderer = new XmlEditor(); ! /** Description of the Field */ protected Object value = null; ! /** Constructor for use by derived PropertyEditor classes. */ public XmlPropertyEditorSupport() { } /** ! * Setter for the value attribute * ! * @param value The new value for value attribute */ ! public void setValue(Object value) { ! this.value = value; ! renderer.setText("" + this.value); } /** ! * Setter for the asText attribute * ! * @param value The new value */ ! public void setAsText(String value) { ! if (value instanceof String) ! { ! setValue(value); ! renderer.setText(value); ! return; ! } ! throw new java.lang.IllegalArgumentException(value); } /** ! * Getter for the asText attribute * ! * @return The value of asText attribute */ ! public String getAsText() { ! if (value instanceof String) ! { ! return (String) value; ! } ! return ("" + value); } /** ! * Getter for the tags attribute * ! * @return The value of tags attribute */ ! public String[] getTags() { ! return null; } /** ! * Getter for the customRenderer attribute * ! * @return The value */ ! public XmlComponent getCustomRenderer() { ! return renderer; } /** ! * Description of the Method * ! * @return Description of the Returned Value */ public boolean supportsCustomRenderer() --- 11,103 ---- /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public class XmlPropertyEditorSupport implements XmlPropertyEditor { ! /** Description of the Field */ protected XmlEditor renderer = new XmlEditor(); ! /** Description of the Field */ protected Object value = null; ! /** Constructor for use by derived PropertyEditor classes. */ public XmlPropertyEditorSupport() { } /** ! * Getter for the asText attribute * ! * @return The value of asText attribute */ ! public String getAsText() { ! if (value instanceof String) ! { ! return (String) value; ! } ! return ("" + value); } /** ! * Getter for the customRenderer attribute * ! * @return The value */ ! public XmlComponent getCustomRenderer() { ! return renderer; } /** ! * Getter for the tags attribute * ! * @return The value of tags attribute */ ! public String[] getTags() { ! return null; } /** ! * Setter for the asText attribute * ! * @param value The new value */ ! public void setAsText(String value) { ! if (value instanceof String) ! { ! setValue(value); ! renderer.setText(value); ! return; ! } ! throw new java.lang.IllegalArgumentException(value); } /** ! * Setter for the value attribute * ! * @param value The new value for value attribute */ ! public void setValue(Object value) { ! this.value = value; ! renderer.setText("" + this.value); } /** ! * Description of the Method * ! * @return Description of the Returned Value */ public boolean supportsCustomRenderer() Index: XmlStringEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/xmlweb/src/main/net/sourceforge/ejtools/xml/editors/XmlStringEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XmlStringEditor.java 20 Apr 2002 11:42:21 -0000 1.1 --- XmlStringEditor.java 5 May 2002 20:22:23 -0000 1.2 *************** *** 8,19 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 */ public class XmlStringEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlStringEditor() { --- 8,21 ---- /** ! * Description of the Class * ! * @author letiembl ! * @created 26 février 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public class XmlStringEditor extends XmlPropertyEditorSupport { ! /** Constructor */ public XmlStringEditor() { *************** *** 22,25 **** } } - --- 24,26 ---- |