org.eclnt.jsfserver.elements.impl

## Class FIXGRIDListBinding<ItemClass extends FIXGRIDItem>

- java.lang.Object
- - org.eclnt.jsfserver.elements.impl.FIXGRIDBinding<ItemClass>
  - - org.eclnt.jsfserver.elements.impl.FIXGRIDListBinding<ItemClass>

- All Implemented Interfaces:
    java.io.Serializable, IFIXGRIDBinding<ItemClass>, IListWithChangeIndexListener, IDynamicContentBindingObject
  Direct Known Subclasses:
    ARRAYGRIDListBinding, DynBeanUI.Grid, FIXGRIDBeanListBinding, FIXGRIDPivotListBinding, IdAttributesSelection.IdAttributesLineGrid, IdTextSelection.IdTextLineGrid, SC_FIXGRIDListBinding, SPANGRIDListBinding

      public class FIXGRIDListBinding<ItemClass extends FIXGRIDItem>
      extends FIXGRIDBinding<ItemClass>
      implements IFIXGRIDBinding<ItemClass>, java.io.Serializable, IListWithChangeIndexListener

  Binding class for FIXGRID component. Used as server counter part of a client side grid - when the grid renders a list of items. The items are managed in a list, that is accessed by getItems(). This list can be changed from outside. - The class does all the "handshaking" between the client's view on data and the server's view: the client only knows the visible items, the server knows all items. Every time the client scrolls then actually the server side FIXGRIDListBinding passes a "window of data" to the client which represents the visible view. All this management is done by this class without letting the user know - the user only knows the getItems()-list to deal with.
  PAY ATTENTION: references to FIXGRIDListBinding must be "stable references". I.e.: use getItems().clear() for clearing the list, do not re-create list instances.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclnt.jsfserver.elements.impl.FIXGRIDBinding

      `FIXGRIDBinding.Exporter, FIXGRIDBinding.FormattedValue, FIXGRIDBinding.ScrollHelper, FIXGRIDBinding.SortHelper, FIXGRIDBinding.TextSearcher`

    - ### Nested classes/interfaces inherited from interface org.eclnt.jsfserver.elements.impl.IFIXGRIDBinding

      `IFIXGRIDBinding.FIXGRIDSortInfo`

  - ### Field Summary

    - ### Fields inherited from class org.eclnt.jsfserver.elements.impl.FIXGRIDBinding

      `m_columnsequence, m_currentlyFocussedItem, m_defaultColumnsequence, m_firstItemForShiftSelection, m_initialized, m_modcolumnwidths, m_numberoffooterrows, m_numberofheaderrows, m_objectBinding, m_previouslyFocussedItem, m_sbvalue, m_sbvisibleamount, m_selectedItems, m_sortInfo, m_this`

    - ### Fields inherited from interface org.eclnt.jsfserver.elements.impl.IFIXGRIDBinding

      `SORT_ASCENDING, SORT_DESCENDING, SORT_UNSORTED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FIXGRIDListBinding()`
    `FIXGRIDListBinding(boolean changeIndexIsSupported)` Constructor which allows to switch on performance optimized data management.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected IListWithChangeIndex<ItemClass>` | `createItems()` Factory method for creating the item object that is internally used when the FIXGRIDListBinding object is created.
    `void` | `deselectItem(int index)` De-selects item with certain index.
    `void` | `ensureItemToBeDisplayed(int index)` Same as `#ensureItemToBeDisplayed(Object)`, but now with the index of the item as parameter.
    `void` | `ensureItemToBeDisplayed(ItemClass item)` While the server side grid may have 1000s of items, only a few of them is rendered on client side.
    `protected void` | `fillShiftSelection()` Default implementation: no shift selection, but just normal selection
    `java.util.List<ItemClass>` | `getItems()` Get list of managed items.
    `protected java.util.List<ItemClass>` | `getListOfItems()` Implementation for the grid.
    `java.util.List<ItemClass>` | `getRows()` Passes back thes items which are currently visible to the user interface.
    `int` | `getSbmaximum()` Maximum number of items.
    `java.util.Collection<ItemClass>` | `getSelectedItemsAsSequence()` Returns all selected items in the sequence they occur within the grid.
    `void` | `listChanged(IListWithChangeIndex list)` Used internally.
    `void` | `listItemWasAdded(IListWithChangeIndex list, java.lang.Object concreteItem)`
    `void` | `listItemWasRemoved(IListWithChangeIndex list, java.lang.Object concreteItem)`
    `protected void` | `processSearch(java.lang.String searchString, java.lang.String sortReference)` Default implementation: positions the grid onto the first item that starts with the searchString.
    `void` | `selectItem(int index)` Selects the item with the index passed.
    `void` | `setItems(IListWithChangeIndex<ItemClass> items)` The original item list can be changed during the lifecycle of FIXGRIDListBinding by passing a new instance via this method.
    `void` | `setSbvalue(int value)` Sets the top index of the grid.
    `void` | `setSbvalue(java.lang.String value)` Set the top index of what is currently passed to the client.
    `protected void` | `sortGrid(java.lang.String sortReference, java.lang.String objectBindingString, boolean ascending)` Actual sorting of grid.

    - ### Methods inherited from class org.eclnt.jsfserver.elements.impl.FIXGRIDBinding

      `applyPersistentData, checkIfCellsAreHighlighted, checkIfChangeIndexIsSupported, clearSortInfo, connectWithBinding, createDefaultStringComparator, createExporter, createScrollHelper, createTextSearcher, deselectCurrentSelection, deselectItem, deselectItem, deselectItemWCB, executeOnInitializedGrid, findSortComparatorForColumnValue, getAltPressedOfLastSelection, getClientvisibleamount, getColumnIndexOfLastSelection, getColumnInfos, getColumnsequence, getColumnTexts, getConnectedBinding, getCtrlPressedOfLastSelection, getCurrentColumWdithSequenceInfo, getCurrentHorizontalScrollPosition, getDefaultColumnsequence, getExportableColumns, getExportableColumns, getExporter, getFixgridComponent, getIndextobevisibleOfItems, getListOfExportItems, getModcolumnwidths, getModcolumnwidthsAsArray, getMouseButtonOfLastSelection, getNewClientHorizontalScrollPosition, getObjecttobevisibleOfItems, getOriginalcolumnwidths, getOriginalcolumnwidthsAsArray, getRowDataUI, getSbvalue, getSbvisibleamount, getScrollHelper, getSelectedItem, getSelectedItems, getShiftPressedOfLastSelection, getSortInfo, getSortInfoForReference, getTextSearcher, getToBeAccessedNode, getToBeAccessedNodeExpression, getToBeAccessedNodeFormatmaskValue, getToBeAccessedNodeFormattedValue, getToBeAccessedNodeFormatValue, getToBeAccessedNodeStringValue, getToBeAccessedNodeTimezoneValue, getToBeAccessedNodeValue, getVisibleColumns, getVisibleColumns, init_CONTENTTYPE_EXPORT_CSV, init_CONTENTTYPE_EXPORT_PDF, init_CONTENTTYPE_EXPORT_XLSX, init_CONTENTTYPE_EXPORT_XML, initialize, initPopupEditColumnDetailsUndecorated, initPopupGridFunctionsUndecorated, initTextSearcherShowSearchInfoPopup, isCurrentlyProcessingGridAction, isInitialized, isItemSelected, moveUpDown, onClearCellHighlight, onColumnSequenceUpdated, onColumnWidthsUpdated, onDrop, onEditColumnDetails, onFirstLineUp, onGridAction, onGridActionExecute, onLastLineDown, onOpenGridExportFunctions, onOpenGridFunctions, onPopupMenuItem, onPopupMenuLoad, onSelectionUpdateByClientActivity, onSelectorTitleIconInvoked, openEditColumnDetailsPopup, openGridExportFunctionsPopup, openGridFunctionsPopup, passComponentData, processMultipleSort, processMultipleSort, processSort, renderingBegins, resort, scrollHorizontallyToLastClientPosition, scrollHorizontallyToPosition, selectAndFocusItem, selectItem, selectItem, setClientvisibleamount, setColumnIndexOfLastSelection, setColumnIndexOfLastSelection, setColumnsequence, setCurrentHorizontalScrollPosition, setCurrentlyProcessingGridAction, setDefaultColumnsequence, setIndextobevisibleOfItems, setModcolumnwidth, setModcolumnwidths, setModcolumnwidthsArray, setModcolumnwidthsList, setObjecttobevisibleOfItems, setSbvalue, setSbvisibleamount, setToBeAccessedNode, sort, storePersistentData, storePersistentDataImplicitly, unhighlightAllCells, updateHighlight`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclnt.jsfserver.elements.impl.IFIXGRIDBinding

      `checkIfChangeIndexIsSupported, getClientvisibleamount, getColumnsequence, getConnectedBinding, getExportableColumns, getExportableColumns, getIndextobevisibleOfItems, getModcolumnwidths, getNewClientHorizontalScrollPosition, getObjecttobevisibleOfItems, getSbvalue, getSbvisibleamount, getSortInfo, getSortInfoForReference, getVisibleColumns, getVisibleColumns, passComponentData, renderingBegins, setClientvisibleamount, setColumnIndexOfLastSelection, setColumnIndexOfLastSelection, setColumnsequence, setCurrentHorizontalScrollPosition, setIndextobevisibleOfItems, setModcolumnwidths, setObjecttobevisibleOfItems, setSbvisibleamount`

- - ### Constructor Detail

    - #### FIXGRIDListBinding

          public FIXGRIDListBinding()

    - #### FIXGRIDListBinding

          public FIXGRIDListBinding(boolean changeIndexIsSupported)

      Constructor which allows to switch on performance optimized data management. See `FIXGRIDBinding.FIXGRIDBinding(boolean)`.

  - ### Method Detail

    - #### createItems

          protected IListWithChangeIndex<ItemClass> createItems()

      Factory method for creating the item object that is internally used when the FIXGRIDListBinding object is created. By default an implementation of `ArrayListWithChangeIndex` is returned. You can override an add you own implementation.
      The method is called within the constructor of FIXGRIDListBinding.

    - #### setItems

          public void setItems(IListWithChangeIndex<ItemClass> items)

      The original item list can be changed during the lifecycle of FIXGRIDListBinding by passing a new instance via this method.

    - #### getRows

          public java.util.List<ItemClass> getRows()

      Passes back thes items which are currently visible to the user interface. This is NOT the list of all items - use getItems() to access the whole list.
      Specified by:
        `getRows` in interface `IFIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### getSbmaximum

          public int getSbmaximum()

      Maximum number of items. Represents the size of the list that is managed internally.
      Specified by:
        `getSbmaximum` in interface `IFIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### getItems

          public java.util.List<ItemClass> getItems()

      Get list of managed items. Using prorgrams can do "anything" they want with the list. I.e. clear it, append items, ...

    - #### setSbvalue

          public void setSbvalue(java.lang.String value)

      Set the top index of what is currently passed to the client. With a fresh list the top index is 0 by default, but you can set the top index to any value (which is below the size of the list) in order to scroll to a certain component.
      Specified by:
        `setSbvalue` in interface `IFIXGRIDBinding<ItemClass extends FIXGRIDItem>`
      Overrides:
        `setSbvalue` in class `FIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### listChanged

          public void listChanged(IListWithChangeIndex list)

      Used internally.
      Specified by:
        `listChanged` in interface `IListWithChangeIndexListener`

    - #### listItemWasRemoved

          public void listItemWasRemoved(IListWithChangeIndex list,
                                         java.lang.Object concreteItem)

      Specified by:
        `listItemWasRemoved` in interface `IListWithChangeIndexListener`

    - #### listItemWasAdded

          public void listItemWasAdded(IListWithChangeIndex list,
                                       java.lang.Object concreteItem)

      Specified by:
        `listItemWasAdded` in interface `IListWithChangeIndexListener`

    - #### ensureItemToBeDisplayed

          public void ensureItemToBeDisplayed(ItemClass item)

      While the server side grid may have 1000s of items, only a few of them is rendered on client side. By calling this method you ensure that a certain item is in the "window of items" that is brought to the client. The grid will scroll so that this item will be visible to the user.
      Specified by:
        `ensureItemToBeDisplayed` in class `FIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### ensureItemToBeDisplayed

          public void ensureItemToBeDisplayed(int index)

      Same as `#ensureItemToBeDisplayed(Object)`, but now with the index of the item as parameter.

    - #### setSbvalue

          public void setSbvalue(int value)

      Description copied from class: `FIXGRIDBinding`
      Sets the top index of the grid. Using this method you can scroll the grid to any top position. Please make sure that the value passed is a correct index into your grid.
      Overrides:
        `setSbvalue` in class `FIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### getSelectedItemsAsSequence

          public java.util.Collection<ItemClass> getSelectedItemsAsSequence()

      Returns all selected items in the sequence they occur within the grid. Use getSelectedItems() returning a Set for normal operations - it is much faster. Only use this method when really requiring the order of items.

    - #### selectItem

          public void selectItem(int index)

      Selects the item with the index passed. Use either this method or the FIXGRIDBinding.selectItem(IFIXGRIDItem) in order to select a grid item.
      Please pay attention: in case of using "lazy loading of grid items / load on demand" you need to make sure that there actually is a value behind the index.

    - #### deselectItem

          public void deselectItem(int index)

      De-selects item with certain index. Use either this method or `FIXGRIDBinding.deselectItem(IFIXGRIDItem)` in order to de-select items.
      Please pay attention: in case of using "lazy loading of grid items / load on demand" you need to make sure that there actually is a value behind the index.

    - #### fillShiftSelection

          protected void fillShiftSelection()

      Description copied from class: `FIXGRIDBinding`
      Default implementation: no shift selection, but just normal selection
      Overrides:
        `fillShiftSelection` in class `FIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### getListOfItems

          protected java.util.List<ItemClass> getListOfItems()

      Implementation for the grid. This returns the getItems() collection. You may override this function in case you load your grid data step by step.
      Specified by:
        `getListOfItems` in class `FIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### sortGrid

          protected void sortGrid(java.lang.String sortReference,
                                  java.lang.String objectBindingString,
                                  boolean ascending)

      Description copied from class: `FIXGRIDBinding`
      Actual sorting of grid. This method needs to be overridden by grid implementations.
      Specified by:
        `sortGrid` in class `FIXGRIDBinding<ItemClass extends FIXGRIDItem>`

    - #### processSearch

          protected void processSearch(java.lang.String searchString,
                                       java.lang.String sortReference)

      Default implementation: positions the grid onto the first item that starts with the searchString. Only works if sortReference is not null. This method needs to be overridden when applying own searches or when not all data is loaded into the FIXGRIDListBinding yet.
      Overrides:
        `processSearch` in class `FIXGRIDBinding<ItemClass extends FIXGRIDItem>`

Copyright © CaptainCasa Gmbh. All Rights Reserved.