Class ViewElementAccessorSearchUIColumn
java.lang.Object
org.ametys.runtime.model.ViewElement
org.ametys.runtime.model.ViewElementAccessor
org.ametys.cms.search.ui.model.impl.ViewElementAccessorSearchUIColumn
- All Implemented Interfaces:
SearchUIColumn<ElementDefinition>
,ModelViewItem<ElementDefinition>
,ViewItem
,ViewItemAccessor
,Labelable
,ModifiableLabelable
public class ViewElementAccessorSearchUIColumn
extends ViewElementAccessor
implements SearchUIColumn<ElementDefinition>
This class represents a result column
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines if sort is allowed on multiple joinvoid
Copy the current view item in the given one.Create an instance ofViewItem
Get the JS class name for converting field's valueIf the column should be the default sorter 'ASC' or 'DESC'.Get the JS class name for rendererint
getWidth()
The column's widthboolean
Determines if the property is editableboolean
isHidden()
Determines if the column is hidden by defaultboolean
Determines if the column is sortablevoid
setAllowSortOnMultipleJoin
(boolean allowSortOnMultipleJoin) Set the allowSortOnMultipleJoin propertyvoid
setConverter
(Optional<String> converter) Set the JS class name for converting field's valuevoid
setDefaultSorter
(Optional<String> defaultSorter) Set the default sorter propertyvoid
setEditable
(boolean editable) Set the editable propertyvoid
setHidden
(boolean hidden) Set the hidden propertyvoid
setRenderer
(Optional<String> renderer) Set the JS class name for renderervoid
setSortable
(boolean sortable) Set the sortable propertyvoid
setWidth
(int width) Set the column's widthtoJSON
(DefinitionContext context) Converts the view item in a JSON mapMethods inherited from class org.ametys.runtime.model.ViewElementAccessor
addViewItem, clear, copyTo, equals, getViewItems, hashCode, insertViewItem, of, of, removeViewItem, toString
Methods inherited from class org.ametys.runtime.model.ViewElement
equals, getDefinition, getDescription, getLabel, getName, getParent, setDefinition, setDescription, setLabel, setParent, toSAX
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getName
Methods inherited from interface org.ametys.runtime.model.ModelViewItem
getDefinition, setDefinition, setName
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel
Methods inherited from interface org.ametys.runtime.model.ViewItem
copyTo, equals, getParent, setParent, toSAX
Methods inherited from interface org.ametys.runtime.model.ViewItemAccessor
addViewItems, getModelViewItem, getViewItem, hasModelViewItem, hasModelViewItem, hasModelViewItem
-
Constructor Details
-
ViewElementAccessorSearchUIColumn
public ViewElementAccessorSearchUIColumn()
-
-
Method Details
-
getWidth
Description copied from interface:SearchUIColumn
The column's width- Specified by:
getWidth
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
- The width
-
setWidth
Description copied from interface:SearchUIColumn
Set the column's width- Specified by:
setWidth
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
width
- The width to set
-
isHidden
Description copied from interface:SearchUIColumn
Determines if the column is hidden by default- Specified by:
isHidden
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
true
if the column is hidden by default
-
setHidden
Description copied from interface:SearchUIColumn
Set the hidden property- Specified by:
setHidden
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
hidden
-true
to hidden the columns by default
-
isEditable
Description copied from interface:SearchUIColumn
Determines if the property is editable- Specified by:
isEditable
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
true
if the property is editable
-
setEditable
Description copied from interface:SearchUIColumn
Set the editable property- Specified by:
setEditable
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
editable
-true
to authorized edition
-
isSortable
Description copied from interface:SearchUIColumn
Determines if the column is sortable- Specified by:
isSortable
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
true
if the column is sortable
-
setSortable
Description copied from interface:SearchUIColumn
Set the sortable property- Specified by:
setSortable
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
sortable
-true
to authorized sort
-
allowSortOnMultipleJoin
Description copied from interface:SearchUIColumn
Determines if sort is allowed on multiple join- Specified by:
allowSortOnMultipleJoin
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
true
if sort is allowed on multiple join,false
otherwise
-
setAllowSortOnMultipleJoin
Description copied from interface:SearchUIColumn
Set the allowSortOnMultipleJoin property- Specified by:
setAllowSortOnMultipleJoin
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
allowSortOnMultipleJoin
-true
to authorized sort on multiple join
-
getDefaultSorter
Description copied from interface:SearchUIColumn
If the column should be the default sorter 'ASC' or 'DESC'. Null otherwise.- Specified by:
getDefaultSorter
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
- 'ASC', 'DESC' or null
-
setDefaultSorter
Description copied from interface:SearchUIColumn
Set the default sorter property- Specified by:
setDefaultSorter
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
defaultSorter
- If the column should be a default sorter, 'ASC' for ascending 'DESC' for descending. Null otherwise.
-
getRenderer
Description copied from interface:SearchUIColumn
Get the JS class name for renderer- Specified by:
getRenderer
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
- The renderer
-
setRenderer
Description copied from interface:SearchUIColumn
Set the JS class name for renderer- Specified by:
setRenderer
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
renderer
- The renderer
-
getConverter
Description copied from interface:SearchUIColumn
Get the JS class name for converting field's value- Specified by:
getConverter
in interfaceSearchUIColumn<ElementDefinition>
- Returns:
- The convert JS class name
-
setConverter
Description copied from interface:SearchUIColumn
Set the JS class name for converting field's value- Specified by:
setConverter
in interfaceSearchUIColumn<ElementDefinition>
- Parameters:
converter
- The convert JS class name
-
createInstance
Description copied from interface:ViewItem
Create an instance ofViewItem
- Specified by:
createInstance
in interfaceViewItem
- Overrides:
createInstance
in classViewElementAccessor
- Returns:
- the created instance
-
toJSON
Description copied from interface:ViewItem
Converts the view item in a JSON map- Specified by:
toJSON
in interfaceViewItem
- Overrides:
toJSON
in classViewElement
- Parameters:
context
- the context of the definitions referenced in this view item and/or its children- Returns:
- The view item as a JSON map
- Throws:
ProcessingException
- If an error occurs when converting the view item
-
copyTo
Description copied from interface:ViewItem
Copy the current view item in the given one. If the view item is an accessor, its view items are not copied- Specified by:
copyTo
in interfaceViewItem
- Overrides:
copyTo
in classViewElement
- Parameters:
item
- the copy
-