|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.widgets.Widget org.eclipse.swt.widgets.Control org.eclipse.swt.widgets.Scrollable org.eclipse.swt.widgets.Composite net.xoetrope.swt.XApplet
public class XApplet
This class is constructed with a window or frame and can be part of an applet or an application. The class acts as the main entry point to an XUI application and provides some of the infrastructure needed to support the application.
The applet can provide support for a frameset or a single page. Page display functions are also supported to allow the application to display more than a single page or change the page that is displayed.
By choosing either the AWT or Swing version of the XApplet you choose to have either an AWT or a Swing application/applet. In general once this choice has been made you should not mix toolkits.
Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt
Field Summary | |
---|---|
protected int |
clientHeight |
protected static org.eclipse.swt.widgets.Shell |
clientShell |
protected int |
clientWidth |
protected static java.lang.Class |
defaultSourceClass |
protected static org.eclipse.swt.widgets.Display |
display |
protected XDataSource |
modelDataSource |
protected XPageManager |
pageMgr |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
XApplet() A default constructor. |
Method Summary | |
---|---|
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 |
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 |
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. |
java.net.URL |
getDocumentBase() Template method, unused at present |
org.eclipse.swt.widgets.Display |
getFrame() Gets the Frame containing the applet. |
static org.eclipse.swt.widgets.Menu |
getMenuBar() Get the menubar. |
int |
getNumTargets() Get the number of target areas in the container |
protected XPageLoader |
getSecondaryClassLoader(java.lang.String packageName) Construct a new builder and set the default package. |
java.lang.Object |
getTarget(int idx) Get the target for a page display request. |
void |
hidePage(XSwtPage page) Remove the page from container. |
protected void |
initialise(org.eclipse.swt.widgets.Shell s) Generic function which is called from the constructor if it's an application or from start if its an applet. |
static void |
main(java.lang.String[] args) main method to be invoked as an application. |
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(org.eclipse.swt.widgets.Shell s) Load the content into the model. |
void |
setDefaultDataSource(java.lang.String className) Sets the default datasource class. |
void |
setHome() Set the home page using the startup properties. |
static void |
setMenuBar(org.eclipse.swt.widgets.Menu mb) Set the menubar. |
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) Setup the applet by setting paths and then initializing the applet. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static org.eclipse.swt.widgets.Shell clientShell
protected static org.eclipse.swt.widgets.Display display
protected XPageManager pageMgr
protected XDataSource modelDataSource
protected static java.lang.Class defaultSourceClass
protected int clientWidth
protected int clientHeight
Constructor Detail |
---|
public XApplet()
Method Detail |
---|
public static void main(java.lang.String[] args)
protected void setup(java.lang.String[] args)
args
- the command line argumentsprotected XPageLoader getSecondaryClassLoader(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 org.eclipse.swt.widgets.Display getFrame()
protected void initialise(org.eclipse.swt.widgets.Shell s)
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 orderprotected void register()
protected void setContent(org.eclipse.swt.widgets.Shell s)
public void setHome()
public java.lang.Object displayPage(PageSupport page)
displayPage
in interface XPageDisplay
page
- 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 XPageDisplay
pageObj
- The XPage which has been loaded.target
- the area to updatepublic void hidePage(XSwtPage page)
page
-public java.lang.Object findTarget(java.lang.String target)
findTarget
in interface XPageDisplay
target
- the target area namepublic java.lang.Object getTarget(int idx)
getTarget
in interface XPageDisplay
idx
- the target areapublic int getNumTargets()
getNumTargets
in interface XPageDisplay
public XContentHolder addTarget(java.lang.String name, java.lang.Object constraint, int preferredWidth, int preferredHeight, java.util.Hashtable params)
addTarget
in interface XPageDisplay
name
- the frame nameconstraint
- the BorderlayoutConstraintpreferredWidth
- the preferred widthpreferredHeight
- the preferred heightparams
- extra parameters for the targetpublic void removeAllTargets()
removeAllTargets
in interface XPageDisplay
public int getClientWidth()
public int getClientHeight()
public static void setMenuBar(org.eclipse.swt.widgets.Menu mb)
mb
-public static org.eclipse.swt.widgets.Menu getMenuBar()
public java.net.URL getDocumentBase()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |