use of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer in project nebula.widgets.nattable by eclipse.
the class RowGroupExpandCollapseLayer method getHiddenRowIndexes.
@Override
public Collection<Integer> getHiddenRowIndexes() {
Collection<Integer> hiddenRowIndexes = new HashSet<Integer>();
IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();
int underlyingColumnCount = underlyingLayer.getRowCount();
for (int i = 0; i < underlyingColumnCount; i++) {
int rowIndex = underlyingLayer.getRowIndexByPosition(i);
if (isRowIndexHidden(rowIndex)) {
hiddenRowIndexes.add(Integer.valueOf(rowIndex));
}
}
return hiddenRowIndexes;
}
use of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer in project nebula.widgets.nattable by eclipse.
the class AbstractRowHideShowLayer method getStartYOfRowPosition.
@Override
public int getStartYOfRowPosition(int localRowPosition) {
Integer cachedStartY = this.startYCache.get(localRowPosition);
if (cachedStartY != null) {
return cachedStartY;
}
IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();
int underlyingPosition = localToUnderlyingRowPosition(localRowPosition);
if (underlyingPosition < 0) {
return -1;
}
int underlyingStartY = underlyingLayer.getStartYOfRowPosition(underlyingPosition);
if (underlyingStartY < 0) {
return -1;
}
for (Integer hiddenIndex : getHiddenRowIndexes()) {
int hiddenPosition = underlyingLayer.getRowPositionByIndex(hiddenIndex);
// layertherefore the underlying layer should handle the positioning
if (hiddenPosition >= 0 && hiddenPosition <= underlyingPosition) {
underlyingStartY -= underlyingLayer.getRowHeightByPosition(hiddenPosition);
}
}
this.startYCache.put(localRowPosition, underlyingStartY);
return underlyingStartY;
}
Aggregations