All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.utils.DockUtils Maven / Gradle / Ivy

There is a newer version: 2.0.0-M1
Show newest version
package org.bidib.wizard.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.vlsolutions.swing.docking.Dockable;
import com.vlsolutions.swing.docking.DockingUtilities;
import com.vlsolutions.swing.docking.TabbedDockableContainer;

public class DockUtils {
    private static final Logger LOGGER = LoggerFactory.getLogger(DockUtils.class);

    public static void selectWindow(Dockable dockable) {

        if (dockable == null) {
            LOGGER.warn("Select window is skipped because no dockable provided.");
            return;
        }

        // TODO this should also work with non-tabbed windows
        TabbedDockableContainer container = DockingUtilities.findTabbedDockableContainer(dockable);
        if (container != null) {
            container.setSelectedDockable(dockable);
        }
        else {
            LOGGER.warn("Container not available, select component directly.");
            dockable.getComponent().requestFocusInWindow();
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy