ActionCallback () { final ActionCallback result = new ActionCallback(); restoreProportions(); final Content[] contents = getContents(); final List<Content> toMinimize = new SmartList<>(); int window = 0; for (final Content each : contents) { final View view = myContainer.getStateFor(each); if (view.isMinimizedInGrid()) { toMinimize.add(each); } window = view.getWindow(); } minimize(toMinimize.toArray(new Content[0])); final Tab tab = myContainer.getTab(); final boolean detached = (tab != null && tab.isDetached(myPlaceInGrid)) || window != myContext.getWindow(); if (detached && contents.length > 0) { if (tab != null) { tab.setDetached(myPlaceInGrid, false); } myContext.detachTo(window, this).notifyWhenDone(result); } else { result.setDone(); } return result; }