/**
* Show a plain old text editor for a cell.
*/
private void showTextEditor(EventObject e, final String dta,
final Record r, String val, DTColumnConfig colConf) {
final Window w = new Window();
w.setWidth(200);
w.setAutoDestroy(true);
w.setPlain(true);
w.setBodyBorder(false);
w.setTitle(dta);
final TextBox box = new TextBox();
box.setText(val);
box.addKeyboardListener(new KeyboardListenerAdapter() {
public void onKeyUp(Widget sender, char keyCode,
int modifiers) {
if (keyCode == KeyboardListener.KEY_ENTER) {
r.set(dta, box.getText());
w.destroy();
}
}
});
if (dt.isNumeric(colConf, getSCE())) {
box.addKeyboardListener(ActionValueEditor.getNumericFilter(box));
}
Panel p = new Panel();
p.add(box);
w.add(p);
w.setBorder(false);
Button ok = new Button(constants.OK());
ok.addClickListener(new ClickListener() {
public void onClick(Widget wg) {
r.set(dta, box.getText());
w.destroy();
}
});
p.add(ok);
w.setPosition(e.getPageX(), e.getPageY());
w.show();
}