org.progeeks.meta.swing
Class FactoryRegistry

java.lang.Object
  extended by org.progeeks.meta.swing.FactoryRegistry

public class FactoryRegistry
extends java.lang.Object

Creates specific types of MetaPropertyEditors. This is both a base class and a simple implementation that can delegate to other factories.

Version:
$Revision: 1.41 $
Author:
Paul Speed

Constructor Summary
FactoryRegistry()
           
FactoryRegistry(FactoryRegistry parent)
           
 
Method Summary
 void addForm(MetaForm form)
          Adds a MetaForm that will be registered to its associated MetaClass.
 void addForm(MetaForm form, MetaFormFlavor flavor)
          Adds a MetaForm that will be registered to its associated MetaClass and flavor.
 MetaObjectUI createMetaObjectEditor(MetaClass type)
          Creates an editor for the specified type that can be used to edit a single MetaObject instance.
 MetaObjectUI createMetaObjectEditor(MetaClass type, ViewContext parentContext)
          Creates an editor for the specified type that can be used to edit a single MetaObject instance.
 MetaObjectUI createMetaObjectRenderer(MetaClass type)
          Creates a renderer for the specified type that can be used to render a single MetaObject instance.
 MetaObjectUI createMetaObjectRenderer(MetaClass type, ViewContext parentContext)
          Creates a renderer for the specified type that can be used to render a single MetaObject instance.
 MetaPropertyEditor createPropertyEditor(MetaClass type)
          Creates an editor for the specified type.
 MetaPropertyEditor createPropertyEditor(MetaClass type, ViewContext parentContext)
          Creates an editor for the specified type.
 MetaPropertyEditor createPropertyEditor(PropertyType type)
          Creates an editor for the specified type.
 MetaPropertyEditor createPropertyEditor(PropertyType type, ViewContext parentView)
          Creates an editor for the specified type.
 MetaPropertyRenderer createPropertyRenderer(MetaClass type)
          Creates a renderer for the specified type.
 MetaPropertyRenderer createPropertyRenderer(MetaClass type, ViewContext parentContext)
          Creates a renderer for the specified type.
 MetaPropertyRenderer createPropertyRenderer(PropertyType type)
          Creates a renderer for the specified type.
 MetaPropertyRenderer createPropertyRenderer(PropertyType type, ViewContext parentContext)
          Creates a renderer for the specified type.
 MetaForm getForm(MetaClass type)
          Returns a form containing suitable fields for viewing/editing the specified MetaClass.
 MetaForm getForm(MetaClass type, MetaFormFlavor flavor)
          Returns a form containing suitable fields for viewing/editing the specified MetaClass in the specified "flavor".
 MetaForm getForm(PropertyType type)
          Returns a form containing suitable fields for viewing/editing the specified PropertyType.
 MetaForm getForm(PropertyType type, MetaFormFlavor flavor)
          Returns a form containing suitable fields for viewing/editing the specified PropertyType in the specified "flavor".
 FormatRegistry getFormatRegistry()
          Returns this factory registry's format registry.
 void registerDefaultEditorFactory(java.lang.Class type, EditorFactory factory)
          Registers an editor factory to deal with a specific base type.
 void registerDefaultRendererFactory(java.lang.Class type, RendererFactory factory)
          Registers a renderer factory to deal with a specific base type.
protected  void registerDefaults()
          Used to register a default set of factories.
 void registerEditorFactory(MetaClass type, EditorFactory factory)
          Registers an editor factory to deal with a specific meta-class.
 void registerEditorFactory(PropertyType type, EditorFactory factory)
          Registers an editor factory to deal with a specific property type.
 void registerRendererFactory(MetaClass type, RendererFactory factory)
          Registers a renderer factory to deal with a specific meta-class.
 void registerRendererFactory(PropertyType type, RendererFactory factory)
          Registers a renderer factory to deal with a specific property type.
 void setFormatRegistry(FormatRegistry reg)
          Sets the format registry that will be used to resolve formatters for types without specific renderers or editors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryRegistry

public FactoryRegistry()

FactoryRegistry

public FactoryRegistry(FactoryRegistry parent)
Method Detail

registerDefaults

protected void registerDefaults()
Used to register a default set of factories.


registerEditorFactory

public void registerEditorFactory(PropertyType type,
                                  EditorFactory factory)
Registers an editor factory to deal with a specific property type.


registerEditorFactory

public void registerEditorFactory(MetaClass type,
                                  EditorFactory factory)
Registers an editor factory to deal with a specific meta-class.


registerDefaultEditorFactory

public void registerDefaultEditorFactory(java.lang.Class type,
                                         EditorFactory factory)
Registers an editor factory to deal with a specific base type.


registerRendererFactory

public void registerRendererFactory(PropertyType type,
                                    RendererFactory factory)
Registers a renderer factory to deal with a specific property type.


registerRendererFactory

public void registerRendererFactory(MetaClass type,
                                    RendererFactory factory)
Registers a renderer factory to deal with a specific meta-class.


registerDefaultRendererFactory

public void registerDefaultRendererFactory(java.lang.Class type,
                                           RendererFactory factory)
Registers a renderer factory to deal with a specific base type.


createPropertyEditor

public MetaPropertyEditor createPropertyEditor(PropertyType type)
Creates an editor for the specified type. Null is returned if an appropriate editor could not be created.


createPropertyEditor

public MetaPropertyEditor createPropertyEditor(PropertyType type,
                                               ViewContext parentView)
Creates an editor for the specified type. Null is returned if an appropriate editor could not be created.


createPropertyEditor

public MetaPropertyEditor createPropertyEditor(MetaClass type)
Creates an editor for the specified type. Null is returned if an appropriate editor could not be created.


createPropertyEditor

public MetaPropertyEditor createPropertyEditor(MetaClass type,
                                               ViewContext parentContext)
Creates an editor for the specified type. Null is returned if an appropriate editor could not be created.


createPropertyRenderer

public MetaPropertyRenderer createPropertyRenderer(PropertyType type)
Creates a renderer for the specified type. Null is returned if an appropriate renderer could not be created.


createPropertyRenderer

public MetaPropertyRenderer createPropertyRenderer(PropertyType type,
                                                   ViewContext parentContext)
Creates a renderer for the specified type. Null is ret urned if an appropriate renderer could not be created.


createPropertyRenderer

public MetaPropertyRenderer createPropertyRenderer(MetaClass type)
Creates a renderer for the specified type. Null is returned if an appropriate renderer could not be created.


createPropertyRenderer

public MetaPropertyRenderer createPropertyRenderer(MetaClass type,
                                                   ViewContext parentContext)
Creates a renderer for the specified type. Null is returned if an appropriate renderer could not be created.


createMetaObjectEditor

public MetaObjectUI createMetaObjectEditor(MetaClass type)
Creates an editor for the specified type that can be used to edit a single MetaObject instance.


createMetaObjectEditor

public MetaObjectUI createMetaObjectEditor(MetaClass type,
                                           ViewContext parentContext)
Creates an editor for the specified type that can be used to edit a single MetaObject instance.


createMetaObjectRenderer

public MetaObjectUI createMetaObjectRenderer(MetaClass type)
Creates a renderer for the specified type that can be used to render a single MetaObject instance.


createMetaObjectRenderer

public MetaObjectUI createMetaObjectRenderer(MetaClass type,
                                             ViewContext parentContext)
Creates a renderer for the specified type that can be used to render a single MetaObject instance.


setFormatRegistry

public void setFormatRegistry(FormatRegistry reg)
Sets the format registry that will be used to resolve formatters for types without specific renderers or editors.


getFormatRegistry

public FormatRegistry getFormatRegistry()
Returns this factory registry's format registry.


addForm

public void addForm(MetaForm form)
Adds a MetaForm that will be registered to its associated MetaClass.


addForm

public void addForm(MetaForm form,
                    MetaFormFlavor flavor)
Adds a MetaForm that will be registered to its associated MetaClass and flavor.


getForm

public MetaForm getForm(MetaClass type)
Returns a form containing suitable fields for viewing/editing the specified MetaClass. Returns an IdentityForm if no specific form has been registered for the class.


getForm

public MetaForm getForm(MetaClass type,
                        MetaFormFlavor flavor)
Returns a form containing suitable fields for viewing/editing the specified MetaClass in the specified "flavor". Returns an IdentityForm if no specific form has been registered for the class.


getForm

public MetaForm getForm(PropertyType type)
Returns a form containing suitable fields for viewing/editing the specified PropertyType. The property type should be a MetaClassPropertyType to make any sense but is not specifically typed here for reasons of API symmetry.


getForm

public MetaForm getForm(PropertyType type,
                        MetaFormFlavor flavor)
Returns a form containing suitable fields for viewing/editing the specified PropertyType in the specified "flavor". The property type should be a MetaClassPropertyType to make any sense but is not specifically typed here for reasons of API symmetry.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.