src/share/classes/javax/swing/text/EditorKit.java

Print this page




  29 import javax.swing.JEditorPane;
  30 
  31 /**
  32  * Establishes the set of things needed by a text component
  33  * to be a reasonably functioning editor for some <em>type</em>
  34  * of text content.  The EditorKit acts as a factory for some
  35  * kind of policy.  For example, an implementation
  36  * of html and rtf can be provided that is replaceable
  37  * with other implementations.
  38  * <p>
  39  * A kit can safely store editing state as an instance
  40  * of the kit will be dedicated to a text component.
  41  * New kits will normally be created by cloning a
  42  * prototype kit.  The kit will have it's
  43  * <code>setComponent</code> method called to establish
  44  * it's relationship with a JTextComponent.
  45  *
  46  * @author  Timothy Prinzing
  47  */
  48 public abstract class EditorKit implements Cloneable, Serializable {

  49 
  50     /**
  51      * Construct an EditorKit.
  52      */
  53     public EditorKit() {
  54     }
  55 
  56     /**
  57      * Creates a copy of the editor kit.  This is implemented
  58      * to use <code>Object.clone()</code>.  If the kit cannot be cloned,
  59      * null is returned.
  60      *
  61      * @return the copy
  62      */
  63     public Object clone() {
  64         Object o;
  65         try {
  66             o = super.clone();
  67         } catch (CloneNotSupportedException cnse) {
  68             o = null;




  29 import javax.swing.JEditorPane;
  30 
  31 /**
  32  * Establishes the set of things needed by a text component
  33  * to be a reasonably functioning editor for some <em>type</em>
  34  * of text content.  The EditorKit acts as a factory for some
  35  * kind of policy.  For example, an implementation
  36  * of html and rtf can be provided that is replaceable
  37  * with other implementations.
  38  * <p>
  39  * A kit can safely store editing state as an instance
  40  * of the kit will be dedicated to a text component.
  41  * New kits will normally be created by cloning a
  42  * prototype kit.  The kit will have it's
  43  * <code>setComponent</code> method called to establish
  44  * it's relationship with a JTextComponent.
  45  *
  46  * @author  Timothy Prinzing
  47  */
  48 public abstract class EditorKit implements Cloneable, Serializable {
  49     private static final long serialVersionUID = -5044124649345887822L;
  50 
  51     /**
  52      * Construct an EditorKit.
  53      */
  54     public EditorKit() {
  55     }
  56 
  57     /**
  58      * Creates a copy of the editor kit.  This is implemented
  59      * to use <code>Object.clone()</code>.  If the kit cannot be cloned,
  60      * null is returned.
  61      *
  62      * @return the copy
  63      */
  64     public Object clone() {
  65         Object o;
  66         try {
  67             o = super.clone();
  68         } catch (CloneNotSupportedException cnse) {
  69             o = null;