summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java
index 2066791f..e8e04237 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java
@@ -78,15 +78,17 @@ public class TableColumnAdjuster implements PropertyChangeListener, TableModelLi
*/
public void adjustColumn(final int column) {
TableColumn tableColumn = table.getColumnModel().getColumn(column);
-
if (!tableColumn.getResizable())
return;
-
+
int columnHeaderWidth = getColumnHeaderWidth(column);
- int columnDataWidth = getColumnDataWidth(column);
- int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
-
- updateTableColumn(column, preferredWidth);
+ int columnDataWidth;
+ if (table.getColumnClass(column) == Boolean.class) {
+ columnDataWidth = 16;
+ } else {
+ columnDataWidth = getColumnDataWidth(column);
+ }
+ updateTableColumn(column, Math.max(columnHeaderWidth, columnDataWidth));
}
/*
@@ -115,7 +117,7 @@ public class TableColumnAdjuster implements PropertyChangeListener, TableModelLi
private int getColumnDataWidth(int column) {
if (!isColumnDataIncluded || table.getRowCount() == 0)
return 0;
-
+
int preferredWidth = 0;
int maxWidth = table.getColumnModel().getColumn(column).getMaxWidth();
int[] colWidth = new int[table.getRowCount()];
@@ -170,7 +172,7 @@ public class TableColumnAdjuster implements PropertyChangeListener, TableModelLi
// Don't shrink the column width
- if (isOnlyAdjustLarger) {
+ if (isOnlyAdjustLarger && table.getColumnClass(column) != Boolean.class) {
width = Math.max(width, tableColumn.getPreferredWidth());
}