org.merlotxml.merlot
Class MerlotEditorFactory

java.lang.Object
  |
  +--org.merlotxml.merlot.MerlotEditorFactory

public class MerlotEditorFactory
extends java.lang.Object

Factory singleton to get editors for particular types of nodes and elements. This is the class that gets editor panels from plugins for whatever element type they want to handle. otherwise, this produces a generic Xml component editor


Field Summary
protected  MerlotDOMEditor _default
          The global default editor
protected  java.util.Hashtable _globalEditors
          Global editors as defined in the main application properties file with the key merlot.editor.classes
protected static MerlotEditorFactory _instance
          Singleton instance
 
Method Summary
 MerlotDOMEditor getEditor(java.lang.String nodeName, DTDPluginConfig config)
          This method gets an editor panel for a particular node.
static java.util.List getEditorClasses(java.lang.String classes, java.lang.ClassLoader loader)
          returns a list of editor panel classes loaded from the given classloader
static MerlotEditorFactory getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_instance

protected static MerlotEditorFactory _instance
Singleton instance

_globalEditors

protected java.util.Hashtable _globalEditors
Global editors as defined in the main application properties file with the key merlot.editor.classes

_default

protected MerlotDOMEditor _default
The global default editor
Method Detail

getEditorClasses

public static java.util.List getEditorClasses(java.lang.String classes,
                                              java.lang.ClassLoader loader)
returns a list of editor panel classes loaded from the given classloader
Returns:
a List of MerlotDOMEditor instances or null

getInstance

public static MerlotEditorFactory getInstance()

getEditor

public MerlotDOMEditor getEditor(java.lang.String nodeName,
                                 DTDPluginConfig config)
                          throws java.lang.InstantiationException,
                                 java.lang.IllegalAccessException
This method gets an editor panel for a particular node. This checks for a custom editor provided by a dtd plugin, a custom global editor, a default editor provided by the dtd plugin in that order. Failing any of those, the system default editor is returned.
Parameters:
nodeName - the name of the node (should not be null)
node - the node that's going to be edited (can be null)
plugin - optional plugin (can be null)
Returns:
a panel for editing this particular node or node type