ui widgets - getValue() and getText() difference
Some of UI widgets has both "getValue()" , 'getText()" and
corresponding setter.
Should we use value methods or text methods at least for text based
widgets.
value methods seems to be more generic and most of the UI widgets
seems to has these.
getValue has this aditional parse on top of "getText()" -
T parseResult = parser.parse(text);
What does parse do ?
=====================
public T getValue() {
try {
return getValueOrThrow();
} catch (ParseException e) {
return null;
}
}
/**
* Return the parsed value, or null if the field is empty.
*
* @throws ParseException if the value cannot be parsed
*/
public T getValueOrThrow() throws ParseException {
String text = getText();
T parseResult = parser.parse(text);
if ("".equals(text)) {
return null;
}
return parseResult;
}
=============================
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home