|
WebObjects 5.4.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.eoapplication.EOController com.webobjects.eoapplication.EOApplication
public class EOApplication
Java Client applications typically execute as a desktop application (often referred to as a "Java application"), launched through Web Start or through a command line or as an applet running in a browser. EOApplication insulates the developer from this distinction by serving as an execution-mode-independent repository for application-level client-side logic. The provided JApplet subclass EOApplet simply invokes EOApplication with the HTML arguments as parameters.
To support different kind of architectures, EOApplication uses an "application support"
object which has to be a subclass of the abstract inner class EOApplication.ApplicationSupport
.
The application support implementation can encapsulate different kind of initialization behavior, for
example for three-tier Java Client applications the creation of a distribution channel is taken care
of by the EOClientApplicationSupport class. EOApplication does not provide a main
function,
that is left to the application support class. The main
function typically invokes the static
startApplication
method on EOApplication with an instance of the appropriate application
support class.
Each application has a window observer which keeps track of all of the windows in the application,
which window is active, and whether all windows have been closed. The window observer has two notifications:
ActiveWindowChangedNotification
and LastWindowClosedNotification
, which the
finishInitialization
method binds to the activeWindowDidChange
and
lastWindowDidClose
methods, respectively.
Each application also has a defaults manager, an EODefaults object, which maintains two dictionaries for
application defaults: a transient dictionary whose values are forgotten when the application exits, and a
persistent dictionary whose values are stored on the server. The defaults manager implements
valueForKey
to read the defaults and setPersistentValueForKey
and
setTransientValueForKey
to store the defaults.
Nested Class Summary | |
---|---|
static class |
EOApplication.ApplicationSupport
EOApplication.ApplicationSupport can encapsulate behavior of Java Client applications
used in different architectures. |
Nested classes/interfaces inherited from class com.webobjects.eoapplication.EOController |
---|
EOController.Enumeration |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
---|
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility |
Field Summary | |
---|---|
static String |
ApplicationDidStartNotification
The name of the notification sent when the application did finish the launch sequence. |
static String |
ApplicationWillFinishInitializationNotification
The name of the notification sent when the application has switched to the final event thread. |
static String |
ApplicationWillQuitNotification
The name of the notification sent when the application is about to quit. |
static String |
ApplicationWillStartNotification
The name of the notification sent when the application is beginning the launch sequence. |
Fields inherited from class com.webobjects.eoapplication.EOController |
---|
ControllerAndSubcontrollersEnumeration, ControllerAndSupercontrollersEnumeration, SubcontrollersEnumeration, SupercontrollersEnumeration |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
---|
KeyPathSeparator |
Constructor Summary | |
---|---|
EOApplication()
Creates a new EOApplication object. |
Method Summary | |
---|---|
void |
activeWindowDidChange(NSNotification notification)
This method is invoked when the user changes the active window in the receiver (usually by clicking in an inactive window). |
String |
applicationName()
Returns the receiver's application name. |
NSDictionary |
arguments()
Returns all of the application's arguments in a dictionary. |
boolean |
canQuit()
Returns whether or not the application can quit (shows a Quit menu item). |
protected NSArray |
defaultActions()
Returns an NSArray containing the actions (EOAction objects) for the application. |
EODefaults |
defaults()
Returns the receiver's defaults manager (an EODefaults object). |
void |
dispose()
Prepares the receiver so it is disposed when Java performs garbage collection. |
NSArray |
documents()
Returns an array containing the application's visible documents (EODocument controllers). |
NSArray |
documentsForGlobalID(EOGlobalID globalID,
String entityName)
Returns an array containing the application's documents (EODocument controllers) that edit enterprise objects with an entity name matching entityName and a global ID matching globalID . |
NSArray |
editedDocuments()
Returns an NSArray containing the application's documents (EODocument controllers) that are edited (and not saved). |
protected void |
finishInitialization()
This method is invoked after the final event thread is guaranteed to be running. |
boolean |
hasEditedDocuments()
Returns whether any of the application's documents (EODocument controllers) are edited (and not saved). |
NSArray |
languages()
Returns an array containing the preferred display language lookup order for the user (in English). |
void |
lastWindowDidClose(NSNotification notification)
This method is invoked when the user closes the last window in the application. |
NSArray |
localeIndicators()
Returns an array of Strings which can be used to identify the preferred locale/language for the user. |
NSArray |
locales()
Returns an array containing the preferred Locale lookup order for the user. |
NSArray |
platformIndicators()
Returns an array of Strings (all lowercase) which can be used to identify the platform the application is running on. |
void |
quit()
Causes the receiver to quit (provided canQuit is true). |
boolean |
quitsOnLastWindowClose()
Returns whether or not the receiver quits when the user closes all of its windows. |
void |
quitWithMessage(String title,
String message)
Can be invoked to quit the application after showing a panel with an explanation (for example in case of a Session Time Out error for a three-tier application). |
void |
refreshData()
Updates the client application's enterprise objects to reflect the changes sent to the server from other client applications. |
boolean |
saveAll()
Attempts to save all of the receiver's edited documents. |
void |
setApplicationName(String applicationName)
Sets the receiver's application name. |
static void |
setArguments(NSDictionary arguments)
Sets the application's arguments. |
void |
setCanQuit(boolean flag)
Sets whether or not the application can quit (shows a Quit menu item). |
void |
setDefaults(EODefaults defaults)
Sets the receiver's defaults manager (an EODefaults object). |
void |
setQuitsOnLastWindowClose(boolean flag)
Sets whether or not the receiver quits when the user closes all of its windows. |
void |
setWindowObserver(EOWindowObserver windowObserver)
Sets the application's window observer to EOWindowObserver. |
static EOApplication |
sharedApplication()
Returns the shared EOApplication instance initialized in the startApplication method. |
static EOApplication |
startApplication(NSDictionary parameters,
EOComponentController initialTopComponentController,
EOApplication.ApplicationSupport applicationSupport)
This method is the primary entry point for starting a Java Client application. |
String |
toString()
Returns the receiver as a string describing the state of the application. |
EOWindowObserver |
windowObserver()
Returns the application's window observer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ApplicationWillStartNotification
public static final String ApplicationWillFinishInitializationNotification
public static final String ApplicationDidStartNotification
public static final String ApplicationWillQuitNotification
Constructor Detail |
---|
public EOApplication()
Method Detail |
---|
public static EOApplication startApplication(NSDictionary parameters, EOComponentController initialTopComponentController, EOApplication.ApplicationSupport applicationSupport)
This method is the primary entry point for starting a Java Client application.
Together with the finishInitialization
method it performs the
complete startup sequence (connect to the server, warm up the user interface,
determine languages, etc.)
The parameters dictionary contains all client parameters known at the time this method is invoked. For applets, these are all values of the WOJavaClientApplet bindings on the server side, passed in the HTML. For applications, these are all command line arguments.
The initialTopComponentController
parameter can specify an EOComponentController in the
controller hierarchy which becomes the parent controller for the intial
EOInterfaceController if one is specified. For applets, this controller is an EOAppletController.
For desktop applications, this is null
, which causes a new EOFrameController to be
instantiated and used as the top-most EOComponentController.
parameters
- the parameters for the applicationinitialTopComponentController
- the parent component controller for initial interface controllersapplicationSupport
- the support object handling the details of the startup process
public static EOApplication sharedApplication()
public void dispose()
dispose
in interface NSDisposable
dispose
in class EOController
protected NSArray defaultActions()
defaultActions
in class EOController
EOController.actions()
,
EOController.resetActions()
public boolean saveAll()
true
if the save was successful; false
otherwisepublic void quit()
EOApplication.canQuit()
public void quitWithMessage(String title, String message)
title
- the title of the panel to be displayedmessage
- the message to be displayed in the panelpublic void refreshData()
public static void setArguments(NSDictionary arguments)
arguments
- the application's argumentspublic NSDictionary arguments()
public void setDefaults(EODefaults defaults)
defaults
- the application's default managerpublic EODefaults defaults()
null
until the user has authenticated.
public NSArray languages()
public NSArray locales()
public NSArray localeIndicators()
public NSArray platformIndicators()
public NSArray documents()
public NSArray editedDocuments()
public boolean hasEditedDocuments()
false
.
true
if the application has edited documents; false
otherwisepublic NSArray documentsForGlobalID(EOGlobalID globalID, String entityName)
entityName
and a global ID matching globalID
.
globalID
- the global ID for the documentsentityName
- the entity name for the documents
public void setApplicationName(String applicationName)
applicationName
- the application namepublic String applicationName()
public void setWindowObserver(EOWindowObserver windowObserver)
windowObserver
- the window observerpublic EOWindowObserver windowObserver()
protected void finishInitialization()
public void setCanQuit(boolean flag)
flag
- true
if the application can quit; false
otherwisepublic boolean canQuit()
true
if the application is run as a desktop application
and false
if it runs as an applet.
true
if the application can quit; false
otherwisepublic void setQuitsOnLastWindowClose(boolean flag)
flag
- true
if the application quits if the user closes all windows; false
otherwisepublic boolean quitsOnLastWindowClose()
true
.
true
if the application quits if the user closes all windows; false
otherwisepublic void activeWindowDidChange(NSNotification notification)
notification
- the window observer notificationpublic void lastWindowDidClose(NSNotification notification)
notification
- the window observer notificationEOApplication.quitsOnLastWindowClose()
public String toString()
toString
in class EOController
|
Last updated June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |