Package org.ametys.cms.search.ui.model
Class SearchUIColumnHelper
java.lang.Object
org.ametys.cms.search.ui.model.SearchUIColumnHelper
Helper class for search UI columns
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default column widthstatic final int
The default column width for system properties -
Method Summary
Modifier and TypeMethodDescriptioncolumnPropertiesToJSON
(SearchUIColumn column) Converts the given column's properties in a JSON mapstatic SearchUIColumn
createModelItemColumn
(ModelItem modelItem) Creates a column for the given model itemstatic int
getDefaultColumnWidth
(SearchUIColumn column) Retrieves the default column width, corresponding to the referenced model itemRetrieves the default converter for the given definitionstatic boolean
isEditionAllowed
(SearchUIColumn column) Determines if the inline edition is allowed for the given columnstatic boolean
isSortAllowed
(SearchUIColumn column) Determines if the sort is allowed for the given column
-
Field Details
-
DEFAULT_COLUMN_WIDTH
The default column width- See Also:
-
DEFAULT_SYSTEM_PROPERTY_COLUMN_WIDTH
The default column width for system properties- See Also:
-
-
Method Details
-
createModelItemColumn
public static SearchUIColumn createModelItemColumn(ModelItem modelItem) throws IllegalArgumentException Creates a column for the given model item- Parameters:
modelItem
- the model item- Returns:
- the created column
- Throws:
IllegalArgumentException
- if the given model item is not an element or a repeater
-
getDefaultColumnWidth
Retrieves the default column width, corresponding to the referenced model item- Parameters:
column
- the column- Returns:
- the default width
-
isEditionAllowed
Determines if the inline edition is allowed for the given column- Parameters:
column
- the column- Returns:
true
if the column edition is allowed,false
otherwise
-
isSortAllowed
Determines if the sort is allowed for the given column- Parameters:
column
- the column- Returns:
true
if the column edition is allowed,false
otherwise
-
getElementDefinitionDefaultConverter
Retrieves the default converter for the given definition- Parameters:
definition
- the definition- Returns:
- the default converter
-
columnPropertiesToJSON
Converts the given column's properties in a JSON map- Parameters:
column
- the column- Returns:
- The column's properties as a JSON map
-