- for(Map.Entry<Column, Object> entry : objects.entrySet()) {
- Column column = entry.getKey();
- TreeColumn treeColumn = (TreeColumn)entry.getValue();
-
- if (column.getWidth() < 0) {
- throw new IllegalArgumentException("Column minimum width cannot be < 0, got " + column.getWidth());
- }
-
- int width = getColumnWidth(column, state);
- if(column.hasGrab()) {
-
- ad.setColumnData(treeColumn, new ColumnWeightData(column.getWeight(), width));
-
- } else {
-
- ad.setColumnData(treeColumn, new ColumnWeightData(0, width));
-
- }
-
- }
- }
+ protected void restoreColumnSizes(Map<Column, Object> columns) {
+ if (persistor != null) {
+ setColumnData(columns, null);
+ ExplorerStates.scheduleRead(explorer.getRoot(), persistor).thenAccept(state -> {
+ SWTUtils.asyncExec(GraphExplorerComposite.this, () -> {
+ if (explorerComposite.isDisposed())
+ setColumnData(columns, state);
+ });
+ });
+ } else {
+ setColumnData(columns, null);
+ }
+ }