PATH |
EOApplication
Inherits from: EOController : Object
Package: com.webobjects.eoapplication
Class Description
Java Client applications typically execute from the command line (often referred to as a "Java application") 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.
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.
EOApplication is used in Java Client application only; there is no equivalent class on the server side.
XML Tag | Default Rule System Controller Type |
None | None |
Constants
Constant | Description |
ApplicationDidStart | Description forthcoming. |
ApplicationWillQuit | Description forthcoming. |
Interfaces Implemented
NSDisposable dispose EOKeyValueCodingAdditions (com.webobjects.eocontrol) EOAction.Enabling canPerformActionNamed EOKeyValueCoding (com.webobjects.eocontrol inherited from EOKeyValueCodingAdditions) NSKeyValueCoding (inherited from EOKeyValueCoding)
Method Types
Accessing the shared instance sharedApplication Entering the application main startApplication Initializing and terminating the application canQuit finishInitialization quitsOnLastWindowClose setCanQuit setQuitsOnLastWindowClose Managing the application arguments defaults languages Managing documents documents documentsForGlobalID editedDocuments hasEditedDocuments Managing the window observer activeWindowDidChange lastWindowDidClose setWindowObserver windowObserver Methods inherited from Object toString Performing main menu operations activatePreviousWindow collectChangesFromServer defaultActions saveAll quit
Constructors
EOApplication
public EOApplication()
Static Methods
main
public static void main(String[] args[])
-key1 value1 -key2 value2 ...
), which are stored in a parameter dictionary (NSDictionary). The user must specify an application URL (using the -applicationURL <application URL>
argument), the name of a distribution channel class (using the -channelClassName <channel class name>
argument), or both depending on the specific distribution channel. If the user specifies the application URL, he can optionally specify any initial entry page other than Main. After instantiating an EODistributionChannel on the basis of these two parameters, main simply invokes startApplication
.
sharedApplication
public static EOApplication sharedApplication()
startApplication
public static EOApplication startApplication( NSDictionary parameterDictionary, EOComponentController initialTopComponentController, boolean remoteRequestArguments)
true
, which triggers startApplication to read additional parameters from the applet at the URL specified on the command line. If the application is started in an applet, all parameters are contained in the HTML. The initialTopComponentController parameter specifies the top-most EOComponentController in the controller hierarchy. For applets, this controller is an EOAppletController. For command line applications, the main method sets initialTopComponentController to null
, which causes a new EOFrameController to be instantiated and used as the top-most EOComponentController.
Instance Methods
activatePreviousWindow
public void activatePreviousWindow()
activeWindowDidChange
public void activeWindowDidChange(NSNotification aNSNotification)
arguments
public NSDictionary arguments()
canPerformActionNamed
public boolean canPerformActionNamed(String actionName)
activatePreviousWindow
action and the first window is active.
canQuit
public boolean canQuit()
true
if the application is run from the command line and false
if it is started in an applet.
collectChangesFromServer
public void collectChangesFromServer()
defaultActions
protected NSArray defaultActions()
defaults
public EODefaults defaults()
null
until the user logs in.
dispose
public void dispose()
documents
public NSArray documents()
documentsForGlobalID
public NSArray documentsForGlobalID( com.webobjects.eocontrol.EOGlobalID globalID, String entityName)
editedDocuments
public NSArray editedDocuments()
finishInitialization
protected void finishInitialization()
hasEditedDocuments
public boolean hasEditedDocuments()
true
if any of the receiver's documents has been edited. Otherwise returns false
.
languages
public NSArray languages()
English
.
lastWindowDidClose
public void lastWindowDidClose(NSNotification aNSNotification)
See Also: quitsOnLastWindowClose
quit
public void quit()
canQuit
is true
).
See Also: canQuit
quitsOnLastWindowClose
public boolean quitsOnLastWindowClose()
true
.
saveAll
public boolean saveAll()
true
if it succeeds.
sessionDidTimeOut
public void sessionDidTimeOut()
setCanQuit
public void setCanQuit(boolean flag)
setQuitsOnLastWindowClose
public void setQuitsOnLastWindowClose(boolean flag)
setWindowObserver
public void setWindowObserver(EOWindowObserver anEOWindowObserver)
toString
public String toString()
canQuit
and quitsOnLastWindowClose
flags.
windowObserver
public EOWindowObserver windowObserver()
© 2001 Apple Computer, Inc. (Last Published April 14, 2001)