use of net.sourceforge.nattable.hideshow.event.HideColumnPositionsEvent in project translationstudio8 by heartsome.
the class ColumnGroupExpandCollapseCommandHandler method doCommand.
@Override
protected boolean doCommand(ColumnGroupExpandCollapseCommand command) {
int columnIndex = columnGroupExpandCollapseLayer.getColumnIndexByPosition(command.getColumnPosition());
ColumnGroupModel model = columnGroupExpandCollapseLayer.getModel();
boolean wasCollapsed = model.isCollapsed(columnIndex);
ColumnGroup columnGroup = model.toggleColumnGroupExpandCollapse(columnIndex);
List<Integer> columnPositions = new ArrayList<Integer>(columnGroup.getMembers());
columnPositions.remove(0);
ILayerEvent event;
if (wasCollapsed) {
event = new ShowColumnPositionsEvent(columnGroupExpandCollapseLayer, columnPositions);
} else {
event = new HideColumnPositionsEvent(columnGroupExpandCollapseLayer, columnPositions);
}
columnGroupExpandCollapseLayer.fireLayerEvent(event);
return true;
}
use of net.sourceforge.nattable.hideshow.event.HideColumnPositionsEvent in project translationstudio8 by heartsome.
the class ColumnHideShowLayer method hideColumnPositions.
public void hideColumnPositions(Collection<Integer> columnPositions) {
Set<Integer> columnIndexes = new HashSet<Integer>();
for (Integer columnPosition : columnPositions) {
columnIndexes.add(Integer.valueOf(getColumnIndexByPosition(columnPosition.intValue())));
}
hiddenColumnIndexes.addAll(columnIndexes);
invalidateCache();
fireLayerEvent(new HideColumnPositionsEvent(this, columnPositions));
}
Aggregations