org.geotools.swing.dialog
Class JTextReporter.Connection

Object
  extended by JTextReporter.Connection
Enclosing class:
JTextReporter

public static class JTextReporter.Connection
extends Object

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
 void addListener(TextReporterListener listener)
          Adds a listener.
 JTextReporter.Connection append(String text)
           
 JTextReporter.Connection append(String text, int indent)
           
 JTextReporter.Connection appendNewline()
          Appends a newline.
 JTextReporter.Connection appendSeparatorLine(int n)
          Appends a line of repeated JTextReporter.DEFAULT_SEPARATOR_CHAR followed by a newline.
 JTextReporter.Connection appendSeparatorLine(int n, char c)
          Appends a line consisting of n copies of char c followed by a newline.
 void closeDialog()
          Closes the associated dialog.
 String getText()
          Gets the currently displayed text.
 boolean isOpen()
          Queries whether this is an open connection, ie. the associated dialog has not been closed.
 void removeAllListeners()
          Removes all currently registered listeners.
 void removeListener(TextReporterListener listener)
          Removes the listener if it is registered with this connection.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isOpen

public boolean isOpen()
Queries whether this is an open connection, ie. the associated dialog has not been closed.


addListener

public void addListener(TextReporterListener listener)
Adds a listener.

Parameters:
listener - the listener
Throws:
IllegalArgumentException - if listener is null

removeListener

public void removeListener(TextReporterListener listener)
Removes the listener if it is registered with this connection.

Parameters:
listener - the listener
Throws:
IllegalArgumentException - if listener is null

removeAllListeners

public void removeAllListeners()
Removes all currently registered listeners.


append

public JTextReporter.Connection append(String text)

append

public JTextReporter.Connection append(String text,
                                       int indent)

appendSeparatorLine

public JTextReporter.Connection appendSeparatorLine(int n)
Appends a line of repeated JTextReporter.DEFAULT_SEPARATOR_CHAR followed by a newline.


appendSeparatorLine

public JTextReporter.Connection appendSeparatorLine(int n,
                                                    char c)
Appends a line consisting of n copies of char c followed by a newline.


appendNewline

public JTextReporter.Connection appendNewline()
Appends a newline.


getText

public String 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.



Copyright © 1996-2014 Geotools. All Rights Reserved.