|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.ApplicationContext
public class ApplicationContext
| Field Summary | |
|---|---|
protected WidgetAdapter |
adapter
|
protected boolean |
bUseWindow
true if a popup window is in use |
protected int |
clientHeight
The height of the client area |
protected int |
clientWidth
The width of the client area |
protected Project |
currentProject
|
protected java.lang.Class |
defaultSourceClass
The default model data source class |
protected java.lang.String |
defaultTargetClass
|
protected DataSource |
modelDataSource
The model data source |
protected PageManager |
pageMgr
The page manager |
protected StartupObject |
startupObject
The Applet/Application/Startup instance |
protected java.lang.String |
widgetSet
|
| Constructor Summary | |
|---|---|
ApplicationContext(StartupObject startObject,
java.lang.String[] args)
A default constructor. |
|
ApplicationContext(StartupObject startObject,
java.lang.String defTargetClass,
java.lang.String[] args)
A default constructor. |
|
| Method Summary | |
|---|---|
void |
addLifeCycleListener()
Add the lifecycle listener to the current project based upon the LifeCycleListener
startup parameter/property |
protected void |
addSecondaryClassLoaders(java.lang.String packageName)
Construct a new builder and set the default package. |
protected void |
addShutdownHook()
|
ContentHolder |
addTarget(java.lang.String name,
java.lang.Object constraint,
int preferredWidth,
int preferredHeight,
java.util.Hashtable params)
Add a new frame or target area to a frameset |
boolean |
canClose()
Can the application close? If a life cycle listener has been added then its canClose method is invoked |
java.lang.Object |
displayDecoration(PageSupport page,
java.lang.String constraint)
Display a window decoration, for example a toolbar |
java.lang.Object |
displayPage(PageSupport page)
Called when a page has been added or shown via the PageManager. |
java.lang.Object |
displayPage(PageSupport pageObj,
java.lang.String target)
Called when a page has been added or shown via the PageManager. |
java.lang.Object |
displayPage(PageSupport pageObj,
java.lang.String target,
java.lang.Object attributes)
Called when a page has been added or shown via the PageManager. |
void |
doLayout()
Update the page display layout |
java.lang.Object |
findTarget(java.lang.String target)
Finds the target area for a page display request, this only applies to a frameset. |
int |
getClientHeight()
Get the height of the main window. |
int |
getClientWidth()
Get the width of the main window. |
int |
getNumTargets()
Get the number of targets in the container |
java.lang.Object |
getTarget(int idx)
Get the target for a page display request. |
void |
hidePage(PageSupport page)
Remove the page from container. |
void |
init()
Invoked when used as an applet. |
protected void |
initialise()
Generic function which is called from the constructor if it's an application or from start if its an applet. |
protected int |
loadSecondaryProject(XmlElement projectElememt)
Load a secondary project. |
protected void |
register()
Load the componentFactories by reading the factory names from the startup file. |
void |
removeAllTargets()
Remove all frames/targets from the current frameset |
void |
restoreState()
Restore the application state |
void |
saveState()
Save the application state |
protected void |
setContent(boolean initialized)
Load the content into the model. |
void |
setDefaultDataSource(java.lang.String className)
Sets the default datasource class. |
void |
setDefaultTargetClass(java.lang.String clsName)
Set the name of the default target class |
void |
setHome()
Set the home page using the startup properties. |
protected void |
setResourceFile(java.lang.String startFile)
Setup the default resource file for the application and load some of the information in it. |
protected void |
setup(java.lang.String[] args,
boolean isMainProject)
Setup the applet by setting paths and then initializing the applet. |
void |
setupFrameset(java.util.Hashtable params)
Setup frameset. |
void |
shutdown()
Shutdown and exit the application |
void |
windowActivated(java.awt.event.WindowEvent e)
Template method, unused at present |
void |
windowClosed(java.awt.event.WindowEvent e)
Template method, unused at present |
void |
windowClosing(java.awt.event.WindowEvent e)
Exit the application |
void |
windowDeactivated(java.awt.event.WindowEvent e)
Template method, unused at present |
void |
windowDeiconified(java.awt.event.WindowEvent e)
Template method, unused at present |
void |
windowIconified(java.awt.event.WindowEvent e)
Template method, unused at present |
void |
windowOpened(java.awt.event.WindowEvent e)
Template method, unused at present |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PageManager pageMgr
protected boolean bUseWindow
protected DataSource modelDataSource
protected java.lang.Class defaultSourceClass
protected StartupObject startupObject
protected int clientWidth
protected int clientHeight
protected Project currentProject
protected java.lang.String defaultTargetClass
protected WidgetAdapter adapter
protected java.lang.String widgetSet
| Constructor Detail |
|---|
public ApplicationContext(StartupObject startObject,
java.lang.String[] args)
startObject - the invoking startup objectargs - the optional command line arguments
public ApplicationContext(StartupObject startObject,
java.lang.String defTargetClass,
java.lang.String[] args)
startObject - the invoking startup objectdefTargetClass - the class name for the default target areas/containersargs - the optional command line arguments
| Method Detail |
|---|
protected int loadSecondaryProject(XmlElement projectElememt)
Load a secondary project. A secondary project is loaded at the behest of the main project, and it is the main project's settings that control the application's appearance with the secondary project(s) contribution content and resources.
Secondary projects are specified as part of the projects resources, in a 'projects.xml' file that contains an entry for each project to load
projectElememt - the xml element for the new project
protected void setup(java.lang.String[] args,
boolean isMainProject)
args - the optional command line arguments
isMainProject - true if this is the main projectpublic void shutdown()
protected void addSecondaryClassLoaders(java.lang.String packageName)
Construct a new builder and set the default package. Aria sometimes uses additional class loaders to find the resources needed in a project. By default Aria uses the AriaBuilder class loader to convert XML files to Java classes.
A custom class loader can be referenced in the startup properties file using the 'BuilderClass' property. Once this property has been determined this method will instantiate an instance of that class if necessary.
packageName - the name of the default widget package e.g. org.formaria.awt,
this is normally defined as a result of choosing the appropriate version of
the Applet classpublic void saveState()
public void restoreState()
public void setDefaultDataSource(java.lang.String className)
className - the name of the datasource class
e.g. org.formaria.data.DataSource.class, this class reads data from an XML fileprotected void setResourceFile(java.lang.String startFile)
startFile - The name of the file to be loaded, by default startup.propertiespublic void init()
protected void initialise()
Generic function which is called from the constructor if it's an application or from start if its an applet.
The initialization process proceeds in the following order
protected void addShutdownHook()
public void addLifeCycleListener()
LifeCycleListener
startup parameter/property
public boolean canClose()
protected void register()
protected void setContent(boolean initialized)
public void setHome()
public java.lang.Object displayPage(PageSupport page)
displayPage in interface PageDisplaypage - The Page which has been loaded.
public java.lang.Object displayPage(PageSupport pageObj,
java.lang.String target)
Called when a page has been added or shown via the PageManager. The page manager then requests that the applet/application then displays the page in the appropriate location.
The sequence with which the page transition occurs is as follows:
displayPage in interface PageDisplaypageObj - the page to displaytarget - the area to update
public java.lang.Object displayPage(PageSupport pageObj,
java.lang.String target,
java.lang.Object attributes)
Called when a page has been added or shown via the PageManager. The page manager then requests that the applet/application then displays the page in the appropriate location.
The sequence with which the page transition occurs is as follows:
displayPage in interface PageDisplaypageObj - the page to dosplaytarget - the name of the target area to updateattributes - attributes for use by the new page / taregt
public java.lang.Object displayDecoration(PageSupport page,
java.lang.String constraint)
displayDecoration in interface PageDisplaypage - the new pageconstraint - a value controlling how and where the decoration is
displayed, this value is application type specific
public void doLayout()
doLayout in interface PageDisplaypublic void hidePage(PageSupport page)
page - the page to hidepublic java.lang.Object findTarget(java.lang.String target)
findTarget in interface PageDisplaytarget - the target area name
public java.lang.Object getTarget(int idx)
getTarget in interface PageDisplayidx - the target area
public int getNumTargets()
getNumTargets in interface PageDisplaypublic void setupFrameset(java.util.Hashtable params)
setupFrameset in interface PageDisplayparams - the framset parameters if any
public ContentHolder addTarget(java.lang.String name,
java.lang.Object constraint,
int preferredWidth,
int preferredHeight,
java.util.Hashtable params)
addTarget in interface PageDisplayname - the frame nameconstraint - the BorderlayoutConstraintpreferredWidth - the preferred widthpreferredHeight - the preferred heightparams - extra parameters for the target
public void removeAllTargets()
removeAllTargets in interface PageDisplaypublic void setDefaultTargetClass(java.lang.String clsName)
clsName - the class namepublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing in interface java.awt.event.WindowListenere - the window eventpublic int getClientWidth()
public int getClientHeight()
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated in interface java.awt.event.WindowListenere - the window eventpublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed in interface java.awt.event.WindowListenere - the window eventpublic void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified in interface java.awt.event.WindowListenere - the window eventpublic void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated in interface java.awt.event.WindowListenere - the window eventpublic void windowIconified(java.awt.event.WindowEvent e)
windowIconified in interface java.awt.event.WindowListenere - the window eventpublic void windowOpened(java.awt.event.WindowEvent e)
windowOpened in interface java.awt.event.WindowListenere - the window event
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||