Package org.jdesktop.swingx.renderer
Class MappedValue
- java.lang.Object
-
- org.jdesktop.swingx.renderer.MappedValue
-
- All Implemented Interfaces:
java.io.Serializable,BooleanValue,IconValue,StringValue
- Direct Known Subclasses:
MappedValues.MappedValueUIResource
public class MappedValue extends java.lang.Object implements StringValue, IconValue, BooleanValue
Compound implementation of XXValue. Currently, XX stands for String, Icon, Boolean.Quick hack around #590-swingx: LabelProvider should respect StringValue when formatting (instead of going clever with icons). Note: this will change!
- See Also:
CheckBoxProvider, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jdesktop.swingx.renderer.IconValue
IconValue.IconType
-
-
Field Summary
Fields Modifier and Type Field Description private BooleanValuebooleanDelegateprivate IconValueiconDelegateprivate StringValuestringDelegate
-
Constructor Summary
Constructors Constructor Description MappedValue(StringValue stringDelegate, IconValue iconDelegate)MappedValue(StringValue stringDelegate, IconValue iconDelegate, BooleanValue booleanDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean(java.lang.Object value)javax.swing.IcongetIcon(java.lang.Object value)Returns a icon representation of the given value.java.lang.StringgetString(java.lang.Object value)Returns a string representation of the given value.
-
-
-
Field Detail
-
stringDelegate
private StringValue stringDelegate
-
iconDelegate
private IconValue iconDelegate
-
booleanDelegate
private BooleanValue booleanDelegate
-
-
Constructor Detail
-
MappedValue
public MappedValue(StringValue stringDelegate, IconValue iconDelegate)
-
MappedValue
public MappedValue(StringValue stringDelegate, IconValue iconDelegate, BooleanValue booleanDelegate)
-
-
Method Detail
-
getString
public java.lang.String getString(java.lang.Object value)
Returns a string representation of the given value.PENDING JW: forgot - why not null return guaranteed?
This implementation delegates to the contained StringValue if available or returns an empty String, if not.
- Specified by:
getStringin interfaceStringValue- Parameters:
value- the object to present as a string- Returns:
- a string representation of the given value, guaranteed to be not null
-
getIcon
public javax.swing.Icon getIcon(java.lang.Object value)
Returns a icon representation of the given value.This implementation delegates to the contained IconValue if available or returns null, if not.
-
getBoolean
public boolean getBoolean(java.lang.Object value)
This implementation delegates to the contained BooleanValue if available or returns false, if not.
- Specified by:
getBooleanin interfaceBooleanValue
-
-