|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.Project
public class Project
A holder for references to the objects and resources used by an Aria project
Copyright (c) Formaria Ltd., 2008
$Revision: 2.40 $
License: see License.txt
| Field Summary | |
|---|---|
protected java.lang.String |
basePackageName
The package where event hadlers can be found |
protected java.util.Vector |
bindingFactories
Stores a Vector of DataBindingFactory Object for this Project instance |
static int |
CLOSING
|
static int |
CREATED
|
protected java.util.Vector |
customClassLoaders
Vector of s used to locate resources for this Project instance |
protected java.lang.String |
defaultEncoding
Encoding with which to read and write XML files. |
protected java.lang.String |
defaultFile
|
protected java.lang.Class |
defaultModelClass
The default DataModel based class to be used in this Project instance. |
protected java.net.URL |
documentBase
The path to the startup directory for this Project instance |
protected java.lang.String |
eventHandlerClassName
The name of the event handler class which is to be used |
protected ExceptionHandler |
exceptionHandler
A generic handler for exceptions |
protected java.util.Hashtable |
imageCache
Hashtable of images already accessed |
static int |
INITIALIZED
|
protected java.util.Hashtable |
managerObjects
Hashtable for storing other non-Aria object such as Routes and Services |
protected MessageHelper |
messageHelper
Store a reference to the MessageHelper utility class |
protected DataModel |
modelRoot
The root DataModel for this Project instance |
protected PageManager |
pageManager
The PageManager for this Project instance |
protected ResourceBundleLoader |
resourceBundleLoader
ResourceBundleLoader used to load ResourceBundles |
static int |
RESTARTING
|
static int |
STARTED
|
protected java.util.Properties |
startSettings
Properties Object created from the statup properties |
protected java.lang.String |
startupFile
The name of the startup file for this Project instance |
protected StartupObject |
startupObject
|
protected int |
status
|
protected StyleManager |
styleManager
The StyleManager for this Project instance |
static int |
TERMINATED
|
static int |
UNKNOWN
|
protected java.lang.String |
widgetPackageName
The package name of the components to be used (AWT or Swing) |
protected XmlParserFactory |
xmlParserFactory
The XmlParserFactory to be used by this Project instance |
| Constructor Summary | |
|---|---|
protected |
Project()
Create a new project |
| Method Summary | |
|---|---|
void |
addCustomClassLoader(java.lang.ClassLoader c)
Add a custom class loader. |
boolean |
canAccessDefaultPackage(java.lang.ClassLoader cl,
java.lang.String path)
Can the project access the default package. |
AriaEventHandler |
createEventHandler(java.lang.Object owner,
ValidationHandler validationHandler)
Create the AriaEventHandler for the passed owner (Page) and set it's ValidationHandler |
protected java.awt.Image |
createImage(java.io.InputStream imgStream)
Returns an Image, or null if the path was invalid. |
java.net.URL |
findResource(java.lang.String fileName)
Find a resource |
java.lang.String |
findResourceAsString(java.lang.String fileName)
Find a resource and get its filename (unencoded) |
boolean |
fixError(java.lang.Class klass,
java.lang.String errorName,
java.lang.Object sourceObj,
java.lang.Throwable t)
Attempt to fix an error when running a Aria application |
boolean |
fixError(java.lang.String errorName,
java.lang.Object sourceObj,
java.lang.Throwable t)
Attempt to fix an error when running a Aria application |
java.awt.Frame |
getAppFrame()
Get a areference to the applet's Frame |
java.applet.Applet |
getApplet()
Get a reference to the applet object |
ApplicationContext |
getApplicationContext()
Gets the application context for this project |
java.awt.Window |
getAppWindow()
Get a reference to the application's main Window |
java.util.Vector |
getBindingsFactories()
Get the binding factories. |
java.io.BufferedInputStream |
getBufferedInputStream(java.io.File file)
Gets a buffered stream for a file |
java.io.BufferedInputStream |
getBufferedInputStream(java.lang.String s)
Gets a buffered stream for a resource |
java.io.BufferedOutputStream |
getBufferedOutputStream(java.lang.String file)
Gets a buffered stream for a file |
java.io.BufferedOutputStream |
getBufferedOutputStream(java.lang.String file,
boolean useProjectParent)
Gets a buffered stream for a file |
java.io.BufferedReader |
getBufferedReader(java.io.File file,
java.lang.String encoding)
Gets a BufferedReader for a resource |
java.io.BufferedReader |
getBufferedReader(java.lang.String file)
Gets a BufferedReader for a resource |
java.io.BufferedReader |
getBufferedReader(java.lang.String file,
java.lang.String encoding)
Gets a BufferedReader for a resource |
StyleFactory |
getComponentFactory(java.lang.String packageName)
Gets an instance of the component factory |
java.util.Vector |
getCustomerClassLoaders()
Get the custom classloaders |
java.lang.String |
getDefaultEncoding()
Get the default file encoding (UTF8 unless modified) |
java.net.URL |
getDocumentBase()
Get the applet document base. |
ExceptionHandler |
getExceptionHandler()
Set an exception handler for unhandled errors during method response method invocation |
java.lang.Object |
getIcon(java.lang.String name)
Loads an image icon |
void |
getImage(ImageHolder holder,
java.lang.String name)
Loads an image resource in a background thread |
java.awt.Image |
getImage(java.lang.String name)
Loads an image resource |
java.io.InputStream |
getInputStream(java.io.File file)
Gets a stream for a file |
java.io.InputStream |
getInputStream(java.lang.String fileName)
Gets a stream for a resource |
MessageHelper |
getMessageHelper()
Get the message helper (for formatting messages) |
DataModel |
getModel()
Get the root instance of the model. |
java.lang.Object |
getObject(java.lang.String key)
Get a manager object |
java.io.OutputStream |
getOutputStream(java.lang.String file)
Gets a stream for a file |
java.io.OutputStream |
getOutputStream(java.lang.String file,
boolean useProjectParent)
Gets a stream for a file |
java.lang.String |
getPackageName()
Get the default package name |
PageManager |
getPageManager()
Gets an instance of the page manager. |
java.lang.ClassLoader |
getProjectClassLoader()
Gets the ProjectClassLoader object. |
java.util.ResourceBundle |
getResourceBundle(java.lang.String name)
Get a resource bundle |
ResourceBundleLoader |
getResourceBundleLoader()
Get the resource bundle loader |
java.lang.String |
getStartupFile()
Get the name of the startup file. |
StartupObject |
getStartupObject()
Get the startup object |
java.lang.String |
getStartupParam(java.lang.String name)
Gets a startup parameter |
int |
getStartupParamAsInt(java.lang.String name)
Gets a startup parameter |
int |
getStatus()
Get the project status |
StyleManager |
getStyleManager()
Get a reference to the StyleManager. |
Translator |
getTranslator()
Get the default translation object |
Translator |
getTranslator(java.lang.String name)
Get the translation object for the named bundle. |
java.net.URL |
getUrl(java.lang.String fileName)
Gets a URL for a resource |
java.lang.String |
getWidgetPackageName()
Get the default widget package name |
XmlParserFactory |
getXmlParserFactory()
Get the XML parser factory |
void |
initialise(java.lang.String startFile)
Setup the project and configure its resources |
void |
registerBindingFactory(DataBindingFactory fact)
Register a data binding factory. |
void |
registerBindingFactory(DataBindingFactory fact,
int pos)
Register a binding factory with the project. |
void |
removeObject(java.lang.String key)
Remove a manager object value |
void |
resetModel()
Reset the model to its initial state. |
void |
setAppFrame(java.awt.Frame frame)
Set the main Frame reference |
void |
setApplet(java.applet.Applet applet)
Set tbe applet reference |
void |
setAppWindow(java.awt.Window window)
Set the main Window reference |
void |
setComponentFactory(java.lang.String packageName,
StyleFactory factory)
Sets an instance of the component factory |
void |
setDefaultEncoding(java.lang.String encoding)
Set the default file encoding (UTF8 unless modified) see http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html |
void |
setDefaultFile(java.lang.String file)
Set the default file/directory specification used to locate files by the getOutputStream( String file, boolean useProjectParent ) method |
void |
setDefaultModel(java.lang.String className)
Sets the default model class. |
void |
setDocumentBase(java.net.URL u)
Set/Record the URL from which the applet was loaded |
void |
setEventHandlerClass(java.lang.String className)
Set the name of the class which will handle events for this Project instance |
void |
setExceptionHandler(ExceptionHandler eh)
Set an exception handler for unhandled errors during method response method invocation |
void |
setObject(java.lang.String key,
java.lang.Object obj)
Set an manager object value |
void |
setPackageName(java.lang.String pn)
Set the default package name. |
void |
setResourceBundleLoader(ResourceBundleLoader loader)
Set the object to load language resource bundles |
void |
setStartupFile(java.lang.String fileName)
Sets the startup file and loads the associated resource. |
void |
setStartupObject(StartupObject so)
Set tbe startup object reference |
boolean |
setStartupParam(java.lang.String name,
java.lang.String value)
Sets a startup parameter |
void |
setStatus(int newStatus)
Set the application status |
void |
setWidgetPackageName(java.lang.String pn)
Set the default widget package name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNKNOWN
public static final int CREATED
public static final int INITIALIZED
public static final int STARTED
public static final int CLOSING
public static final int TERMINATED
public static final int RESTARTING
protected StyleManager styleManager
protected PageManager pageManager
protected DataModel modelRoot
protected XmlParserFactory xmlParserFactory
protected MessageHelper messageHelper
protected java.util.Vector bindingFactories
protected java.lang.String startupFile
protected java.util.Properties startSettings
protected java.net.URL documentBase
protected java.util.Hashtable managerObjects
protected java.lang.Class defaultModelClass
protected java.lang.String eventHandlerClassName
protected java.lang.String defaultFile
protected java.lang.String defaultEncoding
protected java.lang.String basePackageName
protected java.lang.String widgetPackageName
protected StartupObject startupObject
protected java.util.Vector customClassLoaders
protected ResourceBundleLoader resourceBundleLoader
protected java.util.Hashtable imageCache
protected ExceptionHandler exceptionHandler
protected int status
| Constructor Detail |
|---|
protected Project()
| Method Detail |
|---|
public void initialise(java.lang.String startFile)
startFile - the startup filepublic StyleManager getStyleManager()
public PageManager getPageManager()
public StyleFactory getComponentFactory(java.lang.String packageName)
public void setComponentFactory(java.lang.String packageName,
StyleFactory factory)
public ApplicationContext getApplicationContext()
public DataModel getModel()
public void setDefaultModel(java.lang.String className)
className - the name of the model class e.g. org.formaria.aria.data.BaseModelpublic void resetModel()
public XmlParserFactory getXmlParserFactory()
public AriaEventHandler createEventHandler(java.lang.Object owner,
ValidationHandler validationHandler)
owner - The Page for which the passed ValidationHandler is workingvalidationHandler - The ValidationHandler for this Project instance
public void setEventHandlerClass(java.lang.String className)
className - The name of the event handler classpublic ExceptionHandler getExceptionHandler()
public void setExceptionHandler(ExceptionHandler eh)
eh - the exception handlerpublic MessageHelper getMessageHelper()
public java.util.Vector getBindingsFactories()
public void registerBindingFactory(DataBindingFactory fact,
int pos)
fact - the new factorypos - the postion in the array at which to add the factory.public void registerBindingFactory(DataBindingFactory fact)
fact - the new binding factorypublic java.lang.String getStartupFile()
public void setStartupFile(java.lang.String fileName)
fileName - the name of the startup resource file.public java.lang.String getStartupParam(java.lang.String name)
name - the paramenter name
public boolean setStartupParam(java.lang.String name,
java.lang.String value)
name - the paramenter namevalue - the new value
public int getStartupParamAsInt(java.lang.String name)
name - the paramenter name
public int getStatus()
public void setStatus(int newStatus)
newStatus - the new statuspublic java.lang.Object getObject(java.lang.String key)
key - the name of the object e.g. "Routes", "Services"
public void setObject(java.lang.String key,
java.lang.Object obj)
key - the name of the object e.g. "Routes", "Services"obj - the object instancepublic void removeObject(java.lang.String key)
key - the name of the object e.g. "Routes", "Services"public java.lang.Object getIcon(java.lang.String name)
name - the image resource name
public java.awt.Image getImage(java.lang.String name)
name - the image resource name
public void getImage(ImageHolder holder,
java.lang.String name)
holder - the component containing to display the imagename - the image resource namepublic java.io.InputStream getInputStream(java.lang.String fileName)
fileName - the resource file name
public java.lang.String findResourceAsString(java.lang.String fileName)
fileName - the resource file name
public java.net.URL findResource(java.lang.String fileName)
fileName - the resource file name
public java.io.BufferedInputStream getBufferedInputStream(java.lang.String s)
s - the resource name
public java.net.URL getUrl(java.lang.String fileName)
fileName - the resource file name
public void addCustomClassLoader(java.lang.ClassLoader c)
c - the classloaderpublic java.util.Vector getCustomerClassLoaders()
public java.lang.ClassLoader getProjectClassLoader()
ProjectClassLoader object. If any instance of
ProjectClassLoader class was created, it is registered in
this Project object.
ProjectClassLoader object.public java.io.InputStream getInputStream(java.io.File file)
file - the file
public java.io.BufferedInputStream getBufferedInputStream(java.io.File file)
file - the file
public java.io.BufferedReader getBufferedReader(java.lang.String file)
throws java.lang.Exception
file - the resource file name
java.lang.Exception - throw an exception if there's a problem
public java.io.BufferedReader getBufferedReader(java.lang.String file,
java.lang.String encoding)
throws java.lang.Exception
file - the resource file nameencoding - the input encoding e.g. "UTF8" or null for the default
encoding (UTF8 unless it has been changed)
java.lang.Exception - throw an exception if there's a problem
public java.io.BufferedReader getBufferedReader(java.io.File file,
java.lang.String encoding)
throws java.lang.Exception
file - the resource fileencoding - the input encoding e.g. "UTF8" or null for the default
encoding (UTF8 unless it has been changed)
java.lang.Exception - throw an exception if there a problempublic java.io.OutputStream getOutputStream(java.lang.String file)
file - the file
public java.io.BufferedOutputStream getBufferedOutputStream(java.lang.String file)
file - the file
public java.io.OutputStream getOutputStream(java.lang.String file,
boolean useProjectParent)
file - the fileuseProjectParent - use the projects default file specification to locate the file
public java.io.BufferedOutputStream getBufferedOutputStream(java.lang.String file,
boolean useProjectParent)
file - the fileuseProjectParent - use the projects default file specification to locate the file
public void setPackageName(java.lang.String pn)
pn - The name of the package to be usedpublic java.lang.String getPackageName()
public void setWidgetPackageName(java.lang.String pn)
pn - The name of the widget package to be usedpublic java.lang.String getWidgetPackageName()
public java.net.URL getDocumentBase()
public void setDocumentBase(java.net.URL u)
u - The path to the start directorypublic void setApplet(java.applet.Applet applet)
applet - The Appletpublic void setStartupObject(StartupObject so)
so - the StartupObjectpublic void setAppFrame(java.awt.Frame frame)
frame - The main application framepublic void setAppWindow(java.awt.Window window)
window - The main application windowpublic java.applet.Applet getApplet()
public StartupObject getStartupObject()
public java.awt.Frame getAppFrame()
public java.awt.Window getAppWindow()
protected java.awt.Image createImage(java.io.InputStream imgStream)
imgStream - The InputStream from which the image is to be read
public java.lang.String getDefaultEncoding()
public void setDefaultEncoding(java.lang.String encoding)
encoding - the encoding e.g. "UTF8" or "ISO-8859-1"public void setResourceBundleLoader(ResourceBundleLoader loader)
loader - the new loaderpublic ResourceBundleLoader getResourceBundleLoader()
public java.util.ResourceBundle getResourceBundle(java.lang.String name)
name - the unqualified name of the resource bundle
public Translator getTranslator()
public Translator getTranslator(java.lang.String name)
name - the name of the resource used for translation
public void setDefaultFile(java.lang.String file)
file - the file or directory specification
public boolean fixError(java.lang.String errorName,
java.lang.Object sourceObj,
java.lang.Throwable t)
errorName - the name of the error, this should correzpond to a fully
qualified class name or a class within the org.formaria.selfhealing packagesourceObj - the instance of the class from which the error handler was
invoked, or the object being repairedt - throwable the exception that was trapped, or null
public boolean fixError(java.lang.Class klass,
java.lang.String errorName,
java.lang.Object sourceObj,
java.lang.Throwable t)
klass - the class through which the healer wiull be loadererrorName - the name of the error, this should correzpond to a fully
qualified class name or a class within the org.formaria.selfhealing packagesourceObj - the instance of the class from which the error handler was
invoked, or the object being repairedt - throwable the exception that was trapped, or null
public boolean canAccessDefaultPackage(java.lang.ClassLoader cl,
java.lang.String path)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||