39 |
package javax.swing; |
package javax.swing; |
40 |
|
|
41 |
import java.awt.Component; |
import java.awt.Component; |
|
import java.io.IOException; |
|
|
import java.io.ObjectOutputStream; |
|
42 |
|
|
43 |
import javax.swing.text.AttributeSet; |
import javax.swing.text.AttributeSet; |
44 |
import javax.swing.text.BadLocationException; |
import javax.swing.text.BadLocationException; |
47 |
import javax.swing.text.EditorKit; |
import javax.swing.text.EditorKit; |
48 |
import javax.swing.text.Element; |
import javax.swing.text.Element; |
49 |
import javax.swing.text.MutableAttributeSet; |
import javax.swing.text.MutableAttributeSet; |
|
import javax.swing.text.SimpleAttributeSet; |
|
50 |
import javax.swing.text.Style; |
import javax.swing.text.Style; |
51 |
import javax.swing.text.StyledDocument; |
import javax.swing.text.StyledDocument; |
52 |
import javax.swing.text.StyledEditorKit; |
import javax.swing.text.StyledEditorKit; |
103 |
* @throws IllegalArgumentException if <code>document</code> is not an |
* @throws IllegalArgumentException if <code>document</code> is not an |
104 |
* instance of <code>StyledDocument</code> |
* instance of <code>StyledDocument</code> |
105 |
* |
* |
106 |
* @see {@link #setStyledDocument} |
* @see #setStyledDocument |
107 |
*/ |
*/ |
108 |
public void setDocument(Document document) |
public void setDocument(Document document) |
109 |
{ |
{ |
117 |
/** |
/** |
118 |
* Returns the {@link StyledDocument} that is the content model for |
* Returns the {@link StyledDocument} that is the content model for |
119 |
* this <code>JTextPane</code>. This is a typed wrapper for |
* this <code>JTextPane</code>. This is a typed wrapper for |
120 |
* {@link #getDocument}. |
* {@link #getDocument()}. |
121 |
* |
* |
122 |
* @return the content model of this <code>JTextPane</code> |
* @return the content model of this <code>JTextPane</code> |
123 |
*/ |
*/ |
176 |
doc.setCharacterAttributes(start, contentLength, getInputAttributes(), |
doc.setCharacterAttributes(start, contentLength, getInputAttributes(), |
177 |
true); |
true); |
178 |
|
|
|
// Set dot to new position. |
|
|
setCaretPosition(start + contentLength); |
|
179 |
} |
} |
180 |
catch (BadLocationException e) |
catch (BadLocationException e) |
181 |
{ |
{ |
295 |
* @param replace if <code>true</code>, the attributes of the current |
* @param replace if <code>true</code>, the attributes of the current |
296 |
* selection are overridden, otherwise they are merged |
* selection are overridden, otherwise they are merged |
297 |
* |
* |
298 |
* @see {@link #getInputAttributes} |
* @see #getInputAttributes |
299 |
*/ |
*/ |
300 |
public void setCharacterAttributes(AttributeSet attribute, |
public void setCharacterAttributes(AttributeSet attribute, |
301 |
boolean replace) |
boolean replace) |