JIDE 3.5.15

com.jidesoft.grid
Class PasswordCellEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by com.jidesoft.grid.AbstractJideCellEditor
          extended by com.jidesoft.grid.ContextSensitiveCellEditor
              extended by com.jidesoft.grid.TextFieldCellEditor
                  extended by com.jidesoft.grid.PasswordCellEditor
All Implemented Interfaces:
ConverterContextSupport, EditorContextSupport, EditorStyleSupport, JideCellEditor, ActionListener, Serializable, EventListener, CellEditor, TableCellEditor

public class PasswordCellEditor
extends TextFieldCellEditor

CellEditor for password. The default data type for password is char[].class. By default PasswordCellEditor is registered on CellEditorManager with char[].class as data type and EditorContext("Password") as the editor context.

Please be noted that JIDE won't do any conversion with ObjectConverterManager between the input password and the displayed text.

See Also:
Serialized Form

Field Summary
static EditorContext CONTEXT
           
 
Fields inherited from class com.jidesoft.grid.TextFieldCellEditor
_textField
 
Fields inherited from class com.jidesoft.grid.ContextSensitiveCellEditor
DEFAULT_CELL_EDITOR_BORDER
 
Fields inherited from class com.jidesoft.grid.AbstractJideCellEditor
_clickCountToStart
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
PasswordCellEditor()
           
 
Method Summary
protected  JTextField createTextField()
          Creates a text field used by the cell editor.
 Object getCellEditorValue()
           
 void setCellEditorValue(Object value)
           
 
Methods inherited from class com.jidesoft.grid.TextFieldCellEditor
actionPerformed, customizeTextField, getTableCellEditorComponent, getTextField, isEditorStyleSupported
 
Methods inherited from class com.jidesoft.grid.ContextSensitiveCellEditor
getConverter, getConverterContext, getEditorContext, getEditorStyle, getType, isUseConverterContext, setConverter, setConverterContext, setEditorContext, setEditorStyle, setType, setUseConverterContext
 
Methods inherited from class com.jidesoft.grid.AbstractJideCellEditor
addValidationListener, getClickCountToStart, getDefaultErrorBehavior, getValidationListeners, isAutoStopCellEditing, isCellEditable, isPassEnterKeyToTable, removeValidationListener, setAutoStopCellEditing, setClickCountToStart, setDefaultErrorBehavior, setPassEnterKeyToTable, validate
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell, stopCellEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
 

Field Detail

CONTEXT

public static final EditorContext CONTEXT
Constructor Detail

PasswordCellEditor

public PasswordCellEditor()
Method Detail

createTextField

protected JTextField createTextField()
Description copied from class: TextFieldCellEditor
Creates a text field used by the cell editor. Subclass can override it to return other type of text field. By default, we will override the processKeyBinding to respect isPassEnterKeyToTable() property.
 return new JTextField() {
     protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean
 pressed) {
         Container parent = null;
         if (e.getSource() != parent && isPassEnterKeyToTable() && e.getKeyCode() ==
 KeyEvent.VK_ENTER) {
             parent = SwingUtilities.getAncestorOfClass(JideTable.class, this);
         }
         boolean processed = super.processKeyBinding(ks, e, condition, pressed); // stop cell
 editing
         if (e.getSource() != parent && parent instanceof JideTable) {
             ((JideTable) parent).processKeyBinding(ks, e, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
 pressed);
         }
         return processed;
     }
 };
 

Overrides:
createTextField in class TextFieldCellEditor
Returns:
a text field.

setCellEditorValue

public void setCellEditorValue(Object value)
Overrides:
setCellEditorValue in class TextFieldCellEditor

getCellEditorValue

public Object getCellEditorValue()
Specified by:
getCellEditorValue in interface CellEditor
Overrides:
getCellEditorValue in class TextFieldCellEditor

JIDE 3.5.15