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.SortInfoHashMap, FIXGRIDBinding.TextSearcherNested 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_ODS, CONTENTTYPE_EXPORT_PDF, CONTENTTYPE_EXPORT_TAB, CONTENTTYPE_EXPORT_XLSX, CONTENTTYPE_EXPORT_XML, DUMMY_FIXGRIDSORTINFO, 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_thisFields inherited from interface org.eclnt.jsfserver.elements.impl.IFIXGRIDBinding
SORT_ASCENDING, SORT_DESCENDING, SORT_UNSORTED -
Constructor Summary
ConstructorsConstructorDescriptionFIXGRIDListBinding(boolean changeIndexIsSupported) Constructor which allows to switch on performance optimized data management. -
Method Summary
Modifier and TypeMethodDescriptionvoidWhen 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.voiddeselectItem(int index) De-selects item with certain index.voidensureItemToBeDisplayed(int index) Same as#ensureItemToBeDisplayed(Object), but now with the index of the item as parameter.voidWhile the server side grid may have 1000s of items, only a few of them is rendered on client side.protected voidDefault 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.intMaximum number of items.Returns all selected items in the sequence they occur within the grid.voidUsed internally.voidlistItemWasAdded(IListWithChangeIndex list, Object concreteItem) voidlistItemWasRemoved(IListWithChangeIndex list, Object concreteItem) protected voidprocessSearch(String searchString, String sortReference) Default implementation: positions the grid onto the first item that starts with the searchString.voidselectItem(int index) Selects the item with the index passed.voidsetItems(IListWithChangeIndex<ItemClass> items) The original item list can be changed during the lifecycle of FIXGRIDListBinding by passing a new instance via this method.voidsetSbvalue(int value) Sets the top index of the grid.voidsetSbvalue(String value) Set the top index of what is currently passed to the client.protected voidActual sorting of grid by one column.protected voidIn 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, findCurrentSortInfo, findHighestSortSequence, findSortComparatorForColumnValue, findSortInfoForSortSequence, 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, getToBeAccessedNodeUnitValue, 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, sort, storePersistentData, storePersistentData, storePersistentDataImplicitly, unhighlightAllCells, updateHighlightMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclnt.jsfserver.elements.IConfiguredByLayout
addConfiguredByLayoutListener, removeConfiguredByLayoutListenerMethods inherited from interface org.eclnt.jsfserver.elements.impl.IFIXGRIDBinding
checkIfChangeIndexIsSupported, getClientvisibleamount, getColumnsequence, getConnectedBinding, getExportableColumns, getExportableColumns, getFixgridComponent, 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 ofArrayListWithChangeIndexis 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:
getRowsin interfaceIFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
getSbmaximum
public int getSbmaximum()Maximum number of items. Represents the size of the list that is managed internally.- Specified by:
getSbmaximumin 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:
setSbvaluein interfaceIFIXGRIDBinding<ItemClass extends FIXGRIDItem>- Overrides:
setSbvaluein classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
listChanged
Used internally.- Specified by:
listChangedin interfaceIListWithChangeIndexListener
-
listItemWasRemoved
- Specified by:
listItemWasRemovedin interfaceIListWithChangeIndexListener
-
listItemWasAdded
- Specified by:
listItemWasAddedin 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:
ensureItemToBeDisplayedin 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:FIXGRIDBindingSets 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:
setSbvaluein 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:FIXGRIDBindingDefault implementation: no shift selection, but just normal selection- Overrides:
fillShiftSelectionin 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:
getListOfItemsin classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
sortGrid
Description copied from class:FIXGRIDBindingActual sorting of grid by one column. This method needs to be overridden by grid implementations.- Specified by:
sortGridin classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
sortGridByOriginalIndex
protected void sortGridByOriginalIndex()Description copied from class:FIXGRIDBindingIn case the grid is supporting "triplesort": this is the method to sort the grid by its original index- Specified by:
sortGridByOriginalIndexin classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-
applyOriginalIndexToCurrentContent
public void applyOriginalIndexToCurrentContent()Description copied from interface:IFIXGRIDBindingWhen 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:
applyOriginalIndexToCurrentContentin 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:
processSearchin classFIXGRIDBinding<ItemClass extends FIXGRIDItem>
-