summaryrefslogtreecommitdiff
path: root/toolkit/test
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-04-11 16:14:43 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-04-11 16:14:43 +0000
commitd8c9f4b3ff67d6bd81647662a780b795913d0786 (patch)
tree58d1880aa403793c84a3d3474e542de836ad2c24 /toolkit/test
parent3eb3ee233376003a97c9a20962060453ed52af32 (diff)
INTEGRATION: CWS vcl07 (1.3.2); FILE ADDED
2003/04/08 14:29:02 obr 1.3.2.1: re-added accessibility workbench
Diffstat (limited to 'toolkit/test')
-rw-r--r--toolkit/test/accessibility/TextLogger.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/toolkit/test/accessibility/TextLogger.java b/toolkit/test/accessibility/TextLogger.java
new file mode 100644
index 000000000000..e0ee56fd691d
--- /dev/null
+++ b/toolkit/test/accessibility/TextLogger.java
@@ -0,0 +1,52 @@
+import javax.swing.JEditorPane;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.text.Document;
+import java.net.URL;
+
+class TextLogger
+ extends JEditorPane
+{
+ public TextLogger ()
+ throws java.io.IOException
+ {
+// maDocument = getEditorKit().createDefaultDocument();
+ super ("http://localhost");
+ try
+ {
+ // setPage (new URL ("http://www.spiegel.de"));
+ }
+ catch (Exception e)
+ {}
+
+ setEditable (false);
+ final JEditorPane finalPane = this;
+ addHyperlinkListener (new HyperlinkListener()
+ {
+ public void hyperlinkUpdate (HyperlinkEvent e)
+ {
+ try
+ {
+ if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
+ finalPane.setPage (e.getURL());
+ }
+ catch (java.io.IOException ex)
+ {
+ ex.printStackTrace(System.err);
+ }
+ }
+ });
+ }
+
+ public void appendText (String sText)
+ {
+ try
+ {
+ maDocument.insertString (maDocument.getLength(), sText, null);
+ }
+ catch (javax.swing.text.BadLocationException e)
+ {}
+ }
+
+ private Document maDocument;
+}