|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swing.controls.JTextFieldEditorAdapter
public class JTextFieldEditorAdapter
Adapts a JTextField to the TableCellEditor and TreeCellEditor interfaces. Supports use of a ValueConverter and the Objects.convertValue () method to provide auto data conversion to/from text and the form used by the model.
Constructor Summary | |
---|---|
JTextFieldEditorAdapter(JTextField textField)
Create an adapter with no data conversion (ie text is copied directly to model). |
|
JTextFieldEditorAdapter(JTextField textField,
Class valueClass)
Create an adapter that converts data from text field to values of a given type. |
|
JTextFieldEditorAdapter(JTextField textField,
Class valueClass,
ValueConverter converter)
Create an adapter that converts data from text field to values of a given type. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
void |
addCellEditorListener(CellEditorListener l)
|
void |
cancelCellEditing()
|
protected void |
fireEditingCanceled(ChangeEvent e)
|
protected void |
fireEditingStopped(ChangeEvent e)
|
void |
focusGained(FocusEvent e)
|
void |
focusLost(FocusEvent e)
|
Object |
getCellEditorValue()
|
int |
getClickCountToEdit()
|
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
|
Component |
getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
|
Class |
getValueClass()
|
boolean |
isCellEditable(EventObject e)
|
void |
removeCellEditorListener(CellEditorListener l)
|
void |
setClickCountToEdit(int newValue)
|
void |
setValueClass(Class newValueClass)
|
boolean |
shouldSelectCell(EventObject e)
|
Component |
startEditor(Object value)
|
boolean |
stopCellEditing()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JTextFieldEditorAdapter(JTextField textField)
public JTextFieldEditorAdapter(JTextField textField, Class valueClass)
textField
- The text field to use for editing.valueClass
- The class of value to return to the model.public JTextFieldEditorAdapter(JTextField textField, Class valueClass, ValueConverter converter)
textField
- The text field to use for editing.valueClass
- The class of value to return to the model.converter
- The converter instance to use for conversion
to/from text and the model form.Method Detail |
---|
public Class getValueClass()
public void setValueClass(Class newValueClass)
public int getClickCountToEdit()
public void setClickCountToEdit(int newValue)
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
public void focusLost(FocusEvent e)
focusLost
in interface FocusListener
public Component startEditor(Object value)
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
getTreeCellEditorComponent
in interface TreeCellEditor
public Object getCellEditorValue()
getCellEditorValue
in interface CellEditor
public boolean isCellEditable(EventObject e)
isCellEditable
in interface CellEditor
public boolean shouldSelectCell(EventObject e)
shouldSelectCell
in interface CellEditor
public boolean stopCellEditing()
stopCellEditing
in interface CellEditor
public void cancelCellEditing()
cancelCellEditing
in interface CellEditor
public void removeCellEditorListener(CellEditorListener l)
removeCellEditorListener
in interface CellEditor
public void addCellEditorListener(CellEditorListener l)
addCellEditorListener
in interface CellEditor
protected void fireEditingCanceled(ChangeEvent e)
protected void fireEditingStopped(ChangeEvent e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |