|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.event.MessageSourceSupport
public class MessageSourceSupport
A helper class which is an implementation of a message source and a progress source. This class manages the listener list and has convenience methods to fire MessageEvents and ProgressEvents.
MessageEvent
,
MessageSource
,
ProgressEvent
,
ProgressSource
Constructor Summary | |
---|---|
MessageSourceSupport(Object source)
Creates an MessageSource instance using the source object as the source of events. |
Method Summary | |
---|---|
void |
addMessageListener(MessageListener l)
Register the MessageListener. |
void |
addProgressListener(ProgressListener l)
Register the ProgressListener. |
void |
fireException(Throwable t)
Create a SEVERE MessageEvent which represents an Exception. |
void |
fireMessage(MessageEvent evt)
Send the MessageEvent to the list of listeners. |
void |
fireMessage(Object value,
Level level)
Send a non-timestamped message to the list of listeners. |
void |
fireMessage(Object value,
Level level,
long when)
Send a message to the list of listeners with a timestamp. |
void |
fireMessage(String message)
Send a Level.INFO, non-timestamped message to the list of listeners. |
void |
fireProgressEnded()
Indicates that a progress operation has completed |
void |
fireProgressEnded(ProgressEvent evt)
Send the ProgessEvent to the list of listeners. |
void |
fireProgressIncremented(int progress)
Indicates that an increment of progress has occured. |
void |
fireProgressIncremented(ProgressEvent evt)
Send the ProgessEvent to the list of listeners. |
void |
fireProgressStarted(int minimum,
int maximum)
Indicates that a long operation is staring. |
void |
fireProgressStarted(ProgressEvent evt)
Send the ProgessEvent to the list of listeners. |
MessageListener[] |
getMessageListeners()
Returns an array of listeners. |
ProgressListener[] |
getProgressListeners()
Returns an array of listeners. |
void |
removeMessageListener(MessageListener l)
Unregister the MessageListener from the MessageSource. |
void |
removeProgressListener(ProgressListener l)
Unregister the ProgressListener from the ProgressSource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageSourceSupport(Object source)
Method Detail |
---|
public void addMessageListener(MessageListener l)
MessageSource
addMessageListener
in interface MessageSource
l
- the listener to registerpublic void removeMessageListener(MessageListener l)
MessageSource
removeMessageListener
in interface MessageSource
l
- the listener to unregisterpublic MessageListener[] getMessageListeners()
MessageSource
getMessageListeners
in interface MessageSource
public void addProgressListener(ProgressListener l)
ProgressSource
addProgressListener
in interface ProgressSource
l
- the listener to registerpublic void removeProgressListener(ProgressListener l)
ProgressSource
removeProgressListener
in interface ProgressSource
l
- the listener to unregisterpublic ProgressListener[] getProgressListeners()
ProgressSource
getProgressListeners
in interface ProgressSource
public void fireProgressStarted(int minimum, int maximum)
minimum
- the minimum value of the progress operationmaximum
- the maximum value of the progress operationpublic void fireProgressIncremented(int progress)
progress
- total value of the progress operation. This value should
be between the minimum and maximum valuespublic void fireProgressEnded()
public void fireException(Throwable t)
NOTE: This will create an event which is by default at Level.SEVERE
Level
public void fireMessage(String message)
message
- a string of text to sendpublic void fireMessage(Object value, Level level)
value
- the contents of the messagelevel
- the level of message.public void fireMessage(Object value, Level level, long when)
value
- the contents of the messagelevel
- the level of messagewhen
- timestamp of when this event occuredpublic void fireMessage(MessageEvent evt)
evt
- a non-null MessageEvent.public void fireProgressIncremented(ProgressEvent evt)
evt
- a non-null ProgressEventpublic void fireProgressStarted(ProgressEvent evt)
evt
- a non-null ProgressEventpublic void fireProgressEnded(ProgressEvent evt)
evt
- a non-null ProgressEvent
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |