Hi again, I’ve run into a little problem when generating externalised dockables.
I want to programatically combine dockables into an external frame by giving them the same CLocation.
This works fine for the 1st dockable (ie the second dockable get added to the 1st) but after this a new frame is created even though the CLocation is the same.
I’ve tracked this down to the MultiDockAcceptance of dockables into a StackDockStation. Where after the second dockable is added we are now trying to add dockables to s StackDockStation and the acceptance is denied.
I’ve created a work around in ScreenDockStation where I check to see if we are adding to a StackDockStation and then add it rather than trying to combine.
at line ~1247
if( bestRatio >= dropOverRatio ){
DockableProperty successor = property.getSuccessor();
Dockable dock = best.getDockable();
if( successor != null ){
DockStation station = dock.asDockStation();
if( station != null )
done = station.drop( dockable, successor );
}
if (!done) {
Dockable old = best.getDockable();
if (old instanceof StackDockStation) {
StackDockStation sds = ((StackDockStation) old);
sds.add(dockable, sds.getDockableCount());
done = true;
} else {
if( old.accept( this, dockable ) && dockable.accept( this, old ) && (acceptance == null || acceptance.accept( this, old, dockable ))){
combine( old, dockable, property.getSuccessor() );
done = true;
}
}
}
}
This works fine for me but I’m not sure if this is the best fix.
thanks
Chris