Interface ResultList

  • All Superinterfaces:
    java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, java.io.Serializable
    All Known Implementing Classes:
    ResultListImpl

    public interface ResultList
    extends org.zkoss.zk.ui.Component
    Interface for the UI-component that displays the actual entries of a query-result. Implementations of this interface will be used by ResultSetViewImpl instances. All implementations of this interface are expected to have a constructor with no arguments. Instances of this interface exist as long as one page of a query-result is displayed. When a new query is performed or when the user scrolls to another page, a new instance will be created.
    • Field Summary

      • Fields inherited from interface org.zkoss.zk.ui.Component

        APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<ResultListItem> getAllListItems()  
      java.util.List<HeaderInformation> getHeaderInformation()
      Returns information about the headers representing the columns of this ResultList.
      int getListItemCount()  
      int getSelectedListIndex()  
      ResultListItem getSelectedListItem()  
      java.util.List<ResultListItem> getSelectedListItems()  
      void init​(ResultSetViewImpl parent, ResultSetPresenter presenter)
      Gets called directly after the new instance was created.
      void renderQueryResult​(java.util.List<ResultProperties> resultList)
      Renders the list of properties that represents the result of the previous query.
      void setContextMenu​(org.zkoss.zul.Menupopup popup)
      Sets a Menupopup to be used as context-menu of this ResultList.
      void setSelectedListIndex​(int index)
      Selects the item with the specified index in the list.
      void updateRow​(ResultProperties properties, boolean selected)
      Updates the row identified by the provided properties.
      • Methods inherited from interface org.zkoss.zk.ui.Component

        addEventListener, addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientDataAttribute, getDefinition, getDesktop, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getShadowVariable, getShadowVariable, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, query, queryAll, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride
      • Methods inherited from interface org.zkoss.zk.ui.ext.Scope

        addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
    • Method Detail

      • getListItemCount

        int getListItemCount()
        Returns:
        the number of items contained in this ResultList
      • setSelectedListIndex

        void setSelectedListIndex​(int index)
        Selects the item with the specified index in the list. All other items will be deselected.
        Parameters:
        index - index of the item to select
      • getSelectedListIndex

        int getSelectedListIndex()
        Returns:
        the index of the currently selected item in the list or -1 if no item is selected
      • getAllListItems

        java.util.List<ResultListItem> getAllListItems()
        Returns:
        a list of all items contained in this ResultList. Never null. Modifications on this list will not take effect on the ResultList.
      • getSelectedListItems

        java.util.List<ResultListItem> getSelectedListItems()
        Returns:
        a list of all selected items of this ResultList. Never null. Modifications on this list will not take effect on the ResultList.
      • getSelectedListItem

        ResultListItem getSelectedListItem()
        Returns:
        the item currently selected in the list or null if no item is selected
      • renderQueryResult

        void renderQueryResult​(java.util.List<ResultProperties> resultList)
        Renders the list of properties that represents the result of the previous query. The list will never be null or empty, because empty results are handled by the parent-view.
        Parameters:
        resultList - list of properties to render
      • updateRow

        void updateRow​(ResultProperties properties,
                       boolean selected)
        Updates the row identified by the provided properties. The properties will contain the same original index as the old row that is to be updated. Whether the updated row will be marked as unread or not is up to the implementation. Also, the implementation must decide if a viewer or an embedded index-form will be updated automatically.
        Parameters:
        properties - the metadata for the updated row
        selected - if true, the updated row must be set selected
      • setContextMenu

        void setContextMenu​(org.zkoss.zul.Menupopup popup)
        Sets a Menupopup to be used as context-menu of this ResultList. Implementations can either use the given context-menu or use this method as a notification to create or update their own context menu. This method gets called when
        • the parent view is cleared
        • the parent view is initialized
        • a query result was rendered
        Parameters:
        popup - default context-menu-popup
      • getHeaderInformation

        java.util.List<HeaderInformation> getHeaderInformation()
        Returns information about the headers representing the columns of this ResultList. If no columns are used, this method returns an empty list.
        Returns:
        header-information or an empty list. Never null.