diff options
author | Michael Koch <konqueror@gmx.de> | 2003-03-21 09:18:31 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-03-21 09:18:31 +0000 |
commit | 30b3f142281e886b688b852374172d3abeb3239a (patch) | |
tree | d95ec68bafbb0d8912496fa08e30ed162f0c53f0 /libjava/javax/swing/text | |
parent | 15596d409e8ace9a7fcd31cdbe3dc7917e3fab7a (diff) | |
download | gcc-30b3f142281e886b688b852374172d3abeb3239a.tar.gz |
2003-03-21 Michael Koch <konqueror@gmx.de>
* javax/swing/Action.java
(ACCELERATOR_KEY): New constant.
(ACTION_COMMAND_KEY): Likewise.
(MNEMONIC_KEY): Likewise.
* javax/swing/UnsupportedLookAndFeelException.java
(UnsupportedLookAndFeelException): Must be public.
* javax/swing/WindowConstants.java
(EXIT_ON_CLOSE): New constant.
* javax/swing/text/BadLocationException.java
(offset): New member variable.
(BadLocationException): New implementation, documentation added.
(offsetRequested): New method.
* javax/swing/text/Caret.java:
Reformated.
* javax/swing/text/Document.java:
Reformated.
From-SVN: r64656
Diffstat (limited to 'libjava/javax/swing/text')
-rw-r--r-- | libjava/javax/swing/text/BadLocationException.java | 24 | ||||
-rw-r--r-- | libjava/javax/swing/text/Caret.java | 50 | ||||
-rw-r--r-- | libjava/javax/swing/text/Document.java | 38 |
3 files changed, 75 insertions, 37 deletions
diff --git a/libjava/javax/swing/text/BadLocationException.java b/libjava/javax/swing/text/BadLocationException.java index 81e6cc8dc03..d62ad5465f9 100644 --- a/libjava/javax/swing/text/BadLocationException.java +++ b/libjava/javax/swing/text/BadLocationException.java @@ -40,7 +40,25 @@ package javax.swing.text; public class BadLocationException extends Exception { - BadLocationException() - { - } + int offset; + + /** + * Constructs a <code>BadLocationException</code> + * + * @param str A string indicating what was wrong with the arguments + * @param offset Offset within the document that was requested >= 0 + */ + public BadLocationException (String str, int offset) + { + super (str); + this.offset = offset; + } + + /** + * Returns the offset into the document that was not legal + */ + public int offsetRequested () + { + return offset; + } } diff --git a/libjava/javax/swing/text/Caret.java b/libjava/javax/swing/text/Caret.java index c013937f00c..f78f24edf1d 100644 --- a/libjava/javax/swing/text/Caret.java +++ b/libjava/javax/swing/text/Caret.java @@ -42,21 +42,37 @@ import javax.swing.event.*; public interface Caret { - void addChangeListener(ChangeListener l); - void deinstall(JTextComponent c); - int getBlinkRate(); - int getDot(); - Point getMagicCaretPosition(); - int getMark(); - void install(JTextComponent c); - boolean isSelectionVisible(); - boolean isVisible(); - void moveDot(int dot); - void paint(Graphics g); - void removeChangeListener(ChangeListener l); - void setBlinkRate(int rate); - void setDot(int dot); - void setMagicCaretPosition(Point p); - void setSelectionVisible(boolean v); - void setVisible(boolean v); + void addChangeListener(ChangeListener l); + + void deinstall(JTextComponent c); + + int getBlinkRate(); + + int getDot(); + + Point getMagicCaretPosition(); + + int getMark(); + + void install(JTextComponent c); + + boolean isSelectionVisible(); + + boolean isVisible(); + + void moveDot(int dot); + + void paint(Graphics g); + + void removeChangeListener(ChangeListener l); + + void setBlinkRate(int rate); + + void setDot(int dot); + + void setMagicCaretPosition(Point p); + + void setSelectionVisible(boolean v); + + void setVisible(boolean v); } diff --git a/libjava/javax/swing/text/Document.java b/libjava/javax/swing/text/Document.java index 398030f0849..fa7b1ce2817 100644 --- a/libjava/javax/swing/text/Document.java +++ b/libjava/javax/swing/text/Document.java @@ -42,21 +42,25 @@ import javax.swing.event.*; public interface Document { - void addDocumentListener(DocumentListener listener); - void addUndoableEditListener(UndoableEditListener listener); - Position createPosition(int offs); - Element getDefaultRootElement(); - Position getEndPosition(); - int getLength(); - Object getProperty(Object key); - Element[] getRootElements(); - Position getStartPosition(); - String getText(int offset, int length); - void getText(int offset, int length, Segment txt); - void insertString(int offset, String str, AttributeSet a); - void putProperty(Object key, Object value); - void remove(int offs, int len); - void removeDocumentListener(DocumentListener listener); - void removeUndoableEditListener(UndoableEditListener listener); - void render(Runnable r); + public static final String StreamDescriptionProperty = "stream"; + + public static final String TitleProperty = "text"; + + void addDocumentListener(DocumentListener listener); + void addUndoableEditListener(UndoableEditListener listener); + Position createPosition(int offs); + Element getDefaultRootElement(); + Position getEndPosition(); + int getLength(); + Object getProperty(Object key); + Element[] getRootElements(); + Position getStartPosition(); + String getText(int offset, int length); + void getText(int offset, int length, Segment txt); + void insertString(int offset, String str, AttributeSet a); + void putProperty(Object key, Object value); + void remove(int offs, int len); + void removeDocumentListener(DocumentListener listener); + void removeUndoableEditListener(UndoableEditListener listener); + void render(Runnable r); } |