|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object thinwire.ui.Application
public abstract class Application
The Application class represents an instance of a ThinWire application. Methods in this class are those that directly affect the system and it's environment.
Nested Class Summary | |
---|---|
static class |
Application.Local<T>
|
Constructor Summary | |
---|---|
protected |
Application()
|
Method Summary | |
---|---|
void |
addExceptionListener(ExceptionListener listener)
|
void |
addGlobalActionListener(java.lang.String[] actions,
ActionListener listener)
Adds a ActionListener that will be notified when any of the specified actions occur on
any new component. |
void |
addGlobalActionListener(java.lang.String action,
ActionListener listener)
Adds a ActionListener that will be notified when the specified action occurs on any new component. |
void |
addGlobalDropListener(Component[] dragSources,
DropListener listener)
|
void |
addGlobalDropListener(Component dragSource,
DropListener listener)
|
void |
addGlobalItemChangeListener(ItemChangeListener listener)
|
void |
addGlobalKeyPressListener(java.lang.String[] keyPressCombos,
KeyPressListener listener)
|
void |
addGlobalKeyPressListener(java.lang.String keyPressCombo,
KeyPressListener listener)
|
void |
addGlobalPropertyChangeListener(java.lang.String[] propertyNames,
PropertyChangeListener listener)
Adds a PropertyChangeListener that will be notified when any of the specified properties of
any new component changes. |
void |
addGlobalPropertyChangeListener(java.lang.String propertyName,
PropertyChangeListener listener)
Adds a PropertyChangeListener that will be notified when the specified property of any new component changes. |
abstract void |
addTimerTask(java.lang.Runnable task,
long milliseconds)
|
abstract void |
addTimerTask(java.lang.Runnable task,
long milliseconds,
boolean repeat)
|
protected abstract void |
captureThread()
|
static Application |
current()
|
abstract java.lang.String |
getBaseFolder()
|
static Style |
getDefaultStyle(java.lang.Class<? extends Component> clazz)
|
protected java.util.Map<java.lang.Class<? extends Component>,Style> |
getDefaultStyles()
|
protected abstract FileChooser.FileInfo |
getFileInfo()
|
Frame |
getFrame()
Gets the Frame that represents the primary application window. |
static java.util.Map<java.lang.String,java.lang.String> |
getPlatformVersionInfo()
Returns the current version info details for the platform. |
Component |
getPriorFocus()
Returns the Component that previously had focus in the Application. |
protected abstract java.lang.String |
getQualifiedURL(java.lang.String location)
|
java.io.File |
getRelativeFile(java.lang.String pathname)
|
java.io.File |
getRelativeFile(java.lang.String parent,
java.lang.String child)
|
static java.io.InputStream |
getResourceAsStream(java.lang.String uri)
Returns an InputStream representing the specified resource. |
static byte[] |
getResourceBytes(java.lang.String uri)
|
protected java.util.Map<java.lang.String,Color> |
getSystemColors()
|
protected java.lang.String |
getSystemFile(java.lang.String value)
|
protected java.util.Map<java.lang.String,java.lang.String> |
getSystemImages()
|
protected abstract void |
hideWindow(Window w)
|
protected void |
loadStyleSheet(java.lang.String styleSheet)
|
static void |
main(java.lang.String[] args)
Displays a version detail dialog. |
protected abstract void |
releaseThread()
|
void |
removeExceptionListener(ExceptionListener listener)
|
protected abstract void |
removeFileFromMap(java.lang.String location)
|
void |
removeGlobalActionListener(ActionListener listener)
Unregister an ActionListener from all action event notifications from any component. |
void |
removeGlobalDropListener(DropListener listener)
|
void |
removeGlobalItemChangeListener(ItemChangeListener listener)
|
void |
removeGlobalKeyPressListener(KeyPressListener listener)
|
void |
removeGlobalPropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the list of global listeners that are added to all
new Component 's. |
abstract void |
removeTimerTask(java.lang.Runnable task)
|
void |
reportException(java.lang.Object source,
java.lang.Throwable exception)
|
abstract void |
resetTimerTask(java.lang.Runnable task)
|
protected java.lang.Object |
setPackagePrivateMember(java.lang.String memberName,
Component comp,
java.lang.Object value)
|
protected abstract void |
showWindow(Window w)
|
static void |
writeResourceToStream(java.lang.String uri,
java.io.OutputStream os)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Application()
Method Detail |
---|
public static java.util.Map<java.lang.String,java.lang.String> getPlatformVersionInfo()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
public static Application current()
public static java.io.InputStream getResourceAsStream(java.lang.String uri)
getRelativeFile(java.lang.String)
public static byte[] getResourceBytes(java.lang.String uri)
public static void writeResourceToStream(java.lang.String uri, java.io.OutputStream os)
public static Style getDefaultStyle(java.lang.Class<? extends Component> clazz)
public void addGlobalPropertyChangeListener(java.lang.String propertyName, PropertyChangeListener listener)
PropertyChangeListener
that will be notified when the specified property of any new component changes. To
further clarify, a global property change listener will receive an event notification for any component that is created after
this global property change listener is added, for which the specified property changes. Therefore, establishing a global
property change listener is the same as invoking the Component.addPropertyChangeListener(String, PropertyChangeListener)
method on every component after it's creation.
As a general rule, you should avoid using this feature because it can cause a large volume of events to be generated. This is
especially true if you listen to a frequently updated property, such as PROPERTY_TEXT
. However, there are
cases where this can be quite useful. One such case is when you use the 'userObject' property to store a boolean state that
indicates whether a value is required for the component. In such a case, you can establish a global property change listener
for 'userObject' and then based on the property being set to true
you could update the background color so it
is apparent to the user that a value is required.
Component.addGlobalPropertyChangeListener(Component.PROPERTY_USER_OBJECT, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent pce) { Component comp = (Component) pce.getSource(); if (comp.getUserObject() == Boolean.TRUE) { comp.getStyle().getBackground().setColor(Color.PALEGOLDENROD); } else { comp.getStyle().getBackground().setColor(null); //restore the default background color } } }); TextField tf = new TextField(); tf.setUserObject(Boolean.TRUE); //Causes background color to be set to Color.PALEGOLDENROD tf.setUserObject(Boolean.FALSE); //Causes background color to be set to the default.
propertyName
- the name of the property that the listener will receive change events for.listener
- the listener that will receive PropertyChangeEvent
objects upon the property of any new component changing.
java.lang.IllegalArgumentException
- if listener
or propertyName
is null or if
propertyName
is an empty string.Component.addPropertyChangeListener(String, PropertyChangeListener)
,
PropertyChangeListener
,
PropertyChangeEvent
public void addGlobalPropertyChangeListener(java.lang.String[] propertyNames, PropertyChangeListener listener)
PropertyChangeListener
that will be notified when any of the specified properties of
any new component changes. This method is equivalent to calling
addGlobalPropertyChangeListener(String, PropertyChangeListener)
once for each property you want to listen to.
propertyNames
- a string array of property names that the listener will receive change events for.listener
- the listerner that will receive PropertyChangeEvent
objects anytime one of the specified
propertyNames of any new component change.
java.lang.IllegalArgumentException
- if listener
, propertyNames
or any property name is the array is null or if
any property name is an empty string.addGlobalPropertyChangeListener(String, PropertyChangeListener)
,
Component.addPropertyChangeListener(String[], PropertyChangeListener)
,
PropertyChangeListener
,
PropertyChangeEvent
public void removeGlobalPropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListener
from the list of global listeners that are added to all
new Component
's. To further clarify, removing a global property change listener will NOT
remove the listener
from Component
's that have already been created.
listener
- the listener to remove from the notification list.
java.lang.IllegalArgumentException
- if listener
is null.PropertyChangeListener
public void addGlobalActionListener(java.lang.String action, ActionListener listener)
ActionListener
that will be notified when the specified action occurs on any new component. To
further clarify, a global action listener will receive an event notification for any component that is created after
this global action listener is added, on which the specified action occurs. Therefore, establishing a global
action listener is the same as invoking the Component.addActionListener(String, ActionListener)
method on every component after it's creation.
action
- the action to specficially be notified of.listener
- the event listener that will receive notification.public void addGlobalActionListener(java.lang.String[] actions, ActionListener listener)
ActionListener
that will be notified when any of the specified actions occur on
any new component. This method is equivalent to calling
addGlobalActionListener(String, ActionListener)
once for each action you want to receive notification for.
actions
- the actions to specficially be notified of.listener
- the event listener that will receive notifications.public void removeGlobalActionListener(ActionListener listener)
ActionListener
from all action event notifications from any component.
listener
- the listener that should no longer receive action event notifications.public void addGlobalDropListener(Component dragSource, DropListener listener)
public void addGlobalDropListener(Component[] dragSources, DropListener listener)
public void removeGlobalDropListener(DropListener listener)
public void addGlobalKeyPressListener(java.lang.String keyPressCombo, KeyPressListener listener)
public void addGlobalKeyPressListener(java.lang.String[] keyPressCombos, KeyPressListener listener)
public void removeGlobalKeyPressListener(KeyPressListener listener)
public void addGlobalItemChangeListener(ItemChangeListener listener)
public void removeGlobalItemChangeListener(ItemChangeListener listener)
public void addExceptionListener(ExceptionListener listener)
listener
- public void removeExceptionListener(ExceptionListener listener)
listener
- public void reportException(java.lang.Object source, java.lang.Throwable exception)
source
- exception
- public Frame getFrame()
Frame
that represents the primary application window.
Frame
that represents the primary application window.public Component getPriorFocus()
Component
that previously had focus in the Application. The Component
that
previously had focus is the last Component
in ANY window that held the focus. This is different from the
behavior of the focus property in which their is one Component
with focus PER window.
Component
that previously had focus in the Application, or null if no Component
has
had prior focus.Component.isFocus()
,
Component.setFocus(boolean)
protected void loadStyleSheet(java.lang.String styleSheet)
protected java.lang.String getSystemFile(java.lang.String value)
protected java.util.Map<java.lang.Class<? extends Component>,Style> getDefaultStyles()
protected java.util.Map<java.lang.String,Color> getSystemColors()
protected java.util.Map<java.lang.String,java.lang.String> getSystemImages()
public abstract java.lang.String getBaseFolder()
public java.io.File getRelativeFile(java.lang.String pathname)
pathname
-
public java.io.File getRelativeFile(java.lang.String parent, java.lang.String child)
parent
- child
-
protected java.lang.Object setPackagePrivateMember(java.lang.String memberName, Component comp, java.lang.Object value)
protected abstract void captureThread()
protected abstract void releaseThread()
protected abstract void showWindow(Window w)
protected abstract void hideWindow(Window w)
protected abstract FileChooser.FileInfo getFileInfo()
protected abstract java.lang.String getQualifiedURL(java.lang.String location)
protected abstract void removeFileFromMap(java.lang.String location)
public abstract void addTimerTask(java.lang.Runnable task, long milliseconds)
task
- milliseconds
- public abstract void addTimerTask(java.lang.Runnable task, long milliseconds, boolean repeat)
task
- milliseconds
- repeat
- public abstract void resetTimerTask(java.lang.Runnable task)
task
- public abstract void removeTimerTask(java.lang.Runnable task)
task
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |