use of org.eclipse.nebula.widgets.nattable.layer.event.ResizeStructuralRefreshEvent in project nebula.widgets.nattable by eclipse.
the class DataLayer method doCommand.
@Override
public boolean doCommand(ILayerCommand command) {
if (command instanceof ClientAreaResizeCommand && command.convertToTargetLayer(this)) {
ClientAreaResizeCommand clientAreaResizeCommand = (ClientAreaResizeCommand) command;
boolean refresh = false;
if (isColumnPercentageSizing()) {
this.columnWidthConfig.calculatePercentages(this.columnWidthConfig.downScale(clientAreaResizeCommand.getCalcArea().width), getColumnCount());
refresh = true;
}
if (isRowPercentageSizing()) {
this.rowHeightConfig.calculatePercentages(this.rowHeightConfig.downScale(clientAreaResizeCommand.getCalcArea().height), getRowCount());
refresh = true;
}
if (refresh) {
fireLayerEvent(new ResizeStructuralRefreshEvent(this));
}
return refresh;
} else if (command instanceof StructuralRefreshCommand) {
// that the percentage values are re-calculated
if (isColumnPercentageSizing()) {
this.columnWidthConfig.updatePercentageValues(getColumnCount());
}
if (isRowPercentageSizing()) {
this.rowHeightConfig.updatePercentageValues(getRowCount());
}
}
return super.doCommand(command);
}
Aggregations