DockStation parent = dockable.getDockParent();
if( parent != null ){
if( station.getDockableCount() == 0 ){
if( parent.canDrag( station.asDockable() ))
parent.drag( station.asDockable());
}
else{
if( parent.canReplace( station.asDockable(), station.getDockable( 0 ) ) &&
parent.accept( station.getDockable( 0 )) &&
station.getDockable( 0 ).accept( parent ) &&