Search in sources :

Example 1 with RowStructuralRefreshEvent

use of net.sourceforge.nattable.layer.event.RowStructuralRefreshEvent in project translationstudio8 by heartsome.

the class RowSelectionPreserver method handleLayerEvent.

/**
	 * On a change in the underlying data:
	 * <ol>
	 * <li>Clears the selection
	 * <li>Re-select the row objects selected earlier.
	 * </ol>
	 */
public void handleLayerEvent(IVisualChangeEvent event) {
    if (ObjectUtils.isEmpty(selectedRowObjects)) {
        return;
    }
    if (event instanceof RowStructuralRefreshEvent || event instanceof RowStructuralChangeEvent || event instanceof SortColumnEvent) {
        selectionLayer.clear();
        selectionProvider.setSelection(new StructuredSelection(getValidSelections()));
    }
}
Also used : SortColumnEvent(net.sourceforge.nattable.sort.event.SortColumnEvent) RowStructuralRefreshEvent(net.sourceforge.nattable.layer.event.RowStructuralRefreshEvent) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) RowStructuralChangeEvent(net.sourceforge.nattable.layer.event.RowStructuralChangeEvent)

Example 2 with RowStructuralRefreshEvent

use of net.sourceforge.nattable.layer.event.RowStructuralRefreshEvent in project translationstudio8 by heartsome.

the class AbstractColumnHideShowLayer method loadState.

@Override
public void loadState(String prefix, Properties properties) {
    super.loadState(prefix, properties);
    fireLayerEvent(new RowStructuralRefreshEvent(this));
}
Also used : RowStructuralRefreshEvent(net.sourceforge.nattable.layer.event.RowStructuralRefreshEvent)

Aggregations

RowStructuralRefreshEvent (net.sourceforge.nattable.layer.event.RowStructuralRefreshEvent)2 RowStructuralChangeEvent (net.sourceforge.nattable.layer.event.RowStructuralChangeEvent)1 SortColumnEvent (net.sourceforge.nattable.sort.event.SortColumnEvent)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1