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
,SimpleGraphicElement
public class ArrayCellText extends ArrayCell implements SimpleGraphicElement, Comparable
Class declaration- Author:
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCell
CELLSORT_CASE_INSENSITIVE, CELLSORT_CASE_SENSITIVE, m_SortMode
-
-
Constructor Summary
Constructors Constructor Description ArrayCellText(String text, ArrayLine line)
Constructor declarationArrayCellText(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)
Method declarationboolean
equals(Object o)
String
getAlignement()
String
getColor()
Comparable
getCompareOn()
Method declarationboolean
getNoWrap()
String
getText()
String
getValignement()
int
hashCode()
String
print()
Method declarationvoid
setAlignement(String alignement)
void
setColor(String color)
void
setCompareOn(Comparable object)
Method declarationvoid
setNoWrap(boolean noWrap)
void
setValignement(String valignement)
-
Methods inherited from class org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCell
getStyleSheet, setSortMode, setStyleSheet
-
-
-
-
Constructor Detail
-
ArrayCellText
public ArrayCellText(String text, ArrayLine line)
Constructor declaration- Parameters:
text
-line
-
-
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()
- Returns:
-
getAlignement
public String getAlignement()
- Returns:
-
setAlignement
public void setAlignement(String alignement)
- Parameters:
alignement
-
-
getNoWrap
public boolean getNoWrap()
- Returns:
-
setNoWrap
public void setNoWrap(boolean noWrap)
- Parameters:
noWrap
-
-
getColor
public String getColor()
- Returns:
-
setColor
public void setColor(String color)
- Parameters:
color
-
-
getValignement
public String getValignement()
-
setValignement
public void setValignement(String valignement)
- Parameters:
valignement
-
-
print
public String print()
Method declaration- Specified by:
print
in interfaceSimpleGraphicElement
- Returns:
-
setCompareOn
public void setCompareOn(Comparable object)
Method declaration- Parameters:
object
-
-
getCompareOn
public Comparable getCompareOn()
Method declaration- Returns:
-
compareTo
public int compareTo(Object other)
Method declaration- Specified by:
compareTo
in interfaceComparable
- Parameters:
other
-- Returns:
-
-