mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed handling of default columns width.
This commit is contained in:
parent
6faae6066e
commit
efb02f633c
1 changed files with 8 additions and 11 deletions
|
@ -1199,18 +1199,15 @@ class TableTableModel extends AbstractTableModel {
|
||||||
|
|
||||||
// set the column width from saved value or defaults
|
// set the column width from saved value or defaults
|
||||||
int[] widths = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH, null));
|
int[] widths = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH, null));
|
||||||
if (widths != null) {
|
|
||||||
int lengthW = widths.length;
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (int width : defaultColumnsWidth) {
|
for (int width : defaultColumnsWidth) {
|
||||||
if (lengthW > i) {
|
if (widths != null && widths.length > i) {
|
||||||
width = widths[i];
|
width = widths[i];
|
||||||
}
|
}
|
||||||
TableColumn column = table.getColumnModel().getColumn(i++);
|
TableColumn column = table.getColumnModel().getColumn(i++);
|
||||||
column.setWidth(width);
|
column.setWidth(width);
|
||||||
column.setPreferredWidth(width);
|
column.setPreferredWidth(width);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// set the column order
|
// set the column order
|
||||||
int[] order = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_ORDER, null));
|
int[] order = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_ORDER, null));
|
||||||
|
|
Loading…
Reference in a new issue