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
FieldsModifier and TypeFieldDescriptionstatic final intThe default column widthstatic final intThe default column width for system properties -
Method Summary
Modifier and TypeMethodDescriptioncolumnPropertiesToJSON(SearchUIColumn column) Converts the given column's properties in a JSON mapstatic SearchUIColumncreateModelItemColumn(ModelItem modelItem) Creates a column for the given model itemstatic intgetDefaultColumnWidth(SearchUIColumn column) Retrieves the default column width, corresponding to the referenced model itemRetrieves the default converter for the given definitionstatic booleanisEditionAllowed(SearchUIColumn column) Determines if the inline edition is allowed for the given columnstatic booleanisSortAllowed(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:
trueif the column edition is allowed,falseotherwise
-
isSortAllowed
Determines if the sort is allowed for the given column- Parameters:
column- the column- Returns:
trueif the column edition is allowed,falseotherwise
-
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
-