use of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer in project nebula.widgets.nattable by eclipse.
the class FreezeLayer method getStartXOfColumnPosition.
@Override
public int getStartXOfColumnPosition(int columnPosition) {
if (columnPosition < 0 || columnPosition >= getColumnCount()) {
return -1;
}
IUniqueIndexLayer underlyingLayer = getUnderlyingLayer();
final int underlyingColumnPosition = LayerUtil.convertColumnPosition(this, columnPosition, underlyingLayer);
if (underlyingColumnPosition < 0) {
return -1;
}
return underlyingLayer.getStartXOfColumnPosition(underlyingColumnPosition) - underlyingLayer.getStartXOfColumnPosition(this.topLeftPosition.columnPosition);
}
use of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer in project nebula.widgets.nattable by eclipse.
the class FreezeLayer method getRowPositionByY.
@Override
public int getRowPositionByY(int y) {
IUniqueIndexLayer underlyingLayer = getUnderlyingLayer();
int yOffset = underlyingLayer.getStartYOfRowPosition(this.topLeftPosition.rowPosition);
return underlyingToLocalRowPosition(underlyingLayer, underlyingLayer.getRowPositionByY(yOffset + y));
}
use of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer in project nebula.widgets.nattable by eclipse.
the class FreezeLayer method getColumnPositionByX.
@Override
public int getColumnPositionByX(int x) {
IUniqueIndexLayer underlyingLayer = getUnderlyingLayer();
int xOffset = underlyingLayer.getStartXOfColumnPosition(this.topLeftPosition.columnPosition);
return underlyingToLocalColumnPosition(underlyingLayer, underlyingLayer.getColumnPositionByX(xOffset + x));
}
use of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer in project nebula.widgets.nattable by eclipse.
the class FreezeLayer method getStartYOfRowPosition.
@Override
public int getStartYOfRowPosition(int rowPosition) {
if (rowPosition < 0 || rowPosition >= getRowCount()) {
return -1;
}
IUniqueIndexLayer underlyingLayer = getUnderlyingLayer();
final int underlyingRowPosition = LayerUtil.convertRowPosition(this, rowPosition, underlyingLayer);
if (underlyingRowPosition < 0) {
return -1;
}
return underlyingLayer.getStartYOfRowPosition(underlyingRowPosition) - underlyingLayer.getStartYOfRowPosition(this.topLeftPosition.rowPosition);
}
use of org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer in project nebula.widgets.nattable by eclipse.
the class RowGroupExpandCollapseLayer method isRowIndexHidden.
// Expand/collapse
@Override
public boolean isRowIndexHidden(int rowIndex) {
// This can happen if a row has just been removed.
if (rowIndex >= this.model.getDataProvider().getRowCount()) {
return true;
}
IUniqueIndexLayer underlyingLayer = (IUniqueIndexLayer) getUnderlyingLayer();
boolean isHiddeninUnderlyingLayer = RowGroupUtils.isRowIndexHiddenInUnderLyingLayer(rowIndex, this, underlyingLayer);
// Get the row and the group from our cache and model.
final T row = this.model.getRowFromIndexCache(rowIndex);
IRowGroup<T> rowGroup = this.model.getRowGroupForRow(row);
if (rowGroup == null) {
return false;
}
boolean isCollapsedAndNotStaticRow = RowGroupUtils.isCollapsed(this.model, rowGroup) && !rowGroup.getOwnStaticMemberRows().contains(row);
return isHiddeninUnderlyingLayer || isCollapsedAndNotStaticRow;
}
Aggregations