Show TimestampTextBoxWithID.java syntax highlighted
package ucalgary.ebe.webui.client.ui;
public class TimestampTextBoxWithID extends TextBoxWithID {
private static final String TIMESTAMP_PATTERN = "(\\d){4}-(\\d){2}-(\\d){2}(\\s(\\d){2}:(\\d){2}:(\\d){2}\\.(\\d){1,3})?";
private boolean changed = false;
public TimestampTextBoxWithID(long id, String ts) {
super(id);
this.setText(ts);
}
public void setText(String ts) {
if(ts.matches(TIMESTAMP_PATTERN)) {
super.setText(ts);
this.changed = true;
this.content = ts;
} else {
this.changed = false;
super.setText(this.content);
}
}
public boolean hasChanged() {
return this.changed;
}
}
See more files for this project here