use of net.sourceforge.nattable.hideshow.event.ShowColumnPositionsEvent 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.ShowColumnPositionsEvent in project translationstudio8 by heartsome.
the class ColumnHideShowLayer method showColumnIndexes.
protected void showColumnIndexes(Collection<Integer> columnIndexes) {
for (int columnIndex : columnIndexes) {
hiddenColumnIndexes.remove(Integer.valueOf(columnIndex));
}
invalidateCache();
// Since we are exposing this method for showing individual columns, a structure event must be fired here.
fireLayerEvent(new ShowColumnPositionsEvent(this, columnIndexes));
}
use of net.sourceforge.nattable.hideshow.event.ShowColumnPositionsEvent in project translationstudio8 by heartsome.
the class ColumnHideShowLayer method showColumnIndexes.
public void showColumnIndexes(int[] columnIndexes) {
Set<Integer> columnIndexesSet = new HashSet<Integer>();
for (int i = 0; i < columnIndexes.length; i++) {
columnIndexesSet.add(Integer.valueOf(columnIndexes[i]));
}
hiddenColumnIndexes.removeAll(columnIndexesSet);
invalidateCache();
fireLayerEvent(new ShowColumnPositionsEvent(this, getColumnPositionsByIndexes(columnIndexes)));
}
use of net.sourceforge.nattable.hideshow.event.ShowColumnPositionsEvent in project translationstudio8 by heartsome.
the class ColumnHideShowLayer method showAllColumns.
public void showAllColumns() {
Collection<Integer> hiddenColumns = new ArrayList<Integer>(hiddenColumnIndexes);
hiddenColumnIndexes.clear();
invalidateCache();
fireLayerEvent(new ShowColumnPositionsEvent(this, hiddenColumns));
}
Aggregations