Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gui4j.core
Class Gui4jComponentManager  view Gui4jComponentManager download Gui4jComponentManager.java

java.lang.Object
  extended byorg.gui4j.core.Gui4jComponentManager
All Implemented Interfaces:
org.gui4j.exception.ErrorTags, java.io.Serializable

public final class Gui4jComponentManager
extends java.lang.Object
implements java.io.Serializable, org.gui4j.exception.ErrorTags

This class manages the different Gui4jComponents. The known components are defined by factory classes in an XML configuration file. The Gui4jComponentManager read an XML configuration file and instantiates the defined factory classes. Theses classes are used to extract the Gui4jComponent definition in given XML resource files.


Field Summary
private static java.lang.String ATTR_FactoryClass
           
static java.lang.String ELEMENT_Gui4jArg
           
static java.lang.String ELEMENT_Gui4jClassAlias
           
private static java.lang.String ELEMENT_Gui4jComponent
           
private static java.lang.String ELEMENT_Gui4jComponents
           
static java.lang.String ELEMENT_Gui4jDef
           
static java.lang.String ELEMENT_Gui4jInclude
           
static java.lang.String ELEMENT_Gui4jParam
           
static java.lang.String ELEMENT_Gui4jRef
           
static java.lang.String ELEMENT_Gui4jStyle
           
static java.lang.String ELEMENT_Gui4jStyleBegin
           
static java.lang.String ELEMENT_Gui4jStyleEnd
           
static java.lang.String ELEMENT_Gui4jView
           
static java.lang.String FIELD_Gui4jArgId
           
static java.lang.String FIELD_Gui4jArgParam
           
static java.lang.String FIELD_Gui4jClassAliasClass
           
static java.lang.String FIELD_Gui4jClassAliasName
           
static java.lang.String FIELD_Gui4jDefName
           
static java.lang.String FIELD_Gui4jDefValue
           
static java.lang.String FIELD_Gui4jIncludeAlias
           
static java.lang.String FIELD_Gui4jIncludeController
           
static java.lang.String FIELD_Gui4jIncludeRefresh
           
static java.lang.String FIELD_Gui4jIncludeURL
           
static java.lang.String FIELD_Gui4jParamId
           
static java.lang.String FIELD_Gui4jStyleBeginName
           
static java.lang.String FIELD_Gui4jStyleExtends
           
static java.lang.String FIELD_Gui4jStyleName
           
static java.lang.String FIELD_Gui4jViewDefaultButton
           
static java.lang.String FIELD_Gui4jViewTopComponent
           
private  Gui4jInternal mGui4j
           
private  Gui4jCallFactory mGui4jCallFactory
           
private  java.util.Map mGui4jComponentMap
           
private static org.apache.commons.logging.Log mLogger
           
private  boolean VALIDATE
           
 
Fields inherited from interface org.gui4j.exception.ErrorTags
EXCEPTION_OCCURED, PROGRAMMING_ERROR, PROGRAMMING_ERROR_illegal_access_exception, PROGRAMMING_ERROR_instantiation_exception, PROGRAMMING_ERROR_invocation_target_exception, PROGRAMMING_ERROR_method_ambiguous, PROGRAMMING_ERROR_method_not_found, PROGRAMMING_ERROR_parameter_null, RESOURCE_ERROR, RESOURCE_ERROR_access_type_not_compatible, RESOURCE_ERROR_access_unexpected_character, RESOURCE_ERROR_access_unexpected_end, RESOURCE_ERROR_access_value_type_not_defined, RESOURCE_ERROR_alias_already_defined, RESOURCE_ERROR_alias_class_not_found, RESOURCE_ERROR_alias_not_defined_in_path, RESOURCE_ERROR_alias_undefined, RESOURCE_ERROR_attribute_editable_defined, RESOURCE_ERROR_attribute_listEditable_defined, RESOURCE_ERROR_attribute_not_defined, RESOURCE_ERROR_double_DataConversionException, RESOURCE_ERROR_element_at_row_col_already_defined, RESOURCE_ERROR_gui4jComponent_already_defined, RESOURCE_ERROR_gui4jComponent_already_registered, RESOURCE_ERROR_gui4jComponent_not_defined, RESOURCE_ERROR_gui4jComponent_not_registered, RESOURCE_ERROR_int_DataConversionException, RESOURCE_ERROR_invalid_column, RESOURCE_ERROR_invalid_defaultButton, RESOURCE_ERROR_invalid_keystroke, RESOURCE_ERROR_invalid_row, RESOURCE_ERROR_invalid_url, RESOURCE_ERROR_jdom_exception, RESOURCE_ERROR_labelform_column_conflict, RESOURCE_ERROR_placement_must_contain_gui4jComponent, RESOURCE_ERROR_property_getter_type_incompatible, RESOURCE_ERROR_style_defined_twice, RESOURCE_ERROR_style_not_defined, RESOURCE_ERROR_tableLayout_invalid_col_row_str, RESOURCE_ERROR_type_not_compatible, RESOURCE_ERROR_unexpected_gui4jStyle_end, RESOURCE_ERROR_unknown_param, RESOURCE_ERROR_unknown_param_in_include
 
Constructor Summary
private Gui4jComponentManager(Gui4jInternal gui4j)
           
 
Method Summary
private  void analyzeDocument(org.dom4j.Document doc, java.net.URL configurationSource)
           
private  void analyzeDocument(java.util.Properties properties, java.net.URL configurationSource)
           
 void configure(java.net.URL configurationSource)
          Reads an XML file containing the set of defined Gui4jComponents
 Gui4jComponentFactory getGui4jComponentFactory(java.lang.String name)
          Returns the factory for the given component name
 java.util.Map getGui4jComponentMap()
          Returns the mGui4jComponentMap.
 java.util.Set getInstalledComponentNames()
           
static Gui4jComponentManager getNewInstance(Gui4jInternal gui4j)
          Returns always the same instance
private  void installComponent(org.dom4j.LElement e, java.net.URL configurationSource)
           
private  void installComponent(java.lang.String tag, java.lang.String className, java.net.URL configurationSource)
           
private  void installComponents(org.dom4j.LElement e, java.net.URL configurationSource)
           
private  void installComponents(java.util.Properties properties, java.net.URL configurationSource)
           
 boolean isRegistered(java.lang.String name)
          Checks if given component name is registered
private  void loadAll()
           
 void writeDTD(java.io.File outputFile)
          Writes the DTD for the set of configured Gui4jComponents to the specified file
 void writeDTD(java.io.PrintWriter out)
          Writes the DTD for the set of configured Gui4jComponents to the specified OutputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mLogger

private static final org.apache.commons.logging.Log mLogger

ELEMENT_Gui4jView

public static final java.lang.String ELEMENT_Gui4jView
See Also:
Constant Field Values

ELEMENT_Gui4jRef

public static final java.lang.String ELEMENT_Gui4jRef
See Also:
Constant Field Values

ELEMENT_Gui4jInclude

public static final java.lang.String ELEMENT_Gui4jInclude
See Also:
Constant Field Values

ELEMENT_Gui4jClassAlias

public static final java.lang.String ELEMENT_Gui4jClassAlias
See Also:
Constant Field Values

ELEMENT_Gui4jDef

public static final java.lang.String ELEMENT_Gui4jDef
See Also:
Constant Field Values

ELEMENT_Gui4jStyle

public static final java.lang.String ELEMENT_Gui4jStyle
See Also:
Constant Field Values

ELEMENT_Gui4jStyleBegin

public static final java.lang.String ELEMENT_Gui4jStyleBegin
See Also:
Constant Field Values

ELEMENT_Gui4jStyleEnd

public static final java.lang.String ELEMENT_Gui4jStyleEnd
See Also:
Constant Field Values

ELEMENT_Gui4jParam

public static final java.lang.String ELEMENT_Gui4jParam
See Also:
Constant Field Values

ELEMENT_Gui4jArg

public static final java.lang.String ELEMENT_Gui4jArg
See Also:
Constant Field Values

FIELD_Gui4jViewDefaultButton

public static final java.lang.String FIELD_Gui4jViewDefaultButton
See Also:
Constant Field Values

FIELD_Gui4jViewTopComponent

public static final java.lang.String FIELD_Gui4jViewTopComponent
See Also:
Constant Field Values

FIELD_Gui4jDefName

public static final java.lang.String FIELD_Gui4jDefName
See Also:
Constant Field Values

FIELD_Gui4jDefValue

public static final java.lang.String FIELD_Gui4jDefValue
See Also:
Constant Field Values

FIELD_Gui4jStyleName

public static final java.lang.String FIELD_Gui4jStyleName
See Also:
Constant Field Values

FIELD_Gui4jStyleExtends

public static final java.lang.String FIELD_Gui4jStyleExtends
See Also:
Constant Field Values

FIELD_Gui4jStyleBeginName

public static final java.lang.String FIELD_Gui4jStyleBeginName
See Also:
Constant Field Values

FIELD_Gui4jIncludeAlias

public static final java.lang.String FIELD_Gui4jIncludeAlias
See Also:
Constant Field Values

FIELD_Gui4jIncludeURL

public static final java.lang.String FIELD_Gui4jIncludeURL
See Also:
Constant Field Values

FIELD_Gui4jIncludeController

public static final java.lang.String FIELD_Gui4jIncludeController
See Also:
Constant Field Values

FIELD_Gui4jIncludeRefresh

public static final java.lang.String FIELD_Gui4jIncludeRefresh
See Also:
Constant Field Values

FIELD_Gui4jParamId

public static final java.lang.String FIELD_Gui4jParamId
See Also:
Constant Field Values

FIELD_Gui4jArgParam

public static final java.lang.String FIELD_Gui4jArgParam
See Also:
Constant Field Values

FIELD_Gui4jArgId

public static final java.lang.String FIELD_Gui4jArgId
See Also:
Constant Field Values

FIELD_Gui4jClassAliasName

public static final java.lang.String FIELD_Gui4jClassAliasName
See Also:
Constant Field Values

FIELD_Gui4jClassAliasClass

public static final java.lang.String FIELD_Gui4jClassAliasClass
See Also:
Constant Field Values

ELEMENT_Gui4jComponents

private static final java.lang.String ELEMENT_Gui4jComponents
See Also:
Constant Field Values

ELEMENT_Gui4jComponent

private static final java.lang.String ELEMENT_Gui4jComponent
See Also:
Constant Field Values

ATTR_FactoryClass

private static final java.lang.String ATTR_FactoryClass
See Also:
Constant Field Values

VALIDATE

private final boolean VALIDATE
See Also:
Constant Field Values

mGui4j

private final Gui4jInternal mGui4j

mGui4jCallFactory

private final Gui4jCallFactory mGui4jCallFactory

mGui4jComponentMap

private final java.util.Map mGui4jComponentMap
Constructor Detail

Gui4jComponentManager

private Gui4jComponentManager(Gui4jInternal gui4j)
Method Detail

getNewInstance

public static Gui4jComponentManager getNewInstance(Gui4jInternal gui4j)
Returns always the same instance


configure

public void configure(java.net.URL configurationSource)
Reads an XML file containing the set of defined Gui4jComponents


writeDTD

public void writeDTD(java.io.PrintWriter out)
Writes the DTD for the set of configured Gui4jComponents to the specified OutputStream


writeDTD

public void writeDTD(java.io.File outputFile)
              throws org.gui4j.exception.Gui4jException
Writes the DTD for the set of configured Gui4jComponents to the specified file


loadAll

private void loadAll()

getGui4jComponentFactory

public Gui4jComponentFactory getGui4jComponentFactory(java.lang.String name)
Returns the factory for the given component name


isRegistered

public boolean isRegistered(java.lang.String name)
Checks if given component name is registered


getInstalledComponentNames

public java.util.Set getInstalledComponentNames()

analyzeDocument

private void analyzeDocument(org.dom4j.Document doc,
                             java.net.URL configurationSource)

analyzeDocument

private void analyzeDocument(java.util.Properties properties,
                             java.net.URL configurationSource)

installComponents

private void installComponents(java.util.Properties properties,
                               java.net.URL configurationSource)

installComponents

private void installComponents(org.dom4j.LElement e,
                               java.net.URL configurationSource)

installComponent

private void installComponent(java.lang.String tag,
                              java.lang.String className,
                              java.net.URL configurationSource)

installComponent

private void installComponent(org.dom4j.LElement e,
                              java.net.URL configurationSource)

getGui4jComponentMap

public java.util.Map getGui4jComponentMap()
Returns the mGui4jComponentMap.