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>
- Version:
- 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, boolean checked)
This method permit to add a checkbox in the arrayPane.ArrayCellIconPane
addArrayCellIconPane(IconPane iconPane)
Method declarationArrayCellInputText
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)
Method declarationArrayCellLink
addArrayCellLink(String text, String link, String target)
Add an ArrayCellLink with TargetArrayCellRadio
addArrayCellRadio(String name, String value, boolean checked)
This method permit to add a radiobutton in the arrayPane.ArrayCellSelect
addArrayCellSelect(String name, String[] astrLabels, String[] astrValues)
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)
Method declaration<T> ArrayCellText
addArrayCellText(T instance, Function<T,String> lazyText)
ArrayEmptyCell
addArrayEmptyCell()
Method declarationvoid
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)
Method declarationString
getId()
String
getStyleSheet()
Method declarationint
hashCode()
Computes the hash code of this ArrayLine.String
print()
Method declarationstatic String
printPseudoColumn()
Method declarationString
printWithPseudoColumns()
This method works like theprint()
method, but inserts pseudocolumns after each column.void
setId(String id)
void
setStyleSheet(String css)
Method declaration
-
-
-
Constructor Detail
-
ArrayLine
public ArrayLine(ArrayPane pane)
Constructor declaration- Parameters:
pane
-
-
-
Method Detail
-
addSubline
public void addSubline(ArrayLine subline)
-
setStyleSheet
public void setStyleSheet(String css)
Method declaration- Parameters:
css
-
-
getStyleSheet
public String getStyleSheet()
Method declaration- Returns:
-
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:
-
addArrayCellText
public ArrayCellText addArrayCellText(String text)
Method declaration- Parameters:
text
-- Returns:
-
addArrayCellText
public ArrayCellText addArrayCellText(int number)
-
addArrayCellText
public ArrayCellText addArrayCellText(float number)
-
addArrayCellLink
public ArrayCellLink addArrayCellLink(String text, String link)
Method declaration- Parameters:
text
-link
-- Returns:
-
addArrayCellLink
public ArrayCellLink addArrayCellLink(String text, String link, String target)
Add an ArrayCellLink with Target- Parameters:
text
-link
-target
-- Returns:
- ArrayCellLink
-
addArrayEmptyCell
public ArrayEmptyCell addArrayEmptyCell()
Method declaration- Returns:
-
addArrayCellIconPane
public ArrayCellIconPane addArrayCellIconPane(IconPane iconPane)
Method declaration- Parameters:
iconPane
-- Returns:
-
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
-value
-
-
addArrayCellInputText
public ArrayCellInputText addArrayCellInputText(ArrayCellInputText cell)
To add an ArrayCellInputText to an ArrayLine- Parameters:
cell
-- Returns:
-
addArrayCellSelect
public ArrayCellSelect addArrayCellSelect(String name, String[] astrLabels, String[] astrValues)
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 elementastrLabels
- an array of Labels to displayastrValues
- 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
-value
-activate
-
-
addArrayCellRadio
public ArrayCellRadio addArrayCellRadio(String name, String value, boolean checked)
This method permit to add a radiobutton in the arrayPane.- Parameters:
name
-value
-checked
-
-
addArrayCellCheckbox
public ArrayCellCheckbox addArrayCellCheckbox(String name, String value, boolean checked)
This method permit to add a checkbox in the arrayPane.- Parameters:
name
-value
-checked
-
-
getCellAt
public SimpleGraphicElement getCellAt(int column)
Method declaration- Parameters:
column
-- Returns:
-
printPseudoColumn
public static String printPseudoColumn()
Method declaration- Returns:
-
print
public String print()
Method declaration- Specified by:
print
in interfaceSimpleGraphicElement
- Returns:
-
printWithPseudoColumns
public String printWithPseudoColumns()
This method works like theprint()
method, but inserts pseudocolumns after each column. This is useful when a 0 cellspacing is used.
-
compareTo
public int compareTo(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()
-
-