Methods Summary |
---|
public void | addActionListener(java.awt.event.ActionListener l)
editor.addActionListener(l);
|
public void | focusGained(java.awt.event.FocusEvent e)
|
public void | focusLost(java.awt.event.FocusEvent e)
|
public java.awt.Component | getEditorComponent()
return editor;
|
public java.lang.Object | getItem()
Object newValue = editor.getText();
if (oldValue != null && !(oldValue instanceof String)) {
// The original value is not a string. Should return the value in it's
// original type.
if (newValue.equals(oldValue.toString())) {
return oldValue;
} else {
// Must take the value from the editor and get the value and cast it to the new type.
Class cls = oldValue.getClass();
try {
Method method = cls.getMethod("valueOf", new Class[]{String.class});
newValue = method.invoke(oldValue, new Object[] { editor.getText()});
} catch (Exception ex) {
// Fail silently and return the newValue (a String object)
}
}
}
return newValue;
|
public void | removeActionListener(java.awt.event.ActionListener l)
editor.removeActionListener(l);
|
public void | selectAll()
editor.selectAll();
editor.requestFocus();
|
public void | setItem(java.lang.Object anObject)Sets the item that should be edited.
if ( anObject != null ) {
editor.setText(anObject.toString());
oldValue = anObject;
} else {
editor.setText("");
}
|