DockingPort oldPort = evt.getOldDockingPort();
// if we're already floating, and we're the only dockable
// in a floating dockingport, then we don't want to undock
// from the port and re-float (dispose and create a new DockingFrame).
if (oldPort instanceof FloatingDockingPort) {
FloatingDockingPort dockingPort = (FloatingDockingPort) oldPort;
if (dockingPort.getDockableCount() < 2) {
evt.consume();
return false;
}
}