Class AbstractArrayPane
- java.lang.Object
-
- org.silverpeas.core.web.util.viewgenerator.html.arraypanes.AbstractArrayPane
-
- All Implemented Interfaces:
ArrayPane
,SimpleGraphicElement
- Direct Known Subclasses:
ArrayPaneSilverpeasV5
,ArrayPaneWithDataSource
public class AbstractArrayPane extends Object implements ArrayPane
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
EXPORT_URL_SERVLET_MAPPING
-
Fields inherited from interface org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayPane
ACTION_PARAMETER_NAME, CACHE_COLUMNS_KEY_SUFFIX, CACHE_LINES_KEY_SUFFIX, COLUMN_PARAMETER_NAME, TARGET_PARAMETER_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractArrayPane()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayColumn
addArrayColumn(String title)
Add a new column to the table.ArrayLine
addArrayLine()
Add a line to the table.String
getAlignement()
int
getCellBorderWidth()
int
getCellPadding()
int
getCellSpacing()
List<ArrayColumn>
getColumns()
int
getColumnToSort()
Get the column to be sortedboolean
getExportData()
String
getExportDataURL()
protected String
getExportUrl()
String
getIconsPath()
List<ArrayLine>
getLines()
String
getName()
Get the unique nameprotected int
getNbItems()
Gets the number of items the list can provides.String
getPaginationJavaScriptCallback()
javax.servlet.ServletRequest
getRequest()
Get the request that can contains some parameters for the ArrayPane (sort action...)javax.servlet.http.HttpSession
getSession()
Get the session in which the ArrayPane will keep its state.boolean
getSortable()
Get global array columns behaviour for sort.int
getSortMode()
Get the sort mode for all columns.ArrayPaneStatusBean
getState()
String
getSummary()
String
getTitle()
Get the titleString
getUpdateSortJavascriptCallback()
String
getUrl()
void
init(String name, String url, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Constructor declarationvoid
init(String name, javax.servlet.jsp.PageContext pageContext)
Generic class to display a typical WA array table pane.void
init(String name, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Constructor declarationprotected boolean
isPaginationOptimized()
Indicates if the pagination is optimized, the is to say if the array contains only the lines which will be printed to the user whereas the array could provides many other pages.boolean
isSortableLines()
boolean
isXHTML()
String
print()
Print the array line in an html format.protected String
printSortJavascriptFunction()
void
setAlignement(String alignement)
void
setCellsConfiguration(int spacing, int padding, int borderWidth)
This method allows for the change of cell presentation values.void
setColumnToSort(int columnNumber)
Modify the column number the sort will be based on.void
setExportData(boolean exportData)
void
setExportDataURL(String exportDataURL)
void
setPaginationJavaScriptCallback(String callback)
void
setRoutingAddress(String address)
This method sets the routing address.void
setSortable(boolean sortable)
Set all array columns to be sortable or not.void
setSortableLines(boolean sortableLines)
void
setSortMode(int mode)
This methods sets the sort mode for all columns.void
setSummary(String summary)
void
setTitle(String title)
Set the array title, to be displayed on the first html table.void
setUpdateSortJavascriptCallback(String callback)
void
setVisibleLineNumber(int maximum)
Set the maximum line number visible in the table.void
setXHTML(boolean xhtml)
-
-
-
Field Detail
-
EXPORT_URL_SERVLET_MAPPING
protected static final String EXPORT_URL_SERVLET_MAPPING
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(String name, javax.servlet.jsp.PageContext pageContext)
Description copied from interface:ArrayPane
Generic class to display a typical WA array table pane. A unique name identifier is to be used in html pages for this array specific actions (exemple : sort on a specific column)
-
init
public void init(String name, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Description copied from interface:ArrayPane
Constructor declaration
-
init
public void init(String name, String url, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
Description copied from interface:ArrayPane
Constructor declaration
-
getState
public ArrayPaneStatusBean getState()
-
addArrayColumn
public ArrayColumn addArrayColumn(String title)
Add a new column to the table.- Specified by:
addArrayColumn
in interfaceArrayPane
- Parameters:
title
- The column title to display- Returns:
- The new column header. You can use this object to modify the default display options.
-
addArrayLine
public ArrayLine addArrayLine()
Description copied from interface:ArrayPane
Add a line to the table. Be carefull : each line form the array has to contain the same cell number. If not, the array will contain some empty cells, and won't be sortable.- Specified by:
addArrayLine
in interfaceArrayPane
- Returns:
- an ArrayLine, to be used to add cells and to modify default display options.
-
setTitle
public void setTitle(String title)
Description copied from interface:ArrayPane
Set the array title, to be displayed on the first html table.
-
setVisibleLineNumber
public void setVisibleLineNumber(int maximum)
Description copied from interface:ArrayPane
Set the maximum line number visible in the table. If the number of line is greater than this maximum, only the first lines will be visible, and some buttons to view next and previous lines will be added.- Specified by:
setVisibleLineNumber
in interfaceArrayPane
- Parameters:
maximum
- The maximum number of visible lines
-
getColumnToSort
public int getColumnToSort()
Description copied from interface:ArrayPane
Get the column to be sorted- Specified by:
getColumnToSort
in interfaceArrayPane
- Returns:
- The column number.
-
setColumnToSort
public void setColumnToSort(int columnNumber)
Description copied from interface:ArrayPane
Modify the column number the sort will be based on.- Specified by:
setColumnToSort
in interfaceArrayPane
- Parameters:
columnNumber
- The column to be sorted
-
print
public String print()
Description copied from interface:ArrayPane
Print the array line in an html format.- Specified by:
print
in interfaceArrayPane
- Specified by:
print
in interfaceSimpleGraphicElement
- Returns:
- The html code, representing the array pane
-
getSession
public javax.servlet.http.HttpSession getSession()
Description copied from interface:ArrayPane
Get the session in which the ArrayPane will keep its state.- Specified by:
getSession
in interfaceArrayPane
- Returns:
- The session
-
getRequest
public javax.servlet.ServletRequest getRequest()
Description copied from interface:ArrayPane
Get the request that can contains some parameters for the ArrayPane (sort action...)- Specified by:
getRequest
in interfaceArrayPane
- Returns:
- The entering request
-
setRoutingAddress
public void setRoutingAddress(String address)
This method sets the routing address. This is actually the URL of the page to which requests will be routed when the user clicks on a column header link.- Specified by:
setRoutingAddress
in interfaceArrayPane
- Parameters:
address
-
-
getSortable
public boolean getSortable()
Description copied from interface:ArrayPane
Get global array columns behaviour for sort. By default, all colums are sortable.- Specified by:
getSortable
in interfaceArrayPane
- Returns:
- True, if the array is sortable, false if not.
-
setSortable
public void setSortable(boolean sortable)
Set all array columns to be sortable or not. By default, all colums are sortable.- Specified by:
setSortable
in interfaceArrayPane
- Parameters:
sortable
- Set sortable to false if you want all the table to be unsortable.
-
getSortMode
public int getSortMode()
Description copied from interface:ArrayPane
Get the sort mode for all columns.- Specified by:
getSortMode
in interfaceArrayPane
- Returns:
- The sort mode.
-
setSortMode
public void setSortMode(int mode)
This methods sets the sort mode for all columns. The columns cells may or may not take this value into account.- Specified by:
setSortMode
in interfaceArrayPane
- Parameters:
mode
- The new sort mode.
-
setCellsConfiguration
public void setCellsConfiguration(int spacing, int padding, int borderWidth)
This method allows for the change of cell presentation values. A negative value means 'do not change this value'- Specified by:
setCellsConfiguration
in interfaceArrayPane
- Parameters:
spacing
-padding
-borderWidth
-
-
getCellSpacing
public int getCellSpacing()
-
getCellPadding
public int getCellPadding()
-
getCellBorderWidth
public int getCellBorderWidth()
-
getPaginationJavaScriptCallback
public String getPaginationJavaScriptCallback()
-
setPaginationJavaScriptCallback
public void setPaginationJavaScriptCallback(String callback)
- Specified by:
setPaginationJavaScriptCallback
in interfaceArrayPane
-
getSummary
public String getSummary()
- Specified by:
getSummary
in interfaceArrayPane
-
setSummary
public void setSummary(String summary)
- Specified by:
setSummary
in interfaceArrayPane
-
isXHTML
public boolean isXHTML()
-
getExportData
public boolean getExportData()
- Specified by:
getExportData
in interfaceArrayPane
- Returns:
- true if the current array pane can be exported, false else if
-
setExportData
public void setExportData(boolean exportData)
- Specified by:
setExportData
in interfaceArrayPane
- Parameters:
exportData
- enable/disable export data from array pane
-
getExportDataURL
public String getExportDataURL()
- Specified by:
getExportDataURL
in interfaceArrayPane
- Returns:
- export data URL used to export current ArrayPane data
-
setExportDataURL
public void setExportDataURL(String exportDataURL)
- Specified by:
setExportDataURL
in interfaceArrayPane
- Parameters:
exportDataURL
- the URL to set used to export array pane data
-
getExportUrl
protected String getExportUrl()
- Returns:
- the export array pane URL
-
isSortableLines
public boolean isSortableLines()
-
setSortableLines
public void setSortableLines(boolean sortableLines)
- Specified by:
setSortableLines
in interfaceArrayPane
-
getUrl
public String getUrl()
-
getIconsPath
public String getIconsPath()
-
getAlignement
public String getAlignement()
-
setAlignement
public void setAlignement(String alignement)
-
getColumns
public List<ArrayColumn> getColumns()
-
printSortJavascriptFunction
protected String printSortJavascriptFunction()
-
getUpdateSortJavascriptCallback
public String getUpdateSortJavascriptCallback()
-
setUpdateSortJavascriptCallback
public void setUpdateSortJavascriptCallback(String callback)
- Specified by:
setUpdateSortJavascriptCallback
in interfaceArrayPane
-
isPaginationOptimized
protected boolean isPaginationOptimized()
Indicates if the pagination is optimized, the is to say if the array contains only the lines which will be printed to the user whereas the array could provides many other pages.- Returns:
- true if the pagination is optimized.
-
getNbItems
protected int getNbItems()
Gets the number of items the list can provides.- Returns:
- the total number of items.
-
-