Show TextBoxWithID.java syntax highlighted
package ucalgary.ebe.webui.client.ui;
import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
public class TextBoxWithID extends TextBox implements FocusListener {
protected long id;
protected String oldText;
public TextBoxWithID(long id) {
super();
this.id = id;
this.oldText = null;
this.addStyleName("webui-TextBoxWithID-Unchecked");
this.addFocusListener(this);
}
public TextBoxWithID(long id, String content) {
super();
this.id = id;
this.oldText = content;
this.addStyleName("webui-TextBoxWithID-Unchecked");
this.addFocusListener(this);
}
public void setId(long id) {
this.id = id;
}
public long getId() {
return this.id;
}
public void setOldText(String content) {
this.oldText = content;
}
public String getOldText() {
return this.oldText;
}
public void onFocus(Widget sender) {
sender.removeStyleName("webui-TextBoxWithID-Unchecked");
sender.addStyleName("webui-TextBoxWithID-Checked");
}
public void onLostFocus(Widget sender) {
sender.addStyleName("webui-TextBoxWithID-Unchecked");
sender.removeStyleName("webui-TextBoxWithID-Checked");
}
}
See more files for this project here