src/share/classes/javax/swing/CellEditor.java

Print this page
rev 10121 : 8046485: Add missing @since tag under javax.swing.*
Reviewed-by:


  40  * such as <code>JTextField</code>, <code>JCheckBox</code>, <code>JComboBox</code>,
  41  * etc.  In addition, without this interface, clients of editors such as
  42  * <code>JTable</code> would not be able
  43  * to work with any editors developed in the future by the user
  44  * or a 3rd party ISV. <p>
  45  *
  46  * To use this interface, a developer creating a new editor can have the
  47  * new component implement the interface.  Or the developer can
  48  * choose a wrapper based approach and provide a companion object which
  49  * implements the <code>CellEditor</code> interface (See
  50  * <code>JCellEditor</code> for example).  The wrapper approach
  51  * is particularly useful if the user want to use a 3rd party ISV
  52  * editor with <code>JTable</code>, but the ISV didn't implement the
  53  * <code>CellEditor</code> interface.  The user can simply create an object
  54  * that contains an instance of the 3rd party editor object and "translate"
  55  * the <code>CellEditor</code> API into the 3rd party editor's API.
  56  *
  57  * @see javax.swing.event.CellEditorListener
  58  *
  59  * @author Alan Chung

  60  */
  61 public interface CellEditor {
  62 
  63     /**
  64      * Returns the value contained in the editor.
  65      * @return the value contained in the editor
  66      */
  67     public Object getCellEditorValue();
  68 
  69     /**
  70      * Asks the editor if it can start editing using <code>anEvent</code>.
  71      * <code>anEvent</code> is in the invoking component coordinate system.
  72      * The editor can not assume the Component returned by
  73      * <code>getCellEditorComponent</code> is installed.  This method
  74      * is intended for the use of client to avoid the cost of setting up
  75      * and installing the editor component if editing is not possible.
  76      * If editing can be started this method returns true.
  77      *
  78      * @param   anEvent         the event the editor should use to consider
  79      *                          whether to begin editing or not




  40  * such as <code>JTextField</code>, <code>JCheckBox</code>, <code>JComboBox</code>,
  41  * etc.  In addition, without this interface, clients of editors such as
  42  * <code>JTable</code> would not be able
  43  * to work with any editors developed in the future by the user
  44  * or a 3rd party ISV. <p>
  45  *
  46  * To use this interface, a developer creating a new editor can have the
  47  * new component implement the interface.  Or the developer can
  48  * choose a wrapper based approach and provide a companion object which
  49  * implements the <code>CellEditor</code> interface (See
  50  * <code>JCellEditor</code> for example).  The wrapper approach
  51  * is particularly useful if the user want to use a 3rd party ISV
  52  * editor with <code>JTable</code>, but the ISV didn't implement the
  53  * <code>CellEditor</code> interface.  The user can simply create an object
  54  * that contains an instance of the 3rd party editor object and "translate"
  55  * the <code>CellEditor</code> API into the 3rd party editor's API.
  56  *
  57  * @see javax.swing.event.CellEditorListener
  58  *
  59  * @author Alan Chung
  60  * @since 1.2
  61  */
  62 public interface CellEditor {
  63 
  64     /**
  65      * Returns the value contained in the editor.
  66      * @return the value contained in the editor
  67      */
  68     public Object getCellEditorValue();
  69 
  70     /**
  71      * Asks the editor if it can start editing using <code>anEvent</code>.
  72      * <code>anEvent</code> is in the invoking component coordinate system.
  73      * The editor can not assume the Component returned by
  74      * <code>getCellEditorComponent</code> is installed.  This method
  75      * is intended for the use of client to avoid the cost of setting up
  76      * and installing the editor component if editing is not possible.
  77      * If editing can be started this method returns true.
  78      *
  79      * @param   anEvent         the event the editor should use to consider
  80      *                          whether to begin editing or not