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
underlyingLayer
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
commandHandlers, eventHandlers, eventHelperLock, layerPainter
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
Constructor Summary
ConstructorDescriptionDetailGlazedListsEventLayer
(IUniqueIndexLayer underlyingLayer, ca.odell.glazedlists.EventList<T> eventList) Create a newDetailGlazedListsEventLayer
which is in fact aListEventListener
that listens to GlazedLists events and translate them into events that are understandable by the NatTable. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activates the handling of GlazedLists events.void
Deactivates the handling of GlazedLists events.int
getColumnPositionByIndex
(int columnIndex) int
getRowPositionByIndex
(int rowIndex) boolean
isActive()
void
listChanged
(ca.odell.glazedlists.event.ListEvent<T> event) GlazedLists event handling.void
void
setEventList
(ca.odell.glazedlists.EventList<T> newEventList) Change the underlyingEventList
this 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, underlyingToLocalRowPositions
Methods 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, unregisterPersistable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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, unregisterPersistable
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener
handleLayerEvent
Methods 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 newDetailGlazedListsEventLayer
which is in fact aListEventListener
that listens to GlazedLists events and translate them into events that are understandable by the NatTable.- Parameters:
underlyingLayer
- The underlying layer of typeIUniqueIndexLayer
eventList
- TheEventList
this 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:
listChanged
in interfaceca.odell.glazedlists.event.ListEventListener<T>
-
propertyChange
- Specified by:
propertyChange
in 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
DetailGlazedListsEventLayer
is 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
DetailGlazedListsEventLayer
is 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
DetailGlazedListsEventLayer
will propagateListEvent
s into NatTable or not. - Since:
- 1.6
-
setEventList
Change the underlyingEventList
this layer is listening to.- Parameters:
newEventList
- theEventList
to listen on.
-
getColumnPositionByIndex
public int getColumnPositionByIndex(int columnIndex) - Specified by:
getColumnPositionByIndex
in interfaceIUniqueIndexLayer
-
getRowPositionByIndex
public int getRowPositionByIndex(int rowIndex) - Specified by:
getRowPositionByIndex
in interfaceIUniqueIndexLayer
-