Class ArrayLine
- java.lang.Object
-
- org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayLine
-
- All Implemented Interfaces:
Comparable<ArrayLine>
,SimpleGraphicElement
public class ArrayLine extends Object implements SimpleGraphicElement, Comparable<ArrayLine>
A row in an HTML array- Author:
- squere
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayCellButton
addArrayCellButton(String name, String value, boolean activate)
This method permit to add a button in the arrayPane.ArrayCellCheckbox
addArrayCellCheckbox(String name, String value, String onchange, boolean checked)
ArrayCellIconPane
addArrayCellIconPane(IconPane iconPane)
ArrayCellInputText
addArrayCellInputText(String name, String value)
This method permit to add a input box without format in the arrayPane.ArrayCellInputText
addArrayCellInputText(ArrayCellInputText cell)
To add an ArrayCellInputText to an ArrayLineArrayCellLink
addArrayCellLink(String text, String link)
ArrayCellLink
addArrayCellLink(String text, String link, String target)
ArrayCellRadio
addArrayCellRadio(String name, String value, boolean checked)
ArrayCellSelect
addArrayCellSelect(String name, String[] labels, String[] values)
This method permits to add a select drop-down box without format in the arrayPane.ArrayCellSelect
addArrayCellSelect(String name, List<String> values)
ArrayCellText
addArrayCellText(float number)
ArrayCellText
addArrayCellText(int number)
ArrayCellText
addArrayCellText(String text)
<T> ArrayCellText
addArrayCellText(T instance, Function<T,String> lazyText)
void
addArrayEmptyCell()
void
addSubline(ArrayLine subline)
int
compareTo(ArrayLine other)
Compares this array line with the specified one by the cell in the same sortable column.boolean
equals(Object o)
SimpleGraphicElement
getCellAt(int column)
String
getId()
String
getStyleSheet()
int
hashCode()
Computes the hash code of this ArrayLine.String
print()
Print an html representation for this object.static String
printPseudoColumn()
String
printWithPseudoColumns()
This method works like theprint()
method, but inserts pseudo columns after each column.void
setId(String id)
void
setStyleSheet(String css)
-
-
-
Constructor Detail
-
ArrayLine
public ArrayLine(ArrayPane pane)
-
-
Method Detail
-
addSubline
public void addSubline(ArrayLine subline)
-
setStyleSheet
public void setStyleSheet(String css)
-
getStyleSheet
public String getStyleSheet()
-
addArrayCellText
public <T> ArrayCellText addArrayCellText(T instance, Function<T,String> lazyText)
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.- Returns:
- an array cell text.
-
addArrayCellText
public ArrayCellText addArrayCellText(String text)
-
addArrayCellText
public ArrayCellText addArrayCellText(int number)
-
addArrayCellText
public ArrayCellText addArrayCellText(float number)
-
addArrayCellLink
public ArrayCellLink addArrayCellLink(String text, String link)
-
addArrayCellLink
public ArrayCellLink addArrayCellLink(String text, String link, String target)
-
addArrayEmptyCell
public void addArrayEmptyCell()
-
addArrayCellIconPane
public ArrayCellIconPane addArrayCellIconPane(IconPane iconPane)
-
addArrayCellInputText
public ArrayCellInputText addArrayCellInputText(String name, String value)
This method permit to add a input box without format in the arrayPane. Input box parameters are name and value- Parameters:
name
- name of the inputvalue
- value of the input
-
addArrayCellInputText
public ArrayCellInputText addArrayCellInputText(ArrayCellInputText cell)
To add an ArrayCellInputText to an ArrayLine- Parameters:
cell
- the cell to add- Returns:
- the added cell
-
addArrayCellSelect
public ArrayCellSelect addArrayCellSelect(String name, String[] labels, String[] values)
This method permits to add a select drop-down box without format in the arrayPane. Select box parameters are name, labels and values- Parameters:
name
- The name of the elementlabels
- an array of Labels to displayvalues
- an array of Values to return- Returns:
- an ArrayCellSelect object.
-
addArrayCellSelect
public ArrayCellSelect addArrayCellSelect(String name, List<String> values)
-
addArrayCellButton
public ArrayCellButton addArrayCellButton(String name, String value, boolean activate)
This method permit to add a button in the arrayPane. Button parameters are name, value, and if the button is disabled or not.- Parameters:
name
- the button name.value
- the button value.activate
- if the button is enabled or not.
-
addArrayCellRadio
public ArrayCellRadio addArrayCellRadio(String name, String value, boolean checked)
-
addArrayCellCheckbox
public ArrayCellCheckbox addArrayCellCheckbox(String name, String value, String onchange, boolean checked)
-
getCellAt
public SimpleGraphicElement getCellAt(int column)
-
printPseudoColumn
public static String printPseudoColumn()
-
print
public String print()
Description copied from interface:SimpleGraphicElement
Print an html representation for this object.- Specified by:
print
in interfaceSimpleGraphicElement
- Returns:
- The html representation for this object.
-
printWithPseudoColumns
public String printWithPseudoColumns()
This method works like theprint()
method, but inserts pseudo columns after each column. This is useful when a 0 cell spacing is used.
-
compareTo
public int compareTo(@Nonnull ArrayLine other)
Compares this array line with the specified one by the cell in the same sortable column. This comparing function is not about array line equality meaning the following property(x.compareTo(y)==0) == (x.equals(y))
is broken.- Specified by:
compareTo
in interfaceComparable<ArrayLine>
-
hashCode
public int hashCode()
Computes the hash code of this ArrayLine. Two same array lines have the same hash code.
-
setId
public void setId(String id)
-
getId
public String getId()
-
-