Class ArrayCellText
- java.lang.Object
-
- org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCell
-
- org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCellText
-
- All Implemented Interfaces:
Comparable<Object>
,SimpleGraphicElement
public class ArrayCellText extends ArrayCell implements SimpleGraphicElement, Comparable<Object>
-
-
Constructor Summary
Constructors Constructor Description ArrayCellText(String text, ArrayLine line)
ArrayCellText(T instance, Function<T,String> lazyText, ArrayLine line)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object other)
boolean
equals(Object o)
String
getColor()
Comparable<Object>
getCompareOn()
String
getSyntax()
String
getText()
int
hashCode()
void
setColor(String color)
void
setCompareOn(Comparable<?> comparable)
-
Methods inherited from class org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCell
getName, getStyleSheet, print, setStyleSheet
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.web.util.viewgenerator.html.SimpleGraphicElement
print
-
-
-
-
Constructor Detail
-
ArrayCellText
public ArrayCellText(T instance, Function<T,String> lazyText, ArrayLine line)
The text of the cell is computed from aFunction
applied to the given instance parameter.
The function takes in input the given instance and the result must be aString
.
The advantage of this way of use is that the text is computed only when the line is displayed. So that can be see as a lazy computation.
Once the text computation is done, it is cached so that the computation is performed at most one time.- Parameters:
instance
- the instance in input of the function.lazyText
- the function to apply to the instance.line
- the line of the array.
-
-
Method Detail
-
getText
public String getText()
-
getColor
public String getColor()
-
setColor
public void setColor(String color)
-
setCompareOn
public void setCompareOn(Comparable<?> comparable)
-
getCompareOn
public Comparable<Object> getCompareOn()
-
compareTo
public int compareTo(@Nonnull Object other)
- Specified by:
compareTo
in interfaceComparable<Object>
-
-