w.setPlain( true );
w.setBodyBorder( false );
w.setTitle( dta );
String typeDescription = dt.getType(colConf, getSCE());
Panel p = new Panel();
if (typeDescription != null
&& typeDescription.equals(SuggestionCompletionEngine.TYPE_DATE)) {
final DatePickerTextBox datePicker = new DatePickerTextBox(val);
String m = Format.format(((Constants) GWT.create(Constants.class))
.ValueFor0(), dta);
datePicker.setTitle(m);
datePicker.addValueChanged(new ValueChanged() {
public void valueChanged(String newValue) {
r.set(dta, newValue);
}
});
p.add(datePicker);
p.add(new InfoPopup(constants.CategoryParentRules(), Format.format(
constants.FillInColumnWithValue(), typeDescription)));
w.add(p);
w.setBorder(false);
Button ok = new Button(constants.OK());
ok.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent arg0) {
r.set(dta, datePicker.getDateString());
w.destroy();
}
});
p.add(ok);
} else {
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));
}
p.add(box);
if (typeDescription != null) {
p.add(new InfoPopup(constants.CategoryParentRules(), Format
.format(constants.FillInColumnWithValue(),
typeDescription)));
}
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();