org.w3c.jigadm
Class PropertyManager

java.lang.Object
  extended by org.w3c.jigadm.PropertyManager

public class PropertyManager
extends java.lang.Object


Field Summary
protected  java.util.Hashtable classProperties
          The set of resource classes we know about.
protected  java.util.Properties iconProperties
          /** the mapping of icon names to icon locations
protected  java.util.Hashtable mimeTypes
          the hashtable of mime types
static PropertyManager propertyManager
           
protected  java.io.File root
          The root for the property files.
static java.lang.String ROOT_P
           
protected  java.io.File zipfile
           
 
Constructor Summary
PropertyManager(java.io.File zipfile, java.io.File root)
           
 
Method Summary
protected  int findResourceClassProperties(java.lang.String[] classes)
           
protected  int findResourceClassProperties(java.lang.String[] classes, int offset)
           
 java.util.Properties getAttributeProperties(RemoteResourceWrapper rrw, Attribute attr)
          Get the properties for the attribute editor of a given remote resource.
protected  java.lang.String[] getClassHierarchy(RemoteResourceWrapper rrw)
           
protected  java.util.Properties getDefaultAttributeProperties(java.lang.String clsname)
           
protected  java.util.Properties getDefaultHelperProperties(java.lang.String clsname)
           
 java.util.Properties getEditorProperties(RemoteResourceWrapper rrw)
          Get any properties for the editor of the given remote resource instance.
 java.lang.String[] getHelperClasses(RemoteResourceWrapper rrw)
          Get the list of helpers to be created for the given remote resource.
 java.util.Properties getHelperProperties(RemoteResourceWrapper rrw, java.lang.String helperClass)
          Get the properties for the helper of a given remote resource.
 java.lang.String getIconLocation(java.lang.String name)
          get the icon name resolved from its description
 java.util.Hashtable getMimeTypes()
          get the hashtable of mimetypes
static PropertyManager getPropertyManager()
           
protected  org.w3c.jigadm.ResourceClassProperties getResourceClassProperties(java.lang.String[] names)
           
protected  org.w3c.jigadm.ResourceClassProperties getResourceClassProperties(java.lang.String[] names, int from)
          Get the best matching resource class properties for given class.
protected  void initialize()
          Load the properties from the root directory.
protected static java.util.Properties merge(java.util.Properties into, java.util.Properties source)
           
protected static java.util.Properties merge(java.util.Properties into, java.util.Properties source, boolean overide)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected java.io.File root
The root for the property files.


zipfile

protected java.io.File zipfile

classProperties

protected java.util.Hashtable classProperties
The set of resource classes we know about. Maps class names to ResourceClassProperty


iconProperties

protected java.util.Properties iconProperties
/** the mapping of icon names to icon locations


mimeTypes

protected java.util.Hashtable mimeTypes
the hashtable of mime types


ROOT_P

public static java.lang.String ROOT_P

propertyManager

public static PropertyManager propertyManager
Constructor Detail

PropertyManager

public PropertyManager(java.io.File zipfile,
                       java.io.File root)
Method Detail

merge

protected static java.util.Properties merge(java.util.Properties into,
                                            java.util.Properties source,
                                            boolean overide)

merge

protected static java.util.Properties merge(java.util.Properties into,
                                            java.util.Properties source)

initialize

protected void initialize()
Load the properties from the root directory.


getResourceClassProperties

protected org.w3c.jigadm.ResourceClassProperties getResourceClassProperties(java.lang.String[] names,
                                                                            int from)
Get the best matching resource class properties for given class.

Parameters:
classes - The class names we're looking a macth for.
Returns:
A ResourceClassProperties instance.

getResourceClassProperties

protected org.w3c.jigadm.ResourceClassProperties getResourceClassProperties(java.lang.String[] names)

findResourceClassProperties

protected int findResourceClassProperties(java.lang.String[] classes,
                                          int offset)

findResourceClassProperties

protected int findResourceClassProperties(java.lang.String[] classes)

getClassHierarchy

protected java.lang.String[] getClassHierarchy(RemoteResourceWrapper rrw)

getDefaultHelperProperties

protected java.util.Properties getDefaultHelperProperties(java.lang.String clsname)

getDefaultAttributeProperties

protected java.util.Properties getDefaultAttributeProperties(java.lang.String clsname)

getEditorProperties

public java.util.Properties getEditorProperties(RemoteResourceWrapper rrw)
Get any properties for the editor of the given remote resource instance.

Returns:
A Properties instance.

getHelperClasses

public java.lang.String[] getHelperClasses(RemoteResourceWrapper rrw)
Get the list of helpers to be created for the given remote resource.

Returns:
A set of helper class names (as an array).

getHelperProperties

public java.util.Properties getHelperProperties(RemoteResourceWrapper rrw,
                                                java.lang.String helperClass)
Get the properties for the helper of a given remote resource.

Parameters:
rr - The remote resource being edited.
helperClass - Class of the helper about to be created.
Returns:
An instance of Properties.

getAttributeProperties

public java.util.Properties getAttributeProperties(RemoteResourceWrapper rrw,
                                                   Attribute attr)
Get the properties for the attribute editor of a given remote resource.

Parameters:
rr - The remote resource being edited.
attr - The attribute being edited.

getIconLocation

public java.lang.String getIconLocation(java.lang.String name)
get the icon name resolved from its description

Parameters:
name - a String

getMimeTypes

public java.util.Hashtable getMimeTypes()
get the hashtable of mimetypes


getPropertyManager

public static PropertyManager getPropertyManager()