|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.xui.XApplicationContext
public class XApplicationContext
| 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 XProject |
currentProject
|
protected java.lang.Class |
defaultSourceClass
The default model data source class |
protected java.lang.String |
defaultTargetClass
|
protected XDataSource |
modelDataSource
The model data source |
protected XPageManager |
pageMgr
The page manager |
protected XStartupObject |
startupObject
The Applet/Application/Startup instance |
protected java.lang.String |
widgetSet
|
| Constructor Summary | |
|---|---|
XApplicationContext(XStartupObject startObject,
java.lang.String[] args)
A default constructor. |
|
XApplicationContext(XStartupObject 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()
|
XContentHolder |
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? |
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 XPageManager. |
java.lang.Object |
displayPage(PageSupport pageObj,
java.lang.String target)
Called when a page has been added or shown via the XPageManager. |
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 XPageManager. |
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 |
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 XPageManager pageMgr
protected boolean bUseWindow
protected XDataSource modelDataSource
protected java.lang.Class defaultSourceClass
protected XStartupObject startupObject
protected int clientWidth
protected int clientHeight
protected XProject currentProject
protected java.lang.String defaultTargetClass
protected WidgetAdapter adapter
protected java.lang.String widgetSet
| Constructor Detail |
|---|
public XApplicationContext(XStartupObject startObject,
java.lang.String[] args)
public XApplicationContext(XStartupObject startObject,
java.lang.String defTargetClass,
java.lang.String[] args)
| 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 command line argumentsisMainProject - 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. XUI sometimes uses additional class loaders to find the resources needed in a project. By default XUI uses the XuiBuilder 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. net.xoetrope.awt,
this is normally defined as a result of choosing the appropriate version of
the XApplet classpublic void setDefaultDataSource(java.lang.String className)
className - the name of the datasource class
e.g. net.xoetrope.data.XDataSource.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 XPageDisplaypage - The XPage 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 XPageManager. 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 XPageDisplaypageObj - 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 XPageManager. 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 XPageDisplaypageObj - 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 XPageDisplaypage - 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 XPageDisplaypublic void hidePage(PageSupport page)
page - the page to hidepublic java.lang.Object findTarget(java.lang.String target)
findTarget in interface XPageDisplaytarget - the target area name
public java.lang.Object getTarget(int idx)
getTarget in interface XPageDisplayidx - the target area
public int getNumTargets()
getNumTargets in interface XPageDisplaypublic void setupFrameset(java.util.Hashtable params)
setupFrameset in interface XPageDisplayparams - the framset parameters if any
public XContentHolder addTarget(java.lang.String name,
java.lang.Object constraint,
int preferredWidth,
int preferredHeight,
java.util.Hashtable params)
addTarget in interface XPageDisplayname - the frame nameconstraint - the BorderlayoutConstraintpreferredWidth - the preferred widthpreferredHeight - the preferred heightparams - extra parameters for the target
public void removeAllTargets()
removeAllTargets in interface XPageDisplaypublic 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 | |||||||||