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

Print this page




  41  * find a text component to operate on.  The preferred way of
  42  * getting the component to act upon is through the ActionEvent
  43  * that is received.  If the Object returned by getSource can
  44  * be narrowed to a text component, it will be used.  If the
  45  * action event is null or can't be narrowed, the last focused
  46  * text component is tried.  This is determined by being
  47  * used in conjunction with a JTextController which
  48  * arranges to share that information with a TextAction.
  49  * <p>
  50  * <strong>Warning:</strong>
  51  * Serialized objects of this class will not be compatible with
  52  * future Swing releases. The current serialization support is
  53  * appropriate for short term storage or RMI between applications running
  54  * the same version of Swing.  As of 1.4, support for long term storage
  55  * of all JavaBeans&trade;
  56  * has been added to the <code>java.beans</code> package.
  57  * Please see {@link java.beans.XMLEncoder}.
  58  *
  59  * @author  Timothy Prinzing
  60  */

  61 public abstract class TextAction extends AbstractAction {
  62 
  63     /**
  64      * Creates a new JTextAction object.
  65      *
  66      * @param name the name of the action
  67      */
  68     public TextAction(String name) {
  69         super(name);
  70     }
  71 
  72     /**
  73      * Determines the component to use for the action.
  74      * This if fetched from the source of the ActionEvent
  75      * if it's not null and can be narrowed.  Otherwise,
  76      * the last focused component is used.
  77      *
  78      * @param e the ActionEvent
  79      * @return the component
  80      */




  41  * find a text component to operate on.  The preferred way of
  42  * getting the component to act upon is through the ActionEvent
  43  * that is received.  If the Object returned by getSource can
  44  * be narrowed to a text component, it will be used.  If the
  45  * action event is null or can't be narrowed, the last focused
  46  * text component is tried.  This is determined by being
  47  * used in conjunction with a JTextController which
  48  * arranges to share that information with a TextAction.
  49  * <p>
  50  * <strong>Warning:</strong>
  51  * Serialized objects of this class will not be compatible with
  52  * future Swing releases. The current serialization support is
  53  * appropriate for short term storage or RMI between applications running
  54  * the same version of Swing.  As of 1.4, support for long term storage
  55  * of all JavaBeans&trade;
  56  * has been added to the <code>java.beans</code> package.
  57  * Please see {@link java.beans.XMLEncoder}.
  58  *
  59  * @author  Timothy Prinzing
  60  */
  61 @SuppressWarnings("serial") // Same-version serialization only
  62 public abstract class TextAction extends AbstractAction {
  63 
  64     /**
  65      * Creates a new JTextAction object.
  66      *
  67      * @param name the name of the action
  68      */
  69     public TextAction(String name) {
  70         super(name);
  71     }
  72 
  73     /**
  74      * Determines the component to use for the action.
  75      * This if fetched from the source of the ActionEvent
  76      * if it's not null and can be narrowed.  Otherwise,
  77      * the last focused component is used.
  78      *
  79      * @param e the ActionEvent
  80      * @return the component
  81      */