Class 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 zk Listbox component

    • 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
      • 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
      • SORTABLE_LIST_HEADER

        public static final java.lang.String SORTABLE_LIST_HEADER
        See Also:
        Constant Field Values
      • DESCENDING_TOKEN

        public static final java.lang.String DESCENDING_TOKEN
        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
    • Constructor Detail

      • ListViewCollectionBrowserMoldStrategy

        public ListViewCollectionBrowserMoldStrategy()
    • 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: CollectionBrowserMoldStrategy
        Resets 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: CollectionBrowserMoldStrategy
        Render mold inside given parent component with single page.
      • getParent

        protected org.zkoss.zk.ui.Component getParent()
      • 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
      • 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)
      • select

        protected void select​(java.lang.Object itemToSelect,
                              org.zkoss.zul.ext.Selectable<?> selectable)
      • selectItems

        public void selectItems​(java.util.Set<?> items)
        Description copied from interface: CollectionBrowserMoldStrategy
        Select given items.

        No notifications should be sent.

        Parameters:
        items - items to be selected.
      • deselectItems

        public void deselectItems()
        Description copied from interface: CollectionBrowserMoldStrategy
        Deselects 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: CollectionBrowserMoldStrategy
        Mark provided item as focused. Only one item may be focused at the time.
        Parameters:
        oldFocus - item that was focused up until now
        newFocus - item to be marked as focused
      • release

        public void release()
        Description copied from interface: CollectionBrowserMoldStrategy
        Method 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)
      • 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.
      • 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.
        use getListModel() instead
        Since:
        6.6
      • getListModel

        protected org.zkoss.zul.ListModel getListModel()
      • isSortableHeaders

        protected boolean isSortableHeaders()
      • getSelectedObjectsFromModel

        protected java.util.Set getSelectedObjectsFromModel()
      • handleObjectCreateEvent

        public void handleObjectCreateEvent​(CockpitEvent event)
        Description copied from interface: CollectionBrowserMoldStrategy
        Additional logic to perform on object create event.
      • handleObjectDeleteEvent

        public void handleObjectDeleteEvent​(CockpitEvent event)
        Description copied from interface: CollectionBrowserMoldStrategy
        Additional logic to perform on object deleted event.
      • getListBoxHead

        public org.zkoss.zul.Listhead getListBoxHead()
      • getListBox

        public org.zkoss.zul.Listbox getListBox()