/**
* 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.Widget;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.ChangeListener;
/**
* <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 TextAreaRenderer extends Question {
private static final int ROWS = 10;
public TextAreaRenderer(String[] state, int row, Rydia.ChangeListener changeListener) {
super(state, row, changeListener);
}
public Widget getColumn2() {
final TextArea ta = new TextArea();
ta.setEnabled(isEnabled());
ta.setText(state[ANSWER]);
ta.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
reactToChange(ta.getText());
}
});
ta.addKeyboardListener(new DelayedKeyboardListener(new TimerListener() {
public void onTimeUp() {
reactToChange(ta.getText());
}
}));
ta.setVisibleLines(Integer.valueOf(state[ROWS]).intValue());
return ta;
}
}