org.formaria.editor.project.pages.components
Class EditorRegisteredComponentFactory

java.lang.Object
  extended by org.formaria.registry.RegisteredComponentFactory
      extended by org.formaria.editor.project.pages.components.EditorRegisteredComponentFactory
All Implemented Interfaces:
ComponentConstructor, PackageHelper

public class EditorRegisteredComponentFactory
extends RegisteredComponentFactory
implements PackageHelper

An extension of the basic registered compopnent factory that stores and processes design time information about the components

Copyright (c) Formaria Ltd., 2002-2007

$Revision: 1.18 $

License: see License.txt


Field Summary
protected  ComponentHelper componentHelpers
           
protected  java.util.Hashtable<java.lang.String,java.net.URL> jarNames
           
protected  java.util.Hashtable<java.lang.String,java.lang.String> jarPaths
           
protected  XmlElement projectXml
           
 
Fields inherited from class org.formaria.registry.RegisteredComponentFactory
changeCounter, configFiles, currentProject, localChangeCounter, propertiesRegister, urlBase
 
Constructor Summary
EditorRegisteredComponentFactory(Project project)
           
 
Method Summary
 ComponentAdapter addComponentAdapter(java.lang.String owner, java.lang.String componentName, java.lang.String iconName, java.lang.String clazz, java.lang.String ui, boolean allowsChildren, java.net.URL[] urls, XmlElement xml)
          Create a new component adapter
 boolean addComponentEntry(XmlElement xml)
          Add a new registration of a component to the project's component registration.
static java.lang.String getComponentConfigFile(java.lang.String key)
          Get the name of the file that describes the registered components
 java.util.Hashtable getComponents()
           
 java.util.Hashtable getConfigFiles()
          Get the configuration files
 java.util.Hashtable<java.lang.String,java.lang.String> getJarPaths()
          Get the list of jar file paths/names
static java.io.File getStorageDirectory()
          Get the directory name to which the library will be extracted.
static java.lang.String getUserRegistrationFileName()
          Get the name of the user component registration
 void read()
          Read the component registry.
 void read(java.lang.String key, java.io.Reader reader)
          Read the component registry.
 void registerHelpers(ComponentHelper helpers)
          Register all the helpers for the package
static void setComponentConfigFile(java.lang.String key, java.lang.String configFile)
          Set the name of the file that describes the registered components
 
Methods inherited from class org.formaria.registry.RegisteredComponentFactory
addComponentAdapter, addConfigFile, addElement, addReflectionAdapter, checkRegistration, constructComponent, doRead, doRead, doRead, getComponentAdapter, read, setPackageName, update, updateConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jarPaths

protected java.util.Hashtable<java.lang.String,java.lang.String> jarPaths

jarNames

protected java.util.Hashtable<java.lang.String,java.net.URL> jarNames

componentHelpers

protected ComponentHelper componentHelpers

projectXml

protected XmlElement projectXml
Constructor Detail

EditorRegisteredComponentFactory

public EditorRegisteredComponentFactory(Project project)
Method Detail

getComponents

public java.util.Hashtable getComponents()

getJarPaths

public java.util.Hashtable<java.lang.String,java.lang.String> getJarPaths()
Get the list of jar file paths/names


addComponentAdapter

public ComponentAdapter addComponentAdapter(java.lang.String owner,
                                            java.lang.String componentName,
                                            java.lang.String iconName,
                                            java.lang.String clazz,
                                            java.lang.String ui,
                                            boolean allowsChildren,
                                            java.net.URL[] urls,
                                            XmlElement xml)
                                     throws java.lang.ClassNotFoundException
Create a new component adapter

Throws:
java.lang.ClassNotFoundException

registerHelpers

public void registerHelpers(ComponentHelper helpers)
Description copied from interface: PackageHelper
Register all the helpers for the package

Specified by:
registerHelpers in interface PackageHelper
Parameters:
helpers - the container for the registered helpers

getConfigFiles

public java.util.Hashtable getConfigFiles()
Get the configuration files

Returns:

getComponentConfigFile

public static java.lang.String getComponentConfigFile(java.lang.String key)
Get the name of the file that describes the registered components

Returns:
the file name of the component config file

setComponentConfigFile

public static void setComponentConfigFile(java.lang.String key,
                                          java.lang.String configFile)
Set the name of the file that describes the registered components

Parameters:
configFile - the file name of the component config file

read

public void read()
Read the component registry. The format is described in the components.xsd schema.

Overrides:
read in class RegisteredComponentFactory

read

public void read(java.lang.String key,
                 java.io.Reader reader)
Read the component registry. The format is described in the components.xsd schema.

Overrides:
read in class RegisteredComponentFactory
Parameters:
key - the name by which the configuration file is referenced
reader - the reader from which to read the file

addComponentEntry

public boolean addComponentEntry(XmlElement xml)
Add a new registration of a component to the project's component registration. The registration is added when the new component is first used.

Parameters:
xml - the xml registration
Returns:
true if a component entry is added

getStorageDirectory

public static java.io.File getStorageDirectory()
Get the directory name to which the library will be extracted.

Returns:
the path

getUserRegistrationFileName

public static java.lang.String getUserRegistrationFileName()
Get the name of the user component registration

Returns: