Package org.geotools.swing.dialog
Class JTextReporter.Connection
Object
Connection
- Enclosing class:
- JTextReporter
A connection to an active text reporter dialog providing methods to update the text displayed, add or remove
listeners, and close the dialog programatically.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(TextReporterListener listener) Adds a listener.Appends a newline.appendSeparatorLine
(int n) Appends a line of repeatedJTextReporter.DEFAULT_SEPARATOR_CHAR
followed by a newline.appendSeparatorLine
(int n, char c) Appends a line consisting ofn
copies of charc
followed by a newline.void
Closes the associated dialog.getText()
Gets the currently displayed text.boolean
isOpen()
Queries whether this is an open connection, ie. the associated dialog has not been closed.void
Removes all currently registered listeners.void
removeListener
(TextReporterListener listener) Removes the listener if it is registered with this connection.
-
Method Details
-
isOpen
public boolean isOpen()Queries whether this is an open connection, ie. the associated dialog has not been closed. -
addListener
Adds a listener.- Parameters:
listener
- the listener- Throws:
IllegalArgumentException
- iflistener
isnull
-
removeListener
Removes the listener if it is registered with this connection.- Parameters:
listener
- the listener- Throws:
IllegalArgumentException
- iflistener
isnull
-
removeAllListeners
public void removeAllListeners()Removes all currently registered listeners. -
append
-
append
-
appendSeparatorLine
Appends a line of repeatedJTextReporter.DEFAULT_SEPARATOR_CHAR
followed by a newline. -
appendSeparatorLine
Appends a line consisting ofn
copies of charc
followed by a newline. -
appendNewline
Appends a newline. -
getText
Gets the currently displayed text. -
closeDialog
public void closeDialog()Closes the associated dialog. The close operation is run on the event dispatch thread to try to avoid collisions with GUI actions, but you can call this method from any thread.It is safe to call this method speculatively: a Level.INFO message will be logged but no error thrown.
-