|
NextApp Echo 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.EchoInstance
A single user-instance of an Echo application.
Field Summary | |
private static java.lang.ThreadLocal |
activeInstance
Holds a thread local reference to the active EchoInstance for easy retrieval. |
private java.util.Map |
attributes
An mutable map of application attributes. |
static Color |
DEFAULT_BACKGROUND
The default background color (white) |
static Font |
DEFAULT_FONT
The default font (10 point sans-serif) |
static Color |
DEFAULT_FOREGROUND
The default foreground color (black) |
static int |
DEFAULT_WINDOW_HEIGHT
The default window height (100 pixels). |
static int |
DEFAULT_WINDOW_WIDTH
The default window width (100 pixels). |
static java.lang.String |
FOCUSED_COMPONENT_CHANGED_PROPERTY
|
private java.lang.ref.WeakReference |
focusedComponent
The presently focused component. |
static java.lang.String |
ID_STRING
The name and version of the Echo API in use. |
private java.util.Locale |
locale
The default locale of the application. |
static java.lang.String |
LOCALE_CHANGED_PROPERTY
|
private java.beans.PropertyChangeSupport |
propertyChangeSupport
Fires property change events for the instance object. |
private java.util.Set |
windows
The set of all windows registered with the application. |
static java.lang.String |
WINDOWS_CHANGED_PROPERTY
|
Constructor Summary | |
EchoInstance()
Creates a new instance of this Echo application. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener to this instance. |
void |
addWindow(Window w)
Adds a new window to the application, causing it to then be displayed. |
void |
doExit()
Invoked by the application container when the application instance is to be destroyed. |
Window |
doInit()
Invoked by the application container to initialize the application. |
void |
doValidation()
Validates all components in all windows registered with the application. |
private void |
doValidation(Component c)
Validates a single component and then recursively validates its children. |
void |
exit()
Notifies the application that it has reached the end of its life, and should clean up any resources if required. |
java.lang.Object |
getAttribute(java.lang.String key)
Returns the value of an attribute. |
static EchoInstance |
getEchoInstance()
Returns a reference to the EchoInstance that is relevant
to the current thread. |
Component |
getFocusedComponent()
Returns the presently focused component, if known. |
java.util.Locale |
getLocale()
Returns the application instance's default locale. |
Window[] |
getWindows()
Returns an array of all windows registered with the application instance. |
protected abstract Window |
init()
Invoked to initialize the application, returning the primary window. |
void |
markActive(boolean active)
Marks this EchoInstance as active or inactive for the current thread. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener from this instance. |
void |
removeWindow(Window w)
Removes a window from the application, causing it to then be closed. |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets an attribute value. |
void |
setFocusedComponent(Component newValue)
Sets the presently focused component. |
void |
setLocale(java.util.Locale newValue)
Sets the application instance's default locale. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.ThreadLocal activeInstance
public static final Color DEFAULT_BACKGROUND
public static final Font DEFAULT_FONT
public static final Color DEFAULT_FOREGROUND
public static final int DEFAULT_WINDOW_HEIGHT
public static final int DEFAULT_WINDOW_WIDTH
public static final java.lang.String ID_STRING
public static final java.lang.String FOCUSED_COMPONENT_CHANGED_PROPERTY
public static final java.lang.String LOCALE_CHANGED_PROPERTY
public static final java.lang.String WINDOWS_CHANGED_PROPERTY
private java.util.Map attributes
private java.util.Set windows
private java.beans.PropertyChangeSupport propertyChangeSupport
private java.util.Locale locale
private java.lang.ref.WeakReference focusedComponent
Constructor Detail |
public EchoInstance()
Method Detail |
public static final EchoInstance getEchoInstance()
EchoInstance
that is relevant
to the current thread.
EchoInstance
.public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- The listener to be added.public void addWindow(Window w)
w
- A new window to be added to the application and displayed.public final void doExit()
public final Window doInit()
public final void doValidation()
private void doValidation(Component c)
c
- The component to be validated.public void exit()
public java.lang.Object getAttribute(java.lang.String key)
key
- The key (name) of the attribute.
public Component getFocusedComponent()
public java.util.Locale getLocale()
public Window[] getWindows()
protected abstract Window init()
public void markActive(boolean active)
active
- True if the EchoInstance should be marked active for the
current thread, false if it should be marked inactive.public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l
- The listener to be removed.public void removeWindow(Window w)
w
- A window that was previously added to the application that now
should be removed and closed.public void setAttribute(java.lang.String key, java.lang.Object value)
key
- The key (name) of the attribute.value
- The new value of the attribute.public void setFocusedComponent(Component newValue)
newValue
- The component to be focused.public void setLocale(java.util.Locale newValue)
newValue
- The new default locale.
|
NextApp Echo 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |