public interface StringValue extends Serializable
ComponentProvider
.
F.i. to show a Contributor cell object as "Busywoman, Herta" implement a custom StringValue and use it in a text rendering provider.
StringValue stringValue = new StringValue() {
public String getString(Object value) {
if (!(value instanceof Contributor))
return TO_STRING.getString(value);
Contributor contributor = (Contributor) value;
return contributor.lastName + ", " + contributor.firstName;
}
};
ComponentProvider provider = new LabelProvider(stringValue);
table.setDefaultRenderer(Contributor.class,
new DefaultTableRenderer(provider));
PENDING: use a full-fledged Format instead? Would impose a higher burden onto implementors but could be re-used in editors.
ComponentProvider
,
LabelProvider
,
DefaultTableRenderer
,
DefaultListRenderer
,
DefaultTreeRenderer
Modifier and Type | Method and Description |
---|---|
String |
getString(Object value)
Returns a string representation of the given value.
|
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses