/**
* This file is part of Rydia.
*
* Rydia is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Rydia is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Rydia. If not, see <http://www.gnu.org/licenses/>.
**/
package org.rydia.client;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
/**
* <u><b><font color="red">FOR INTERNAL USE ONLY.</font></b></u>
* Copyright (c)2007, Daniel Kaplan
*
* @author Daniel Kaplan
* @since 7.11.6
*/
public class TextFieldRenderer extends Question {
public TextFieldRenderer(String[] state, int row, Rydia.ChangeListener changeListener) {
super(state, row, changeListener);
}
public Widget getColumn2() {
final TextBox tb = new TextBox();
tb.setEnabled(isEnabled());
tb.setText(state[ANSWER]);
tb.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
reactToChange(tb.getText());
}
});
tb.addKeyboardListener(new DelayedKeyboardListener(new TimerListener() {
public void onTimeUp() {
reactToChange(tb.getText());
}
}));
return tb;
}
}