diff options
author | Simon Rettberg | 2018-11-26 15:51:31 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-11-26 15:51:31 +0100 |
commit | a06c4dcb0ae2d829350c035d67b603c831088940 (patch) | |
tree | a23d632a9aa0af9861a2e844d13b28bc91caa04a /dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper | |
parent | [client] Add edit support to ListTable (diff) | |
download | tutor-module-a06c4dcb0ae2d829350c035d67b603c831088940.tar.gz tutor-module-a06c4dcb0ae2d829350c035d67b603c831088940.tar.xz tutor-module-a06c4dcb0ae2d829350c035d67b603c831088940.zip |
[client] Support predefined filters in LDAP editor
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/TableColumnAdjuster.java | 18 |
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()); } |