private void ensureOnlyOnThisNode( Path placeholder ){ if( placeholder != null ){ getAccess().getPlaceholderSet().set( this, placeholder, this ); } }
/** * Ensures that <code>node</code> is associated with the placeholder for <code>dockable</code>. * @param node the owner of <code>dockable</code>, can be <code>null</code> to indicate * that noone must use the placeholder of <code>dockable</code> * @param dockable the item whose placeholder is updated * @param protectedNodes nodes that will not be removed even if they are no longer {@link SplitNode#isOfUse() useful} */ public void set( SplitNode node, Dockable dockable, SplitNode... protectedNodes ){ PlaceholderStrategy strategy = access.getOwner().getPlaceholderStrategy(); if( strategy != null ){ Path placeholder = strategy.getPlaceholderFor( dockable ); if( placeholder != null ){ set( node, placeholder, protectedNodes ); } } }
/** * Ensures that <code>node</code> is associated with the placeholder for <code>dockable</code>. * @param node the owner of <code>dockable</code>, can be <code>null</code> to indicate * that no-one must use the placeholder of <code>dockable</code> * @param dockable the item whose placeholder is updated * @param protectedNodes nodes that will not be removed even if they are no longer {@link SplitNode#isOfUse() useful} */ public void set( SplitNode node, Dockable dockable, SplitNode... protectedNodes ){ PlaceholderStrategy strategy = access.getOwner().getPlaceholderStrategy(); if( strategy != null ){ Path placeholder = strategy.getPlaceholderFor( dockable ); if( placeholder != null ){ set( node, placeholder, protectedNodes ); } } }
/** * Creates a {@link SplitDockPlaceholderProperty} for <code>dockable</code>, may * insert an additional placeholder in the tree. * @param dockable the element whose location is searched * @param target hint required to find the placeholder * @return the placeholder or <code>null</code> if the {@link #getPlaceholderStrategy() strategy} * did not assign a placeholder to <code>dockable</code> */ public SplitDockPlaceholderProperty getDockablePlaceholderProperty( Dockable dockable, Dockable target ){ Leaf leaf = getRoot().getLeaf(dockable); if( leaf == null ) { throw new IllegalArgumentException("dockable not known to this station"); } Path placeholder = getPlaceholderStrategy().getPlaceholderFor(target == null ? dockable : target); if( placeholder == null ) { return null; } placeholderSet.set(leaf, placeholder); return new SplitDockPlaceholderProperty(placeholder, getDockablePathProperty(dockable)); }
private void updatePlaceholders( Dockable dockable, boolean keep, PlaceholderStrategy strategy ){ Path placeholder = strategy.getPlaceholderFor( dockable ); if( placeholder != null ){ if( !keep ){ getAccess().getPlaceholderSet().set( null, placeholder ); } else { getAccess().getPlaceholderSet().set( this, placeholder ); } } DockStation station = dockable.asDockStation(); if( station != null ){ for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ updatePlaceholders( station.getDockable( i ), keep, strategy ); } } }
/** * Creates a {@link SplitDockPlaceholderProperty} for <code>dockable</code>, may * insert an additional placeholder in the tree. * @param dockable the element whose location is searched * @param target hint required to find the placeholder * @return the placeholder or <code>null</code> if the {@link #getPlaceholderStrategy() strategy} * did not assign a placeholder to <code>dockable</code> */ public SplitDockPlaceholderProperty getDockablePlaceholderProperty( Dockable dockable, Dockable target ){ Leaf leaf = getRoot().getLeaf(dockable); if( leaf == null ) { throw new IllegalArgumentException("dockable not known to this station"); } Path placeholder = getPlaceholderStrategy().getPlaceholderFor(target == null ? dockable : target); if( placeholder == null ) { return null; } placeholderSet.set(leaf, placeholder); return new SplitDockPlaceholderProperty(placeholder, getDockablePathProperty(dockable)); }
return false; getAccess().getPlaceholderSet().set( null, placeholder, this ); leaf.setPlaceholders( getPlaceholders() ); Node node = createNode( -1 );
boolean done = station.drop( dockable, stationLocation ); if( done ){ getAccess().getPlaceholderSet().set( null, placeholder, this ); return true;