Search in sources :

Example 1 with TabWindow

use of net.infonode.docking.TabWindow in project freeplane by freeplane.

the class MapViewDockingWindows method addDockedView.

private void addDockedView(View oldSelected, View newView) {
    DockingWindow lastFocusedChildWindow = oldSelected != null ? oldSelected : getLastFocusedChildWindow(rootWindow);
    if (lastFocusedChildWindow == null) {
        DockingUtil.addWindow(newView, rootWindow);
    } else {
        Container parent = SwingUtilities.getAncestorOfClass(DockingWindow.class, lastFocusedChildWindow);
        if (parent instanceof TabWindow) {
            final TabWindow tabWindow = (TabWindow) parent;
            tabWindow.addTab(newView, tabWindow.getChildWindowIndex(lastFocusedChildWindow) + 1);
        } else
            DockingUtil.addWindow(newView, lastFocusedChildWindow.getRootWindow());
    }
}
Also used : DockingWindow(net.infonode.docking.DockingWindow) Container(java.awt.Container) TabWindow(net.infonode.docking.TabWindow) AbstractTabWindow(net.infonode.docking.AbstractTabWindow)

Aggregations

Container (java.awt.Container)1 AbstractTabWindow (net.infonode.docking.AbstractTabWindow)1 DockingWindow (net.infonode.docking.DockingWindow)1 TabWindow (net.infonode.docking.TabWindow)1