Class DetailGlazedListsEventLayer<T>
- Type Parameters:
T- Type of the bean in the backing list.
- All Implemented Interfaces:
ca.odell.glazedlists.event.ListEventListener<T>,PropertyChangeListener,EventListener,ILayer,ILayerListener,IUniqueIndexLayer,IPersistable
- Glazed list events -
ListEvent - Bean updates - PropertyChangeEvent(s)
ListEvent fired by the GlazedLists immediately.-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
underlyingLayerFields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
commandHandlers, eventHandlers, eventHelperLock, layerPainterFields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionDetailGlazedListsEventLayer(IUniqueIndexLayer underlyingLayer, ca.odell.glazedlists.EventList<T> eventList) Create a newDetailGlazedListsEventLayerwhich is in fact aListEventListenerthat listens to GlazedLists events and translate them into events that are understandable by the NatTable. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates the handling of GlazedLists events.voidDeactivates the handling of GlazedLists events.intgetColumnPositionByIndex(int columnIndex) intgetRowPositionByIndex(int rowIndex) booleanisActive()voidlistChanged(ca.odell.glazedlists.event.ListEvent<T> event) GlazedLists event handling.voidvoidsetEventList(ca.odell.glazedlists.EventList<T> newEventList) Change the underlyingEventListthis layer is listening to.Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
configure, dispose, doCommand, getCellByPosition, getCellPainter, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartXOfColumnPosition, getStartYOfRowPosition, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, isColumnPositionResizable, isDynamicSizeLayer, isRowPositionResizable, loadState, localToUnderlyingColumnPosition, localToUnderlyingRowPosition, saveState, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, underlyingToLocalRowPosition, underlyingToLocalRowPositionsMethods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getProvidedLabels, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerCommandHandlers, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayer
addLayerListener, configure, dispose, doCommand, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getProvidedLabels, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartXOfColumnPosition, getStartYOfRowPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, hasLayerListener, isColumnPositionResizable, isDynamicSizeLayer, isRowPositionResizable, localToUnderlyingColumnPosition, localToUnderlyingRowPosition, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, underlyingToLocalRowPosition, underlyingToLocalRowPositions, unregisterCommandHandler, unregisterPersistableMethods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener
handleLayerEventMethods inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
loadState, saveState
-
Constructor Details
-
DetailGlazedListsEventLayer
public DetailGlazedListsEventLayer(IUniqueIndexLayer underlyingLayer, ca.odell.glazedlists.EventList<T> eventList) Create a newDetailGlazedListsEventLayerwhich is in fact aListEventListenerthat listens to GlazedLists events and translate them into events that are understandable by the NatTable.- Parameters:
underlyingLayer- The underlying layer of typeIUniqueIndexLayereventList- TheEventListthis layer should be added as listener.
-
-
Method Details
-
listChanged
GlazedLists event handling. Will transform received GlazedLists ListEvents into corresponding NatTable RowStructuralChangeEvents. Ensures that no other changes can be made to the GlazedLists instance until the events are processed in NatTable itself. This is necessary to avoid concurrent modifications which will lead to asynchronous states of NatTable and GlazedLists.- Specified by:
listChangedin interfaceca.odell.glazedlists.event.ListEventListener<T>
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
activate
public void activate()Activates the handling of GlazedLists events. By activating on receiving GlazedLists change events, there will be NatTable events fired to indicate that re-rendering is necessary.This is usually necessary to perform huge updates of the data model to avoid concurrency issues. By default the
DetailGlazedListsEventLayeris activated. You can deactivate it prior performing bulk updates and activate it again after the update is finished for a better event handling.Note: When activating the list change handling again, there will be no event fired in NatTable automatically. For bulk updates with deactivated internal handling it is therefore necessary to fire a custom event to trigger the NatTable refresh operation.
- Since:
- 1.6
-
deactivate
public void deactivate()Deactivates the handling of GlazedLists events. By deactivating there will be no NatTable events fired on GlazedLists change events.This is usually necessary to perform huge updates of the data model to avoid concurrency issues. By default the
DetailGlazedListsEventLayeris activated. You can deactivate it prior performing bulk updates and activate it again after the update is finished for a better event handling.Note: When activating the list change handling again, there will be no event fired in NatTable automatically. For bulk updates with deactivated internal handling it is therefore necessary to fire a custom event to trigger the NatTable refresh operation.
- Since:
- 1.6
-
isActive
public boolean isActive()- Returns:
- Whether this
DetailGlazedListsEventLayerwill propagateListEvents into NatTable or not. - Since:
- 1.6
-
setEventList
Change the underlyingEventListthis layer is listening to.- Parameters:
newEventList- theEventListto listen on.
-
getColumnPositionByIndex
public int getColumnPositionByIndex(int columnIndex) - Specified by:
getColumnPositionByIndexin interfaceIUniqueIndexLayer
-
getRowPositionByIndex
public int getRowPositionByIndex(int rowIndex) - Specified by:
getRowPositionByIndexin interfaceIUniqueIndexLayer
-