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:
Serializable
,IConfiguredByLayout
,IFIXGRIDBinding<ItemClass>
,IListWithChangeIndexListener
,IDynamicContentBindingObject
- Direct Known Subclasses:
ARRAYGRIDListBinding
,DynBeanUI.Grid
,FIXGRIDBeanListBinding
,FIXGRIDPivotListBinding
,IdAttributesSelection.IdAttributesLineGrid
,IdTextSelection.IdTextLineGrid
,SPANGRIDListBinding
public class FIXGRIDListBinding<ItemClass extends FIXGRIDItem>
extends FIXGRIDBinding<ItemClass>
implements IFIXGRIDBinding<ItemClass>, 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.
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:
-
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
CONTENTTYPE_EXPORT_CSV, CONTENTTYPE_EXPORT_HTML, CONTENTTYPE_EXPORT_PDF, CONTENTTYPE_EXPORT_TAB, CONTENTTYPE_EXPORT_XLSX, CONTENTTYPE_EXPORT_XML, EXPORT_COLUMNHEADER_PLACEHOLDER, 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
ConstructorDescriptionFIXGRIDListBinding
(boolean changeIndexIsSupported) Constructor which allows to switch on performance optimized data management. -
Method Summary
Modifier and TypeMethodDescriptionvoid
When using triple state sorting then the original index of the items needs to be stored in the items.protected IListWithChangeIndex<ItemClass>
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
While the server side grid may have 1000s of items, only a few of them is rendered on client side.protected void
Default implementation: no shift selection, but just normal selectiongetItems()
Get list of managed items.Implementation for the grid.getRows()
Passes back these items which are currently visible to the user interface.int
Maximum number of items.Returns all selected items in the sequence they occur within the grid.void
Used internally.void
listItemWasAdded
(IListWithChangeIndex list, Object concreteItem) void
listItemWasRemoved
(IListWithChangeIndex list, Object concreteItem) protected void
processSearch
(String searchString, 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
(String value) Set the top index of what is currently passed to the client.protected void
Actual sorting of grid.protected void
In case the grid is supporting "triplesort": this is the method to sort the grid by its original indexMethods inherited from class org.eclnt.jsfserver.elements.impl.FIXGRIDBinding
addConfiguredByLayoutListener, applyPersistentData, avoidLoadingOfPersistentGridData, checkIfCellsAreHighlighted, checkIfChangeIndexIsSupported, checkIfFreeColumnSequenceUpdateIsSupported, checkIfSorted, checkIfToCatchGridActionError, checkSpecialTouchMultiSelection, 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, getItemColumnClientStringValue, getItemColumnFormattedValue, getListOfExportItems, getModcolumnwidths, getModcolumnwidthsAsArray, getMouseButtonOfLastSelection, getNewClientHorizontalScrollPosition, getNumberOfFixColumns, getObjecttobevisibleOfItems, getOriginalcolumnwidths, getOriginalcolumnwidthsAsArray, getRowDataUI, getSbvalue, getSbvisibleamount, getScrollHelper, getSelectedItem, getSelectedItems, getShiftPressedOfLastSelection, getSortInfo, getSortInfoForReference, getTextSearcher, getToBeAccessedNode, getToBeAccessedNodeExpression, getToBeAccessedNodeFormatmaskValue, getToBeAccessedNodeFormattedValue, getToBeAccessedNodeFormattedValue, getToBeAccessedNodeFormattedValueForExport, getToBeAccessedNodeFormatValue, getToBeAccessedNodeStringValue, getToBeAccessedNodeTimezoneValue, getToBeAccessedNodeValue, getVisibleColumns, getVisibleColumns, getWithFixColumnsByUserConfiguration, init_CONTENTTYPE_EXPORT_CSV, init_CONTENTTYPE_EXPORT_HTML, init_CONTENTTYPE_EXPORT_PDF, init_CONTENTTYPE_EXPORT_XLSX, init_CONTENTTYPE_EXPORT_XML, initialize, initPopupEditColumnDetailsUndecorated, initPopupGridFunctionsUndecorated, initTextSearcherShowSearchInfoPopup, isCurrentlyProcessingGridAction, isInitialized, isItemSelected, loadPersistentData, moveUpDown, notifyDownloadWasTriggered, onClearCellHighlight, onColumnSequenceUpdated, onColumnWidthsUpdated, onDrop, onEditColumnDetails, onFirstLineUp, onGridAction, onGridActionExecute, onLastLineDown, onOpenGridExportFunctions, onOpenGridFunctions, onPopupMenuItem, onPopupMenuLoad, onSelectionUpdateByClientActivity, onSelectorTitleIconInvoked, openEditColumnDetailsPopup, openGridExportFunctionsPopup, openGridFunctionsPopup, passComponentData, processMenuItemExecutedOnOutdatedItem, processMultipleSort, processMultipleSort, processSort, removeConfiguredByLayoutListener, renderingBegins, resetPersistentData, resort, scrollHorizontallyToLastClientPosition, scrollHorizontallyToPosition, selectAndFocusItem, selectItem, selectItem, setChangeIndexIsSupported, setClientvisibleamount, setColumnIndexOfLastSelection, setColumnIndexOfLastSelection, setColumnsequence, setCurrentHorizontalScrollPosition, setCurrentlyProcessingGridAction, setDefaultColumnsequence, setIndextobevisibleOfItems, setModcolumnwidth, setModcolumnwidths, setModcolumnwidthsArray, setModcolumnwidthsList, setNumberOfFixColumns, setObjecttobevisibleOfItems, setSbvalue, setSbvisibleamount, setToBeAccessedNode, setWithFixColumnsByUserConfiguration, sort, storePersistentData, 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.IConfiguredByLayout
addConfiguredByLayoutListener, removeConfiguredByLayoutListener
Methods inherited from interface org.eclnt.jsfserver.elements.impl.IFIXGRIDBinding
checkIfChangeIndexIsSupported, getClientvisibleamount, getColumnsequence, getConnectedBinding, getExportableColumns, getExportableColumns, getIndextobevisibleOfItems, getModcolumnwidths, getNewClientHorizontalScrollPosition, getNumberOfFixColumns, getObjecttobevisibleOfItems, getSbvalue, getSbvisibleamount, getSortInfo, getSortInfoForReference, getVisibleColumns, getVisibleColumns, passComponentData, renderingBegins, setClientvisibleamount, setColumnIndexOfLastSelection, setColumnIndexOfLastSelection, setColumnsequence, setCurrentHorizontalScrollPosition, setIndextobevisibleOfItems, setModcolumnwidths, setObjecttobevisibleOfItems, setSbvisibleamount, setWithFixColumnsByUserConfiguration
-
Constructor Details
-
FIXGRIDListBinding
public FIXGRIDListBinding() -
FIXGRIDListBinding
public FIXGRIDListBinding(boolean changeIndexIsSupported) Constructor which allows to switch on performance optimized data management. SeeFIXGRIDBinding(boolean)
.
-
-
Method Details
-
createItems
Factory method for creating the item object that is internally used when the FIXGRIDListBinding object is created. By default an implementation ofArrayListWithChangeIndex
is returned. You can override an add you own implementation.
The method is called within the constructor of FIXGRIDListBinding. -
setItems
The original item list can be changed during the lifecycle of FIXGRIDListBinding by passing a new instance via this method. -
getRows
Passes back these 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 interfaceIFIXGRIDBinding<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 interfaceIFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
getItems
Get list of managed items. Using prorgrams can do "anything" they want with the list. I.e. clear it, append items, ... -
setSbvalue
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 interfaceIFIXGRIDBinding<ItemClass extends FIXGRIDItem>
- Overrides:
setSbvalue
in classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
listChanged
Used internally.- Specified by:
listChanged
in interfaceIListWithChangeIndexListener
-
listItemWasRemoved
- Specified by:
listItemWasRemoved
in interfaceIListWithChangeIndexListener
-
listItemWasAdded
- Specified by:
listItemWasAdded
in interfaceIListWithChangeIndexListener
-
ensureItemToBeDisplayed
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 classFIXGRIDBinding<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 classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
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 orFIXGRIDBinding.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 classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
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 classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
sortGrid
Description copied from class:FIXGRIDBinding
Actual sorting of grid. This method needs to be overridden by grid implementations.- Specified by:
sortGrid
in classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
sortGridByOriginalIndex
protected void sortGridByOriginalIndex()Description copied from class:FIXGRIDBinding
In case the grid is supporting "triplesort": this is the method to sort the grid by its original index- Specified by:
sortGridByOriginalIndex
in classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
applyOriginalIndexToCurrentContent
public void applyOriginalIndexToCurrentContent()Description copied from interface:IFIXGRIDBinding
When using triple state sorting then the original index of the items needs to be stored in the items. This method assigns this original index.- Specified by:
applyOriginalIndexToCurrentContent
in interfaceIFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
processSearch
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 classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-