Class ListViewCollectionBrowserMoldStrategy
- java.lang.Object
-
- com.hybris.cockpitng.widgets.collectionbrowser.mold.impl.common.AbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
- com.hybris.cockpitng.widgets.collectionbrowser.mold.impl.listview.ListViewCollectionBrowserMoldStrategy
-
- All Implemented Interfaces:
CollectionBrowserMoldStrategy,org.springframework.core.Ordered
public class ListViewCollectionBrowserMoldStrategy extends AbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
List view mold strategy for Collection Browser widget Renders data in simple list form with paging
Uses zkListboxcomponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classListViewCollectionBrowserMoldStrategy.CloneableListModel<E>Deprecated, for removal: This API element is subject to removal in a future version.since 1808, useListViewCollectionBrowserMoldStrategy.UnsortableListModelArrayinsteadprotected static classListViewCollectionBrowserMoldStrategy.UnsortableListModelArray<E>
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringASCENDING_TOKENstatic java.lang.StringDESCENDING_TOKENstatic java.lang.StringHFLEX_COLUMN_MIN_WIDTHstatic java.lang.StringHFLEX_COLUMN_MIN_WIDTH_ATTRstatic java.lang.StringHFLEX_MINstatic java.lang.StringMODEL_INDEXESstatic java.lang.StringMODEL_LISTstatic java.lang.StringSCLASS_COL_HEADstatic java.lang.StringSCLASS_COL_HEADERstatic java.lang.StringSCLASS_COL_HEADER_FILLstatic java.lang.StringSCLASS_LISTVIEW_CELLstatic java.lang.StringSETTING_COMPONENT_CTX_CODEstatic java.lang.StringSETTING_INVALIDATION_SOCKET_OUTPUT_NAMEstatic java.lang.StringSETTING_ITEM_RENDERERstatic java.lang.StringSORT_COLUMN_IDstatic java.lang.StringSORT_DIRECTIONstatic java.lang.StringSORTABLE_LIST_HEADERstatic java.lang.StringTOOLTIP_PROPERTY_KEY-
Fields inherited from class com.hybris.cockpitng.widgets.collectionbrowser.mold.impl.common.AbstractMoldStrategy
ATTRIBUTE_HYPERLINK_CANDIDATE, EMPTY_NAVIGATION_ITEM_SELECTOR_CONTEXT, EMPTY_PAGE_SIZE, KEY_LABEL_EMPTY_LIST, MODEL_COLUMNS_CONFIG, NO_SELECTION_INDEX, SCLASS_CELL_FOCUSED, SCLASS_CELL_HYPERLINK
-
-
Constructor Summary
Constructors Constructor Description ListViewCollectionBrowserMoldStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddCellLink(org.zkoss.zk.ui.HtmlBasedComponent component, ListColumn column, java.lang.Object entry)protected voidaddPreviouslySelected(org.zkoss.zk.ui.event.Event event, java.util.Set<java.lang.Object> selection)Deprecated, for removal: This API element is subject to removal in a future version.since 6.6protected booleanallColumnsHaveHflexMin(java.util.List<ListColumn> columns)protected voidapplyColumnAttributes(ListColumn column, org.zkoss.zul.Listheader columnHeader)protected voidbuildHeaders(ListView columnConfig, SortData sortData, java.lang.String typeCode)protected voidconfigureHeaderSort(org.zkoss.zul.Listheader header, SortData sortData, java.lang.String propertyQualifier)protected WidgetComponentRendererListener<org.zkoss.zul.Listitem,ListView,java.lang.Object>createCellRenderedListener()protected WidgetComponentRendererListener<org.zkoss.zul.Listitem,ListView,java.lang.Object>createLinkRenderedListener(ListColumn forcedLinkColumn)protected org.zkoss.zul.ListheadercreateListHeader(SortData sortData, ListColumn column, java.lang.String typeCode)protected org.zkoss.zul.ListModelArray<java.lang.Object>createListModel(java.util.List<?> data)protected WidgetComponentRendererListener<org.zkoss.zul.Listitem,ListView,java.lang.Object>createRowRenderedListener()voiddeselectItems()Deselects all items.voidfocusItem(java.lang.Object oldFocus, java.lang.Object newFocus)Mark provided item as focused.protected ListViewgetColumnConfiguration(java.lang.String typeCode)protected java.lang.ObjectgetItemObject(org.zkoss.zul.Listitem item)org.zkoss.zul.ListboxgetListBox()org.zkoss.zul.ListheadgetListBoxHead()protected org.zkoss.zul.ListModelgetListModel()protected java.lang.ObjectgetModel()Deprecated, for removal: This API element is subject to removal in a future version.usegetListModel()insteadjava.lang.StringgetName()NavigationItemSelectorContextgetNavigationItemSelectorContext()protected org.zkoss.zk.ui.ComponentgetParent()protected java.lang.StringgetRendererSetting()protected ExpressionResolverFactorygetResolverFactory()protected java.util.SetgetSelectedObjectsFromModel()java.lang.StringgetTooltipText()protected java.util.Optional<java.lang.Object>getUiElementAt(int index)protected intgetUiModelSize()protected WidgetModelgetWidgetModel()protected voidhandleChangeFocus(java.lang.Object itemToFocus)protected voidhandleChangeSelection(java.lang.Object itemToSelect)Deprecated, for removal: This API element is subject to removal in a future version.use #handleChangeFocus(Object) insteadprotected voidhandleCollectionUpdate(java.util.Collection<java.lang.Object> collection)voidhandleObjectCreateEvent(CockpitEvent event)Additional logic to perform on object create event.voidhandleObjectDeleteEvent(CockpitEvent event)Additional logic to perform on object deleted event.protected voidinitialize()Deprecated, for removal: This API element is subject to removal in a future version.since 2005protected voidinitialize(SinglePage singlePage)protected voidinitializeRenderer(NotifyingWidgetComponentRenderer<org.zkoss.zul.Listitem,ListView,java.lang.Object> renderer)protected voidinitSelectionMode()Initializes the selection mode i.e.protected booleanisEmptyOrNotConfiguredPage(SinglePage singlePage, ListView columnConfiguration)protected booleanisSortableAttribute(ListColumn column)protected booleanisSortableHeaders()protected booleanisStrategyInitialized(java.lang.String typeCode)protected ListViewloadColumnConfiguration(java.lang.String typeCode)Loads the (column) UI configuration for the provided type with code typeCode.protected voidonClickItemEvent(org.zkoss.zk.ui.event.Event event, java.lang.Object item)protected voidonSelectItemEvent(org.zkoss.zk.ui.event.Event event)voidonSortEvent(org.zkoss.zk.ui.event.SortEvent sortEvent)protected voidprocessViewWith(SinglePage singlePage)voidrelease()Method called by the controller when mold is turned off.voidrender(org.zkoss.zk.ui.Component parent, SinglePage singlePage)Render mold inside given parent component with single page.protected voidrenderEntries(java.util.List<?> currentPage, ListView config)protected voidrenderEntries(org.zkoss.zul.ListModelArray<?> simpleListModel, ListView config)protected voidrenderEntriesWithoutConfiguration(org.zkoss.zul.ListModelArray<?> simpleListModel)voidrenderList(java.util.List<?> list, ListView config, SortData sortData, java.lang.String typeCode)protected voidrenderListWithoutConfiguration(SinglePage singlePage)voidreset()Resets the mold to the initial state, displaying no data.protected voidresetModel()protected voidresetView()protected voidselect(java.lang.Object itemToSelect, org.zkoss.zul.ext.Selectable<?> selectable)voidselectItems(java.util.Set<?> items)Select given items.protected voidsetItemFocused(org.zkoss.zul.Listitem item, boolean focused)voidsetPage(SinglePage singlePage)Set data for a single page.voidsetResolverFactory(ExpressionResolverFactory resolverFactory)protected voidupdateModelData(org.zkoss.zul.ListModelArray<java.lang.Object> listModel, java.lang.Object data)protected voidupdateSelectionStatus(org.zkoss.zul.ListModelArray<?> simpleListModel)-
Methods inherited from class com.hybris.cockpitng.widgets.collectionbrowser.mold.impl.common.AbstractMoldStrategy
addLink, canHandle, chooseEmptyMessageToDisplayFor, getBackofficeTypeUtils, getContext, getFocusedObjectFromModel, getHyperlinkFallbackLabelProvider, getIndexOf, getLabelService, getNotificationService, getOrder, getPermissionFacade, getRenderer, getTypeCode, handleObjectsUpdateEvent, handleObjectUpdateEvent, initializeRenderer, isHandlingObjectEvents, isLink, nextItemSelectorInvocation, previousItemSelectorInvocation, setBackofficeTypeUtils, setContext, setHyperlinkFallbackLabelProvider, setLabelService, setMoldRendererFactory, setNotificationService, setOrder, setPermissionFacade, setRenderer, setRendererFactory, setTypeCode
-
-
-
-
Field Detail
-
SETTING_ITEM_RENDERER
public static final java.lang.String SETTING_ITEM_RENDERER
- See Also:
- Constant Field Values
-
SETTING_COMPONENT_CTX_CODE
public static final java.lang.String SETTING_COMPONENT_CTX_CODE
- See Also:
- Constant Field Values
-
SETTING_INVALIDATION_SOCKET_OUTPUT_NAME
public static final java.lang.String SETTING_INVALIDATION_SOCKET_OUTPUT_NAME
- See Also:
- Constant Field Values
-
TOOLTIP_PROPERTY_KEY
public static final java.lang.String TOOLTIP_PROPERTY_KEY
- See Also:
- Constant Field Values
-
MODEL_LIST
public static final java.lang.String MODEL_LIST
- See Also:
- Constant Field Values
-
MODEL_INDEXES
public static final java.lang.String MODEL_INDEXES
- See Also:
- Constant Field Values
-
SCLASS_COL_HEADER
public static final java.lang.String SCLASS_COL_HEADER
- See Also:
- Constant Field Values
-
SCLASS_COL_HEADER_FILL
public static final java.lang.String SCLASS_COL_HEADER_FILL
- See Also:
- Constant Field Values
-
SCLASS_COL_HEAD
public static final java.lang.String SCLASS_COL_HEAD
- See Also:
- Constant Field Values
-
SORTABLE_LIST_HEADER
public static final java.lang.String SORTABLE_LIST_HEADER
- See Also:
- Constant Field Values
-
SORT_DIRECTION
public static final java.lang.String SORT_DIRECTION
- See Also:
- Constant Field Values
-
SORT_COLUMN_ID
public static final java.lang.String SORT_COLUMN_ID
- See Also:
- Constant Field Values
-
ASCENDING_TOKEN
public static final java.lang.String ASCENDING_TOKEN
- See Also:
- Constant Field Values
-
DESCENDING_TOKEN
public static final java.lang.String DESCENDING_TOKEN
- See Also:
- Constant Field Values
-
HFLEX_MIN
public static final java.lang.String HFLEX_MIN
- See Also:
- Constant Field Values
-
SCLASS_LISTVIEW_CELL
public static final java.lang.String SCLASS_LISTVIEW_CELL
- See Also:
- Constant Field Values
-
HFLEX_COLUMN_MIN_WIDTH
public static final java.lang.String HFLEX_COLUMN_MIN_WIDTH
- See Also:
- Constant Field Values
-
HFLEX_COLUMN_MIN_WIDTH_ATTR
public static final java.lang.String HFLEX_COLUMN_MIN_WIDTH_ATTR
- See Also:
- Constant Field Values
-
-
Method Detail
-
createListHeader
protected org.zkoss.zul.Listheader createListHeader(SortData sortData, ListColumn column, java.lang.String typeCode)
-
isSortableAttribute
protected boolean isSortableAttribute(ListColumn column)
-
configureHeaderSort
protected void configureHeaderSort(org.zkoss.zul.Listheader header, SortData sortData, java.lang.String propertyQualifier)
-
onSortEvent
public void onSortEvent(org.zkoss.zk.ui.event.SortEvent sortEvent)
-
initialize
@Deprecated(since="2005", forRemoval=true) protected void initialize()Deprecated, for removal: This API element is subject to removal in a future version.since 2005
-
initialize
protected void initialize(SinglePage singlePage)
-
reset
public void reset()
Description copied from interface:CollectionBrowserMoldStrategyResets the mold to the initial state, displaying no data.
-
resetModel
protected void resetModel()
-
resetView
protected void resetView()
-
render
public void render(org.zkoss.zk.ui.Component parent, SinglePage singlePage)Description copied from interface:CollectionBrowserMoldStrategyRender mold inside given parent component with single page.
-
getParent
protected org.zkoss.zk.ui.Component getParent()
-
setPage
public void setPage(SinglePage singlePage)
Description copied from interface:CollectionBrowserMoldStrategySet data for a single page.- Specified by:
setPagein interfaceCollectionBrowserMoldStrategy- Overrides:
setPagein classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
processViewWith
protected void processViewWith(SinglePage singlePage)
-
isEmptyOrNotConfiguredPage
protected boolean isEmptyOrNotConfiguredPage(SinglePage singlePage, ListView columnConfiguration)
-
renderListWithoutConfiguration
protected void renderListWithoutConfiguration(SinglePage singlePage)
-
renderEntriesWithoutConfiguration
protected void renderEntriesWithoutConfiguration(org.zkoss.zul.ListModelArray<?> simpleListModel)
-
getColumnConfiguration
protected ListView getColumnConfiguration(java.lang.String typeCode)
-
isStrategyInitialized
protected boolean isStrategyInitialized(java.lang.String typeCode)
-
loadColumnConfiguration
protected ListView loadColumnConfiguration(java.lang.String typeCode)
Loads the (column) UI configuration for the provided type with code typeCode.- Parameters:
typeCode- type code- Returns:
- the column UI configuration
-
getUiModelSize
protected int getUiModelSize()
- Overrides:
getUiModelSizein classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
getUiElementAt
protected java.util.Optional<java.lang.Object> getUiElementAt(int index)
- Overrides:
getUiElementAtin classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
handleChangeSelection
@Deprecated(since="6.5", forRemoval=true) protected void handleChangeSelection(java.lang.Object itemToSelect)Deprecated, for removal: This API element is subject to removal in a future version.use #handleChangeFocus(Object) instead- Since:
- 6.5
- See Also:
handleChangeFocus(Object)
-
handleChangeFocus
protected void handleChangeFocus(java.lang.Object itemToFocus)
- Overrides:
handleChangeFocusin classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
select
protected void select(java.lang.Object itemToSelect, org.zkoss.zul.ext.Selectable<?> selectable)
-
handleCollectionUpdate
protected void handleCollectionUpdate(java.util.Collection<java.lang.Object> collection)
- Specified by:
handleCollectionUpdatein classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
selectItems
public void selectItems(java.util.Set<?> items)
Description copied from interface:CollectionBrowserMoldStrategySelect given items.No notifications should be sent.
- Parameters:
items- items to be selected.
-
deselectItems
public void deselectItems()
Description copied from interface:CollectionBrowserMoldStrategyDeselects all items.No notifications should be sent.
-
setItemFocused
protected void setItemFocused(org.zkoss.zul.Listitem item, boolean focused)
-
focusItem
public void focusItem(java.lang.Object oldFocus, java.lang.Object newFocus)Description copied from interface:CollectionBrowserMoldStrategyMark provided item as focused. Only one item may be focused at the time.- Parameters:
oldFocus- item that was focused up until nownewFocus- item to be marked as focused
-
release
public void release()
Description copied from interface:CollectionBrowserMoldStrategyMethod called by the controller when mold is turned off. It should remove itself from its parent and free resources.
-
initSelectionMode
protected void initSelectionMode()
Initializes the selection mode i.e. sets whether multi-selection is enabled or not (based on the widget setting "multiSelect") and if so, enables checkbox selection.
-
buildHeaders
protected void buildHeaders(ListView columnConfig, SortData sortData, java.lang.String typeCode)
-
allColumnsHaveHflexMin
protected boolean allColumnsHaveHflexMin(java.util.List<ListColumn> columns)
-
applyColumnAttributes
protected void applyColumnAttributes(ListColumn column, org.zkoss.zul.Listheader columnHeader)
-
renderList
public void renderList(java.util.List<?> list, ListView config, SortData sortData, java.lang.String typeCode)
-
updateModelData
protected void updateModelData(org.zkoss.zul.ListModelArray<java.lang.Object> listModel, java.lang.Object data)
-
renderEntries
protected void renderEntries(java.util.List<?> currentPage, ListView config)
-
renderEntries
protected void renderEntries(org.zkoss.zul.ListModelArray<?> simpleListModel, ListView config)
-
createRowRenderedListener
protected WidgetComponentRendererListener<org.zkoss.zul.Listitem,ListView,java.lang.Object> createRowRenderedListener()
-
createLinkRenderedListener
protected WidgetComponentRendererListener<org.zkoss.zul.Listitem,ListView,java.lang.Object> createLinkRenderedListener(ListColumn forcedLinkColumn)
-
createCellRenderedListener
protected WidgetComponentRendererListener<org.zkoss.zul.Listitem,ListView,java.lang.Object> createCellRenderedListener()
-
addCellLink
protected void addCellLink(org.zkoss.zk.ui.HtmlBasedComponent component, ListColumn column, java.lang.Object entry)
-
updateSelectionStatus
protected void updateSelectionStatus(org.zkoss.zul.ListModelArray<?> simpleListModel)
-
createListModel
protected org.zkoss.zul.ListModelArray<java.lang.Object> createListModel(java.util.List<?> data)
-
onClickItemEvent
protected void onClickItemEvent(org.zkoss.zk.ui.event.Event event, java.lang.Object item)
-
onSelectItemEvent
protected void onSelectItemEvent(org.zkoss.zk.ui.event.Event event)
-
getItemObject
protected java.lang.Object getItemObject(org.zkoss.zul.Listitem item)
-
addPreviouslySelected
@Deprecated(since="6.6", forRemoval=true) protected void addPreviouslySelected(org.zkoss.zk.ui.event.Event event, java.util.Set<java.lang.Object> selection)Deprecated, for removal: This API element is subject to removal in a future version.since 6.6
-
getName
public java.lang.String getName()
- Returns:
- name of the mold for internal use (e.g. to determine CSS class of (in)active mold selection button).
-
getTooltipText
public java.lang.String getTooltipText()
- Returns:
- tooltip text that should appear on a mold selection button.
-
initializeRenderer
protected void initializeRenderer(NotifyingWidgetComponentRenderer<org.zkoss.zul.Listitem,ListView,java.lang.Object> renderer)
- Overrides:
initializeRendererin classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
getRendererSetting
protected java.lang.String getRendererSetting()
- Overrides:
getRendererSettingin classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
getModel
@Deprecated(since="6.6", forRemoval=true) protected java.lang.Object getModel()Deprecated, for removal: This API element is subject to removal in a future version.usegetListModel()instead- Since:
- 6.6
-
getListModel
protected org.zkoss.zul.ListModel getListModel()
-
isSortableHeaders
protected boolean isSortableHeaders()
-
getNavigationItemSelectorContext
public NavigationItemSelectorContext getNavigationItemSelectorContext()
- Returns:
- current
NavigationItemSelectorContext.
-
getSelectedObjectsFromModel
protected java.util.Set getSelectedObjectsFromModel()
-
getWidgetModel
protected WidgetModel getWidgetModel()
- Overrides:
getWidgetModelin classAbstractMoldStrategy<org.zkoss.zul.Listitem,ListView,java.lang.Object>
-
handleObjectCreateEvent
public void handleObjectCreateEvent(CockpitEvent event)
Description copied from interface:CollectionBrowserMoldStrategyAdditional logic to perform on object create event.
-
handleObjectDeleteEvent
public void handleObjectDeleteEvent(CockpitEvent event)
Description copied from interface:CollectionBrowserMoldStrategyAdditional logic to perform on object deleted event.
-
getListBoxHead
public org.zkoss.zul.Listhead getListBoxHead()
-
getListBox
public org.zkoss.zul.Listbox getListBox()
-
getResolverFactory
protected ExpressionResolverFactory getResolverFactory()
-
setResolverFactory
public void setResolverFactory(ExpressionResolverFactory resolverFactory)
-
-