com.jaxfront.core.ui
Class TypeVisualizerFactory

java.lang.Object
  extended by com.jaxfront.core.ui.TypeVisualizerFactory
Direct Known Subclasses:
JavaSwingFactory

public abstract class TypeVisualizerFactory
extends java.lang.Object

Factory to create GUI widgets (Visualizers) for any kind of JAXFront types.

Version:
1.60

Field Summary
static Type WILDCARD_TYPE
           
 
Method Summary
static Visualizer buildRecursionView(Type recType, Type context)
          Creates recursion
 void cacheVisualizer(Type type, Type context, Visualizer vis)
          Cache the passing visualizer for the passing type.
 void cacheVisualizer(Type type, Visualizer visualizer)
          Cache the passing visualizer for the passing type.
abstract  Visualizer createRecursiveView(Type type, Type context)
          Creates a recursive view for a AbstractCompositeType.
abstract  Visualizer createView(ComplexGroupList type, Type context)
          Creates a visualizer for a ComplexGroupList.
abstract  Visualizer createView(ComplexGroup type, Type context)
          Creates a visualizer for a ComplexGroup.
abstract  Visualizer createView(SimpleGroupList type, Type context)
          Creates a visualizer for a SimpleGroupList.
abstract  Visualizer createView(SimpleGroup type, Type context)
          Creates a visualizer for a SimpleGroup.
abstract  Visualizer createView(SimpleTypeList type, Type context)
          Creates a visualizer for a SimpleTypeList.
abstract  Visualizer createView(SimpleType type, Type context)
          Creates a visualizer for a SimpleType.
abstract  Visualizer createView(VirtualType type, Type context)
          Creates a visualizer for a virtual type.
 Visualizer createVisualizerFor(Type type, Type context)
           
 Visualizer createVisualizerFor(Type type, Type context, boolean createRecursionWrapper)
           
 java.util.Vector getAllVisualizers(Document dom)
           
 java.util.Vector getAllVisualizers(Type aType)
           
 java.util.Vector getAllVisualizers(java.util.Vector result, Type aType)
           
 java.lang.Object getClientProperty(java.lang.String key)
          Return a client property for the passing key.
 EditablePanel getEditor(Document DOM)
          Returns the cached top level editor for the passing DOM.
 Visualizer getFirstCachedVisualizer(Type type)
          Returns first cached visualizer for a given type (context less).
static TypeVisualizerFactory getInstance()
          Returns the single instance of this factory.
 Visualizer getPluginFor(Type type, Type context)
          Returns the plug-in (visualizer) for a type
 Visualizer getVisualizer(Type type)
          Returns the visualizer of a type.
 Visualizer getVisualizer(Type type, boolean lazyInit)
          Returns the visualizer of a type.
 Visualizer getVisualizer(Type aType, java.lang.String xPath)
          Returns the visualizer of a type.
 Visualizer getVisualizer(Type type, Type context)
          Returns the visualizer of a type.
 Visualizer getVisualizer(Type type, Type context, boolean lazyInit)
          Returns the visualizer of a type.
 Visualizer getVisualizer(Type type, Type context, boolean lazyInit, boolean usePlugin)
          Returns the visualizer of a type.
 Visualizer getVisualizerMapping(java.lang.String className, Type type, Type context)
           
 java.util.Hashtable getVisualizers(Document DOM)
           
 java.util.Vector getVisualizerStructure(Visualizer vis, boolean includingRoot)
           
static boolean isAvailableLookAndFeel(java.lang.String laf)
          A utility function that layers on top of the LookAndFeel's isSupportedLookAndFeel() method.
 void populateAllVisualizerForType(Type type)
           
 void populateView(Type aType)
           
 void putClientProperty(java.lang.String key, java.lang.Object value)
          Set any client property (value) for a key.
 EditablePanel registerEditor(Document DOM, EditablePanel editor)
          Register a top level editor for a DOM.
static void release()
          Releases the instance (singleton) of this class.
 void releaseCache()
          Release cach for all DOM's
 void releaseCache(CompositeType composite, Type context, boolean removePropertyChangeListener, boolean removeAllForType)
           
 void releaseCache(Document DOM)
          Release cache for the passing DOM.
 void releaseCache(Document DOM, boolean releaseEditor)
          Removes the given DOM from the visualizer list and virtualComponents.
 void releaseCache(ListType list, Type context, boolean removePropertyChangeListener, boolean removeAllForType)
           
 void releaseCache(Type type)
          Removes all cached visualizers of a type.
 void releaseCache(Type type, Type context, boolean removeAllForType)
          Removes the cached visualizer of a type.
 void releaseCache(Type type, Type context, boolean removePropertyChangeListener, boolean removeAllForType)
          Removes the cached visualizer of a type.
 void releaseCache(Visualizer cachedVisualizer, Type type, Type context, boolean removePropertyChangeListener, boolean removeAllForType)
           
 void removeVisualizerStructure(Type visType, boolean includeRoot)
           
 void removeVisualizerStructure(Visualizer vis, boolean includeRoot)
           
 Visualizer resolveVisualizer(Type type, Type context)
           
static TypeVisualizerFactory setInstance(TypeVisualizerFactory factory)
          Sets the single instance of a VisualizerFactory.
 java.lang.String toString(Document dom)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WILDCARD_TYPE

public static final Type WILDCARD_TYPE
Method Detail

getFirstCachedVisualizer

public Visualizer getFirstCachedVisualizer(Type type)
Returns first cached visualizer for a given type (context less).

Parameters:
type - to return visualizer for

toString

public java.lang.String toString(Document dom)

getAllVisualizers

public java.util.Vector getAllVisualizers(Type aType)

getAllVisualizers

public java.util.Vector getAllVisualizers(java.util.Vector result,
                                          Type aType)

getAllVisualizers

public java.util.Vector getAllVisualizers(Document dom)

createRecursiveView

public abstract Visualizer createRecursiveView(Type type,
                                               Type context)
Creates a recursive view for a AbstractCompositeType.

Parameters:
type - a recursive composite type

createView

public abstract Visualizer createView(ComplexGroup type,
                                      Type context)
Creates a visualizer for a ComplexGroup.

Parameters:
type - complex group to visualize

createView

public abstract Visualizer createView(ComplexGroupList type,
                                      Type context)
Creates a visualizer for a ComplexGroupList.

Parameters:
type - complex group list to visualize

createView

public abstract Visualizer createView(SimpleGroup type,
                                      Type context)
Creates a visualizer for a SimpleGroup.

Parameters:
type - simple group to visualize

createView

public abstract Visualizer createView(SimpleGroupList type,
                                      Type context)
Creates a visualizer for a SimpleGroupList.

Parameters:
type - simple group list to visualize

createView

public abstract Visualizer createView(SimpleType type,
                                      Type context)
Creates a visualizer for a SimpleType.

Parameters:
type - simple type to visualize

createView

public abstract Visualizer createView(SimpleTypeList type,
                                      Type context)
Creates a visualizer for a SimpleTypeList.

Parameters:
type - simple type list to visualize

createView

public abstract Visualizer createView(VirtualType type,
                                      Type context)
Creates a visualizer for a virtual type.

Parameters:
type - virtual type to visualize

createVisualizerFor

public Visualizer createVisualizerFor(Type type,
                                      Type context)

getInstance

public static TypeVisualizerFactory getInstance()
Returns the single instance of this factory.


setInstance

public static TypeVisualizerFactory setInstance(TypeVisualizerFactory factory)
Sets the single instance of a VisualizerFactory.

Parameters:
factory - to set as singleton

getPluginFor

public Visualizer getPluginFor(Type type,
                               Type context)
                        throws PluginException
Returns the plug-in (visualizer) for a type

Parameters:
type - a type for which its defined plug-in should be returned
Returns:
the visualizer (plug-in) for a type
Throws:
PluginException - if no plug-in exists for the given type or any error occured while rendering that type

getVisualizer

public Visualizer getVisualizer(Type type)
Returns the visualizer of a type.

Parameters:
type - a type for creating a visualizer

getVisualizer

public Visualizer getVisualizer(Type aType,
                                java.lang.String xPath)
Returns the visualizer of a type.

Parameters:
type - a type for creating a visualizer

getVisualizer

public Visualizer getVisualizer(Type type,
                                Type context)
Returns the visualizer of a type.

Parameters:
type - a type for creating a visualizer
context - the type that holds the desired visualizer

getVisualizer

public Visualizer getVisualizer(Type type,
                                boolean lazyInit)
Returns the visualizer of a type. If lazyInit is true then the visualizer will be created if it has not already been created before, otherwise the visualizer will not be created.

Parameters:
type - a type for creating a visualizer
lazyInit - defines if the visualizer should be created initially or not

getVisualizer

public Visualizer getVisualizer(Type type,
                                Type context,
                                boolean lazyInit)
Returns the visualizer of a type. If lazyInit is true then the visualizer will be created if it has not already been created before, otherwise the visualizer will not be created.

Parameters:
type - a type for creating a visualizer
context - the context of the visualizer that should be generated
lazyInit - defines if the visualizer should be created initially or not

getVisualizer

public Visualizer getVisualizer(Type type,
                                Type context,
                                boolean lazyInit,
                                boolean usePlugin)
Returns the visualizer of a type. If lazyInit is true then the visualizer will be created if it has not already been created before, otherwise the visualizer will not be created.

Parameters:
type - a type for creating a visualizer
context - a type that acts as viewHolder for the given type
lazyInit - defines if the visualizer should be created initially or not

cacheVisualizer

public void cacheVisualizer(Type type,
                            Visualizer visualizer)
Cache the passing visualizer for the passing type.

Parameters:
type - to create unique cache key
visualizer - view to cache

getVisualizers

public java.util.Hashtable getVisualizers(Document DOM)

release

public static void release()
Releases the instance (singleton) of this class.


releaseCache

public void releaseCache(Document DOM)
Release cache for the passing DOM.

Parameters:
DOM - to release cache

releaseCache

public void releaseCache()
Release cach for all DOM's


releaseCache

public void releaseCache(Document DOM,
                         boolean releaseEditor)
Removes the given DOM from the visualizer list and virtualComponents.

Parameters:
DOM - the DOM that should be removed

releaseCache

public void releaseCache(Type type)
Removes all cached visualizers of a type.

Parameters:
type - a type for which its cached visualizer will be removed

releaseCache

public void releaseCache(Type type,
                         Type context,
                         boolean removeAllForType)
Removes the cached visualizer of a type.

Parameters:
type - a type for which its cached visualizer will be removed
context - the context of the visualizer that should be released from cache

releaseCache

public void releaseCache(Type type,
                         Type context,
                         boolean removePropertyChangeListener,
                         boolean removeAllForType)
Removes the cached visualizer of a type.

Parameters:
type - a type for which its cached visualizer will be removed
context - the context of the visualizer that should be released from cache
removePropertyChangeListener - removes the propertyChangeListener that was added to this view

releaseCache

public void releaseCache(Visualizer cachedVisualizer,
                         Type type,
                         Type context,
                         boolean removePropertyChangeListener,
                         boolean removeAllForType)

releaseCache

public void releaseCache(ListType list,
                         Type context,
                         boolean removePropertyChangeListener,
                         boolean removeAllForType)

releaseCache

public void releaseCache(CompositeType composite,
                         Type context,
                         boolean removePropertyChangeListener,
                         boolean removeAllForType)

getEditor

public EditablePanel getEditor(Document DOM)
Returns the cached top level editor for the passing DOM.

Parameters:
DOM - to lookup if a top level editor exists

registerEditor

public EditablePanel registerEditor(Document DOM,
                                    EditablePanel editor)
Register a top level editor for a DOM.

Parameters:
DOM - to cache the editor
editor - top level editor

putClientProperty

public void putClientProperty(java.lang.String key,
                              java.lang.Object value)
Set any client property (value) for a key.

Parameters:
key - to keep property
value - client property

getClientProperty

public java.lang.Object getClientProperty(java.lang.String key)
Return a client property for the passing key.

Parameters:
key - to look up

isAvailableLookAndFeel

public static boolean isAvailableLookAndFeel(java.lang.String laf)
A utility function that layers on top of the LookAndFeel's isSupportedLookAndFeel() method. Returns true if the LookAndFeel is supported. Returns false if the LookAndFeel is not supported and/or if there is any kind of error checking if the LookAndFeel is supported. The L&F menu will use this method to detemine whether the various L&F options should be active or inactive.


populateView

public void populateView(Type aType)

resolveVisualizer

public Visualizer resolveVisualizer(Type type,
                                    Type context)

cacheVisualizer

public void cacheVisualizer(Type type,
                            Type context,
                            Visualizer vis)
Cache the passing visualizer for the passing type.

Parameters:
type - to create unique cache key
context - the context of the visualizer that should be released from cache
visualizer - view to cache

getVisualizerMapping

public Visualizer getVisualizerMapping(java.lang.String className,
                                       Type type,
                                       Type context)

populateAllVisualizerForType

public void populateAllVisualizerForType(Type type)

removeVisualizerStructure

public void removeVisualizerStructure(Type visType,
                                      boolean includeRoot)

removeVisualizerStructure

public void removeVisualizerStructure(Visualizer vis,
                                      boolean includeRoot)

getVisualizerStructure

public java.util.Vector getVisualizerStructure(Visualizer vis,
                                               boolean includingRoot)

buildRecursionView

public static Visualizer buildRecursionView(Type recType,
                                            Type context)
Creates recursion


createVisualizerFor

public Visualizer createVisualizerFor(Type type,
                                      Type context,
                                      boolean createRecursionWrapper)