butler.swing.util
Class ValueEditorBroker

java.lang.Object
  extended by butler.swing.util.ValueEditorBroker

public class ValueEditorBroker
extends java.lang.Object

Singelton broker that can create value editors from a given datatype. If customer datatypes and/or editors is used, they must be registered in this broker.

Author:
Fredrik Bertilsson

Nested Class Summary
static class ValueEditorBroker.NoEditorFound
           
 
Constructor Summary
ValueEditorBroker()
           
ValueEditorBroker(boolean defaultFlag)
           
 
Method Summary
 ValueEditor createEditor(Datatype datatype)
           
 ValueEditor createEditor(Datatype datatype, java.lang.String style)
          Creates a value editor from a given datatype.
static ValueEditorBroker getInstance()
           
 void register(Datatype datatype, java.lang.Class clazz)
          Registers editor class with a given datatype.
 void register(Datatype datatype, ValueEditorFactory factory)
          Registers a given factory with a given datatype.
 void register(ValueEditorFactory factory)
          Registers a value editor factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueEditorBroker

public ValueEditorBroker(boolean defaultFlag)

ValueEditorBroker

public ValueEditorBroker()
Method Detail

getInstance

public static ValueEditorBroker getInstance()

register

public void register(Datatype datatype,
                     ValueEditorFactory factory)
Registers a given factory with a given datatype.


register

public void register(ValueEditorFactory factory)
Registers a value editor factory. Factories registered this way is used only if no factory is registered with a specific datatype.


register

public void register(Datatype datatype,
                     java.lang.Class clazz)
              throws java.lang.Exception
Registers editor class with a given datatype. The given class must have a constructor that takes a Datatype as argument.

Throws:
java.lang.Exception

createEditor

public ValueEditor createEditor(Datatype datatype,
                                java.lang.String style)
                         throws java.lang.Exception
Creates a value editor from a given datatype. Registered factories is used.

Throws:
java.lang.Exception

createEditor

public ValueEditor createEditor(Datatype datatype)
                         throws java.lang.Exception
Throws:
java.lang.Exception