|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.jdnc.app.Application
public class Application
Class which represents central state and properties for a single client application which can be either a standalone Java application (typically initiated using Java WebStart) or a set of one or more Java applets which share the same code base. There should only be a single Application instance per client application.
This class also encapsulates any functionality which has variable API between applets and Java WebStart applications so that UI components can reliably talk to a single interface for such services.
Constructor Summary | |
---|---|
Application()
|
Method Summary | |
---|---|
void |
addSelectionListener(SelectionListener l)
|
ActionManager |
getActionManager()
Return the action manager for this application. |
javax.swing.ActionMap |
getActionMap()
Return the action map associated with this application. |
static Application |
getApp(java.awt.Component c)
Convenience method for getting the JDNCapp instance given a component instance. |
java.util.Iterator |
getApplets()
|
java.net.URL |
getBaseURL()
|
static java.net.URL |
getBaseURL(java.lang.Object obj)
Will retrieve the applet base url if this application is running in an applet. |
static javax.swing.Icon |
getIcon(java.lang.String name,
java.lang.Object obj)
|
static java.awt.Image |
getImage(java.lang.String name,
java.lang.Object obj)
|
static Application |
getInstance()
Private constructor so that an Application can't be directly instantated. |
static Application |
getInstance(java.lang.Object key)
Factory method for obtaining the Application instance associated with the application designated by the specified key. |
SelectionListener[] |
getSelectionListeners()
|
java.awt.Image |
getSplashImage()
|
java.lang.String |
getTitle()
|
java.awt.Image |
getTitleBarImage()
|
static java.net.URL |
getURL(java.lang.String value,
java.lang.Object obj)
Fetches a url of a resource value using the clasloader and relative path of obj. |
static java.net.URL |
getURLResource(java.lang.String value,
java.lang.Object obj)
|
java.lang.String |
getVersionString()
|
java.util.Iterator |
getWindows()
|
boolean |
isRunningApplet()
Returns a boolean value indicating if the application is in an applet. |
boolean |
isRunningInSandbox()
Returns a boolean value indicating whether or not this application is running in the security sandbox |
boolean |
isRunningWebStart()
Returns a boolean value indicating if the application has been launched with Java WebStart. |
boolean |
isStandAlone()
Returns true if running as a standalone application and
returns false if running one or more applets. |
void |
registerApplet(java.applet.Applet applet)
|
void |
registerWindow(java.awt.Window window)
Registers a window with the application instance. |
void |
removeSelectionListener(SelectionListener l)
|
void |
setBaseURL(java.net.URL baseURL)
Sets the "baseURL" property of this application. |
void |
setSplashImage(java.awt.Image splashImage)
Sets the "splashImage" property of this application. |
void |
setTitle(java.lang.String title)
Sets the "title" property of this application. |
void |
setTitleBarImage(java.awt.Image titleBarImage)
Sets the "titleBarImage" property of this application. |
void |
setVersionString(java.lang.String versionString)
Sets the "versionString" property of this application. |
void |
showDocument(java.net.URL url,
java.lang.String target)
Display the document referenced by the url in a browser. |
void |
unregisterApplet(java.applet.Applet applet)
|
void |
unregisterWindow(java.awt.Window window)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Application()
Method Detail |
---|
public static Application getInstance()
public static Application getInstance(java.lang.Object key)
key
- object designating the application
public static Application getApp(java.awt.Component c)
c
- the ui component
public ActionManager getActionManager()
public void setBaseURL(java.net.URL baseURL)
baseURL
- URL of codebase for this applicationpublic java.net.URL getBaseURL()
public static java.net.URL getBaseURL(java.lang.Object obj)
public static java.net.URL getURL(java.lang.String value, java.lang.Object obj)
public static java.net.URL getURLResource(java.lang.String value, java.lang.Object obj)
public static java.awt.Image getImage(java.lang.String name, java.lang.Object obj)
public static javax.swing.Icon getIcon(java.lang.String name, java.lang.Object obj)
public void showDocument(java.net.URL url, java.lang.String target)
If the application is an Applet then the document will be shown from the browser from which it has been launched. If the application has been launched from Java WebStart then it will use the javax.jnlp.BasicService to show the document. If this is a standalone application then it will use the platform browser to show the document.
url
- an absolute URL giving locationto displaytarget
- indicates where to display the pageAppletContext.showDocument(java.net.URL, java.lang.String)
,
javax.jnlp.BasicService#showDocument
public void setSplashImage(java.awt.Image splashImage)
splashImage
- image displayed in the application's splash screenpublic java.awt.Image getSplashImage()
public void setTitle(java.lang.String title)
title
- string containing the title of this applicationpublic java.lang.String getTitle()
public void setTitleBarImage(java.awt.Image titleBarImage)
titleBarImage
- image displayed in titlebar of application's toplevel windowspublic java.awt.Image getTitleBarImage()
public void setVersionString(java.lang.String versionString)
versionString
- string containing the version of this applicationpublic java.lang.String getVersionString()
public boolean isStandAlone()
true
if running as a standalone application and
returns false
if running one or more applets.
public boolean isRunningInSandbox()
public boolean isRunningApplet()
public boolean isRunningWebStart()
public void registerWindow(java.awt.Window window)
public void unregisterWindow(java.awt.Window window)
public void registerApplet(java.applet.Applet applet)
public void unregisterApplet(java.applet.Applet applet)
public javax.swing.ActionMap getActionMap()
public java.util.Iterator getApplets()
public java.util.Iterator getWindows()
public void addSelectionListener(SelectionListener l)
public void removeSelectionListener(SelectionListener l)
public SelectionListener[] getSelectionListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |