jdk/src/share/classes/javax/swing/JTextPane.java
Print this page
*** 23,41 ****
* questions.
*/
package javax.swing;
import java.awt.*;
! import java.awt.event.ActionEvent;
!
import java.io.ObjectOutputStream;
- import java.io.ObjectInputStream;
import java.io.IOException;
import javax.swing.text.*;
- import javax.swing.event.*;
- import javax.swing.plaf.*;
/**
* A text component that can be marked up with attributes that are
* represented graphically.
* You can find how-to information and examples of using text panes in
--- 23,38 ----
* questions.
*/
package javax.swing;
import java.awt.*;
! import java.beans.JavaBean;
! import java.beans.BeanProperty;
import java.io.ObjectOutputStream;
import java.io.IOException;
import javax.swing.text.*;
/**
* A text component that can be marked up with attributes that are
* represented graphically.
* You can find how-to information and examples of using text panes in
*** 70,87 ****
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
- * @beaninfo
- * attribute: isContainer true
- * description: A text component that can be marked up with attributes that are graphically represented.
- *
* @author Timothy Prinzing
* @see javax.swing.text.StyledEditorKit
* @since 1.2
*/
@SuppressWarnings("serial") // Same-version serialization only
public class JTextPane extends JEditorPane {
/**
* Creates a new <code>JTextPane</code>. A new instance of
--- 67,82 ----
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Timothy Prinzing
* @see javax.swing.text.StyledEditorKit
* @since 1.2
*/
+ @JavaBean(description = "A text component that can be marked up with attributes that are graphically represented.")
+ @SwingContainer
@SuppressWarnings("serial") // Same-version serialization only
public class JTextPane extends JEditorPane {
/**
* Creates a new <code>JTextPane</code>. A new instance of
*** 118,127 ****
--- 113,123 ----
* @return the string "TextPaneUI"
*
* @see JComponent#getUIClassID
* @see UIDefaults#getUI
*/
+ @BeanProperty(bound = false)
public String getUIClassID() {
return uiClassID;
}
/**
*** 336,345 ****
--- 332,342 ----
* Fetches the character attributes in effect at the
* current location of the caret, or <code>null</code>.
*
* @return the attributes, or <code>null</code>
*/
+ @BeanProperty(bound = false)
public AttributeSet getCharacterAttributes() {
StyledDocument doc = getStyledDocument();
Element run = doc.getCharacterElement(getCaretPosition());
if (run != null) {
return run.getAttributes();
*** 377,386 ****
--- 374,384 ----
* Fetches the current paragraph attributes in effect
* at the location of the caret, or <code>null</code> if none.
*
* @return the attributes
*/
+ @BeanProperty(bound = false)
public AttributeSet getParagraphAttributes() {
StyledDocument doc = getStyledDocument();
Element paragraph = doc.getParagraphElement(getCaretPosition());
if (paragraph != null) {
return paragraph.getAttributes();
*** 408,417 ****
--- 406,416 ----
/**
* Gets the input attributes for the pane.
*
* @return the attributes
*/
+ @BeanProperty(bound = false)
public MutableAttributeSet getInputAttributes() {
return getStyledEditorKit().getInputAttributes();
}
/**