Methods Summary |
---|
protected java.lang.String | doGetPattern(java.lang.String patternKey)
// Date + Time
if ("fullDateTime".equals(patternKey)) {
return DateTimeFormat.getFullDateTimeFormat().getPattern();
}
if ("longDateTime".equals(patternKey)) {
return DateTimeFormat.getLongDateTimeFormat().getPattern();
}
if ("mediumDateTime".equals(patternKey)) {
return DateTimeFormat.getMediumDateTimeFormat().getPattern();
}
if ("shortDateTime".equals(patternKey)) {
return DateTimeFormat.getShortDateTimeFormat().getPattern();
}
// Date only
if ("fullDate".equals(patternKey)) {
return DateTimeFormat.getFullDateFormat().getPattern();
}
if ("longDate".equals(patternKey)) {
return DateTimeFormat.getLongDateFormat().getPattern();
}
if ("mediumDate".equals(patternKey)) {
return DateTimeFormat.getMediumDateFormat().getPattern();
}
if ("shortDate".equals(patternKey)) {
return DateTimeFormat.getShortDateFormat().getPattern();
}
// Time only
if ("fullTime".equals(patternKey)) {
return DateTimeFormat.getFullTimeFormat().getPattern();
}
if ("longTime".equals(patternKey)) {
return DateTimeFormat.getLongTimeFormat().getPattern();
}
if ("mediumTime".equals(patternKey)) {
return DateTimeFormat.getMediumTimeFormat().getPattern();
}
if ("shortTime".equals(patternKey)) {
return DateTimeFormat.getShortTimeFormat().getPattern();
}
throw new IllegalArgumentException("Unknown pattern key '" + patternKey
+ "'");
|
protected void | doParseAndRememberPattern(java.lang.String pattern)
activeFormat = DateTimeFormat.getFormat(pattern);
|
protected void | doParseInput(java.lang.String toParse, com.google.gwt.user.client.ui.HasText output, com.google.gwt.user.client.ui.HasText error)
error.setText("");
if (!"".equals(toParse)) {
try {
Date x = new Date(toParse);
String s = activeFormat.format(x);
output.setText(s);
} catch (IllegalArgumentException e) {
String errMsg = constants.failedToParseInput();
error.setText(errMsg);
}
} else {
output.setText("<None>");
}
|
public DateTimeFormatExampleConstants | getConstants()
return constants;
|