|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.appframework.ApplicationEnvironment
public class ApplicationEnvironment
An instance of Environment, which is an application, rather than an applet, or a servlet. The Environment mechanism is used to enable the provision of contextual runtime configuration parameter services in a way that is independent of the deployment structure.
| Nested Class Summary | |
|---|---|
protected static class |
ApplicationEnvironment.LaunchType
|
| Nested classes/interfaces inherited from interface ecologylab.appframework.Environment |
|---|
Environment.The |
| Field Summary | |
|---|---|
protected static java.lang.String |
ECLIPSE_PREFS_DIR
Subdirectory for eclipse launches. |
protected ParsedURL |
prefsPURL
Place where Prefs are loaded from and stored to. |
| Fields inherited from interface ecologylab.appframework.Environment |
|---|
APPLICATION, IE, NS, PLUGIN, the |
| Fields inherited from interface ecologylab.xml.XMLTranslationExceptionTypes |
|---|
FILE_NOT_FOUND, IO_EXCEPTION, NULL_PURL, UNKNOWN |
| Constructor Summary | |
|---|---|
ApplicationEnvironment(java.lang.Class baseClass,
java.lang.String applicationName,
java.lang.String[] args)
Create an ApplicationEnvironment. |
|
ApplicationEnvironment(java.lang.Class baseClass,
java.lang.String applicationName,
TranslationSpace translationSpace,
java.lang.String[] args,
float prefsAssetVersion)
Create an ApplicationEnvironment. |
|
ApplicationEnvironment(java.lang.String applicationName)
Create an ApplicationEnvironment. |
|
ApplicationEnvironment(java.lang.String applicationName,
java.lang.String[] args)
Create an ApplicationEnvironment. |
|
ApplicationEnvironment(java.lang.String applicationName,
TranslationSpace translationSpace,
java.lang.String[] args,
float prefsAssetVersion)
Create an ApplicationEnvironment. |
|
| Method Summary | |
|---|---|
DownloadProcessor |
assetsDownloadProcessor()
|
int |
browser()
Find out which browser we're running in. |
ParsedURL |
codeBase()
Change type from URL to ParsedURL. |
PrefEditorWidgets |
createPrefsEditor()
Create and show an editor for preferences, iff the MetaPrefSet and PrefSet are non-null. |
PrefEditorWidgets |
createPrefsEditor(boolean createJFrame,
boolean isStandalone)
Create and show an editor for preferences, iff the MetaPrefSet and PrefSet are non-null. |
ParsedURL |
docBase()
Change type from URL to ParsedURL. |
void |
exit(int code)
Called at the end of an invocation. |
protected ApplicationEnvironment.LaunchType |
launchType()
|
static ElementState |
lookupElementStatePreference(java.lang.String name)
Find a complex object set in preferences. |
java.lang.String |
lookupStringPreference(java.lang.String name)
Get a parameter or property, based on a key. |
protected MetaPrefSet |
metaPrefSet()
|
void |
navigate(ParsedURL purl,
java.lang.String frame)
Navigate to the purl using the best browser we can find. |
ParsedURL |
preferencesDir()
|
static java.lang.String |
preferencesFileRelativeFromArg0(java.lang.String[] args)
Form the parameter file path. |
static Scope |
preferencesRegistry()
|
protected PrefSet |
prefSet()
|
int |
runtimeEnv()
Find out which java runtime we're operating in. |
void |
setCodeBase(ParsedURL codeBase)
Set the codebase for the application. |
void |
showStatus(java.lang.String s)
|
void |
status(java.lang.String msg)
Show msg in the browser's status bar. |
TranslationSpace |
translationSpace()
Translation space used to parse Preferences for this Application. |
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String ECLIPSE_PREFS_DIR
protected ParsedURL prefsPURL
Prefs are loaded from and stored to.
| Constructor Detail |
|---|
public ApplicationEnvironment(java.lang.String applicationName)
throws XMLTranslationException
args - The args array, which is treated as a stack with optional entries. They are:
*) JNLP -- if that is the launch method
*) preferences file if you are running in eclipse. Relative to CODEBASE/config/preferences/
*) graphics_device (screen number)
*) screen_size (used in TopLevel --
1 - quarter; 2 - almost half; 3; near full; 4 full)
XMLTranslationException
public ApplicationEnvironment(java.lang.String applicationName,
TranslationSpace translationSpace,
java.lang.String[] args,
float prefsAssetVersion)
throws XMLTranslationException
applicationName - translationSpace - TranslationSpace used for translating preferences XML.
If this is null,
ecologylab.services.message.DefaultServicesTranslations
will be used.args - The args array, which is treated as a stack with optional entries. They are:
*) JNLP -- if that is the launch method
*) preferences file if you are running in eclipse. Relative to CODEBASE/config/preferences/
*) graphics_device (screen number)
*) screen_size (used in TopLevel --
1 - quarter; 2 - almost half; 3; near full; 4 full)prefsAssetVersion - TODO
XMLTranslationException
public ApplicationEnvironment(java.lang.String applicationName,
java.lang.String[] args)
throws XMLTranslationException
ecologylab.services.message.DefaultServicesTranslations
will be used.
applicationName - ecologylab.services.message.DefaultServicesTranslations
will be used.args - The args array, which is treated as a stack with optional entries. They are:
*) JNLP -- if that is the launch method
*) preferences file if you are running in eclipse. Relative to CODEBASE/config/preferences/
*) graphics_device (screen number)
*) screen_size (used in TopLevel --
1 - quarter; 2 - almost half; 3; near full; 4 full)
XMLTranslationException
public ApplicationEnvironment(java.lang.Class baseClass,
java.lang.String applicationName,
java.lang.String[] args)
throws XMLTranslationException
ecologylab.services.message.DefaultServicesTranslations
will be used.
baseClass - Used for computing codeBase property.applicationName - args - The args array, which is treated as a stack with optional entries. They are:
*) JNLP -- if that is the launch method
*) preferences file if you are running in eclipse. Relative to CODEBASE/config/preferences/
*) graphics_device (screen number)
*) screen_size (used in TopLevel --
1 - quarter; 2 - almost half; 3; near full; 4 full
XMLTranslationException
public ApplicationEnvironment(java.lang.Class baseClass,
java.lang.String applicationName,
TranslationSpace translationSpace,
java.lang.String[] args,
float prefsAssetVersion)
throws XMLTranslationException
ecologylab.services.message.DefaultServicesTranslations
will be used.
baseClass - Used for computing codeBase property.applicationName - Name of the application.translationSpace - TranslationSpace used for translating preferences XML.
If this is null,
ecologylab.services.message.DefaultServicesTranslations
will be used.args - The args array, which is treated as a stack with optional entries. They are:
*) JNLP -- if that is the launch method
*) preferences file if you are running in eclipse. Relative to CODEBASE/config/preferences/
*) graphics_device (screen number)
*) screen_size (used in TopLevel --
1 - quarter; 2 - almost half; 3; near full; 4 full)prefsAssetVersion - TODO
XMLTranslationException| Method Detail |
|---|
public int runtimeEnv()
Environment
runtimeEnv in interface EnvironmentEnvironment.runtimeEnv()public void showStatus(java.lang.String s)
Environment.status(String)public void status(java.lang.String msg)
Environmentmsg in the browser's status bar.
Short form, with for (@link java.cm.applet.Applet#showStatus).
Also more robust: avoids breaking when msg is null.
status in interface EnvironmentEnvironment.status(String)public java.lang.String lookupStringPreference(java.lang.String name)
Environment
lookupStringPreference in interface Environmentname - The name of the key.Environment.lookupStringPreference(String)public ParsedURL codeBase()
Environment
codeBase in interface Environmentreturn the path to root of thepublic ParsedURL docBase()
Environment
docBase in interface Environmentreturn the current working directory of the application
which is "c:\web\code\java\cm"public ParsedURL preferencesDir()
public void navigate(ParsedURL purl,
java.lang.String frame)
navigate in interface Environmentpurl - frame - public int browser()
Environment
browser in interface Environmentpublic void exit(int code)
exit in interface Environmentcode - -- 0 for normal. other values are application specific.public static java.lang.String preferencesFileRelativeFromArg0(java.lang.String[] args)
args -
public void setCodeBase(ParsedURL codeBase)
public static Scope preferencesRegistry()
public static ElementState lookupElementStatePreference(java.lang.String name)
name -
public TranslationSpace translationSpace()
public DownloadProcessor assetsDownloadProcessor()
public PrefEditorWidgets createPrefsEditor()
public PrefEditorWidgets createPrefsEditor(boolean createJFrame,
boolean isStandalone)
protected ApplicationEnvironment.LaunchType launchType()
protected MetaPrefSet metaPrefSet()
protected PrefSet prefSet()
Prefs associated with this application.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||