Search in sources :

Example 26 with ColumnGroup

use of org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup in project nebula.widgets.nattable by eclipse.

the class ColumnGroupsCommandHandler method handleRemoveColumnGroupCommand.

private void handleRemoveColumnGroupCommand(int columnIndex) {
    ColumnGroup columnGroup = this.model.getColumnGroupByIndex(columnIndex);
    this.model.removeColumnGroup(columnGroup);
}
Also used : ColumnGroup(org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup)

Example 27 with ColumnGroup

use of org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup in project nebula.widgets.nattable by eclipse.

the class ColumnGroupsCommandHandler method displayColumnGroupRenameDialog.

private boolean displayColumnGroupRenameDialog(DisplayColumnGroupRenameDialogCommand command) {
    int columnPosition = command.getColumnPosition();
    ColumnRenameDialog dialog = new ColumnRenameDialog(Display.getDefault().getActiveShell(), null, null);
    Rectangle colHeaderBounds = this.contextLayer.getBoundsByPosition(columnPosition, 0);
    Point point = new Point(colHeaderBounds.x, colHeaderBounds.y + colHeaderBounds.height);
    dialog.setLocation(command.toDisplayCoordinates(point));
    dialog.open();
    if (!dialog.isCancelPressed()) {
        int columnIndex = this.contextLayer.getColumnIndexByPosition(columnPosition);
        ColumnGroup columnGroup = this.model.getColumnGroupByIndex(columnIndex);
        columnGroup.setName(dialog.getNewColumnLabel());
    }
    return true;
}
Also used : ColumnRenameDialog(org.eclipse.nebula.widgets.nattable.columnRename.ColumnRenameDialog) Rectangle(org.eclipse.swt.graphics.Rectangle) Point(org.eclipse.swt.graphics.Point) ColumnGroup(org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup) Point(org.eclipse.swt.graphics.Point)

Aggregations

ColumnGroup (org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup)27 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 ColumnEntry (org.eclipse.nebula.widgets.nattable.columnChooser.ColumnEntry)3 ColumnGroupEntry (org.eclipse.nebula.widgets.nattable.columnChooser.ColumnGroupEntry)3 List (java.util.List)2 IUniqueIndexLayer (org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer)2 LabelStack (org.eclipse.nebula.widgets.nattable.layer.LabelStack)2 Point (org.eclipse.swt.graphics.Point)2 HashSet (java.util.HashSet)1 ColumnRenameDialog (org.eclipse.nebula.widgets.nattable.columnRename.ColumnRenameDialog)1 ColumnGroupModel (org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel)1 HideColumnPositionsEvent (org.eclipse.nebula.widgets.nattable.hideshow.event.HideColumnPositionsEvent)1 ShowColumnPositionsEvent (org.eclipse.nebula.widgets.nattable.hideshow.event.ShowColumnPositionsEvent)1 ILayerEvent (org.eclipse.nebula.widgets.nattable.layer.event.ILayerEvent)1 ColumnReorderCommand (org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand)1 MultiColumnReorderCommand (org.eclipse.nebula.widgets.nattable.reorder.command.MultiColumnReorderCommand)1 MoveDirectionEnum (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.MoveDirectionEnum)1 Rectangle (org.eclipse.swt.graphics.Rectangle)1 TreeItem (org.eclipse.swt.widgets.TreeItem)1