private void reAddDockingAreas(List<DockingAreaPane> removedDockingAreas) throws IllegalStateException { for (DockingAreaPane removedDockingArea : removedDockingAreas) { List<DockingAreaPane> areas = new ArrayList<>(); addDockingArea(removedDockingArea.getShortPath(), removedDockingArea, areas); if (!areas.isEmpty()) { // TODO: should not happen (?) -> log? throw new IllegalStateException(); } } removeEmptySplitPanes(); // TODO needed? }
private void logShortPaths() { dockingSplitPaneChildren.stream(). forEach((child) -> { if (child instanceof DockingAreaPane) { DockingAreaPane dockingArea = (DockingAreaPane) child; LOG.debug("{} short path: {}", dockingArea, dockingArea.getShortPath()); } else { if (child instanceof DockingSplitPane) { DockingSplitPane dockingSplitPane = (DockingSplitPane) child; // recursion dockingSplitPane.logShortPaths(); } else { LOG.debug("Unsupported child type '{}'", child.getClass()); } } }); }
public void addDockingArea(DockingAreaPane dockingArea) { // System.out.println(DockingSplitPane.class.getName() + ": adding docking area: " + dockingArea.getAreaId()); List<DockingAreaPane> removedDockingAreas = new ArrayList<>(); addDockingArea(dockingArea.getShortPath(), dockingArea, removedDockingAreas); reAddDockingAreas(removedDockingAreas); updateSplitPaneChildren(); }