public TextBox(final boolean updateOnKeypress) {
final TextBox instance = this;
old = base.getText();
if(updateOnKeypress) {
this.addKeyboardListener(new KeyboardListener() {
public void onKeyPress(Widget sender, char keyCode,
int modifiers) {
changes.firePropertyChange("value", old,
getValue() );
old = (String) getValue();
}
public void onKeyDown(Widget sender, char keyCode,
int modifiers) {
}
public void onKeyUp(Widget sender, char keyCode,
int modifiers) {
}
});
} else {
this.addKeyboardListener( new KeyboardListener(){
public void onKeyUp(Widget sender, char keyCode, int modifiers) {
}
public void onKeyPress(Widget sender, char keyCode, int modifiers) {
if( keyCode == KeyboardListener.KEY_ENTER ){