/** * Sets the element of this leaf. This method ensures that <code>dockable</code> * is registered in the {@link DockStation} * @param dockable the new element or <code>null</code> to remove the * old {@link Dockable} * @param token if <code>null</code>, then a token will be acquired by this method * and this method will fire events, otherwise this methods is executed silently. Clients should * use <code>null</code>. */ public void setDockable( Dockable dockable, DockHierarchyLock.Token token ){ setDockable( dockable, token, true, false ); }
@Override public boolean insert( SplitDockPathProperty property, int depth, Dockable dockable ) { if( child == null ){ long id = property.getLeafId(); Leaf leaf = create( dockable, id ); if( leaf == null ) return false; setChild( leaf ); leaf.setDockable( dockable, null ); return true; } else return child.insert( property, depth, dockable ); }
leaf.setDockable(next, null, true, station);
leaf.setDockable(next, null, true, station);
root().evolve(rootKey, checkValidity, linksToSet); for( Map.Entry<Leaf, Dockable> entry : linksToSet.entrySet() ) { entry.getKey().setDockable( entry.getValue(), null );
root().evolve(rootKey, checkValidity, linksToSet); for( Map.Entry<Leaf, Dockable> entry : linksToSet.entrySet() ) { entry.getKey().setDockable( entry.getValue(), null );
@Override public boolean insert( SplitDockPathProperty property, int depth, Dockable dockable ){ if( property.getLeafId() == getId() ){ return replace( null, dockable ); } else if( depth < property.size() ){ Leaf leaf = create( dockable, property.getLeafId() ); if( leaf == null ){ return false; } split( property, depth, leaf ); leaf.setDockable( dockable, null ); return true; } else{ return false; } }
/** * Removes <code>dockable</code> from this station. If * <code>dockable</code> is not a child of this station, nothing happens.<br> * Note: clients may need to invoke {@link DockController#freezeLayout()} * and {@link DockController#meltLayout()} to ensure noone else adds or * removes <code>Dockable</code>s. * @param dockable the child to remove */ public void removeDockable( Dockable dockable ){ try{ access.arm(); DockUtilities.checkLayoutLocked(); Leaf leaf = root().getLeaf(dockable); if( leaf != null ) { leaf.setDockable(null, null, true, dockable.asDockStation() != null); leaf.placehold(true); } } finally{ access.fire(); } }
/** * Removes <code>dockable</code> from this station. If * <code>dockable</code> is not a child of this station, nothing happens.<br> * Note: clients may need to invoke {@link DockController#freezeLayout()} * and {@link DockController#meltLayout()} to ensure no-one else adds or * removes <code>Dockable</code>s. * @param dockable the child to remove */ public void removeDockable( Dockable dockable ){ try{ access.arm(); DockUtilities.checkLayoutLocked(); Leaf leaf = root().getLeaf(dockable); if( leaf != null ) { leaf.setDockable(null, null, true, dockable.asDockStation() != null); leaf.placehold(true); } } finally{ access.fire(); } }
private boolean replace( Path placeholder, Dockable dockable ){ // replace this placeholder with a leaf Leaf leaf = create( dockable, getId() ); if( leaf == null ) return false; ensureOnlyOnThisNode( placeholder ); ensureOnlyOnThisNode( getAccess().getOwner().getPlaceholderStrategy().getPlaceholderFor( dockable ) ); leaf.setPlaceholders( getPlaceholders() ); replace( leaf ); leaf.setPlaceholderMap( getPlaceholderMap() ); leaf.setDockable( dockable, null ); return true; }
leaf.setDockable( dockable, token );
leaf.setDockable( dockable, token );
try{ dockStationListeners.fireDockableRemoving( oldDockable ); leaf.setDockable( null, token ); dockStationListeners.fireDockableRemoved( oldDockable ); try{ dockStationListeners.fireDockableAdding(combination); leaf.setDockable( combination, token );
leaf.setDockable( dockable, null ); return true;
try{ dockStationListeners.fireDockableRemoving( oldDockable ); leaf.setDockable( null, token ); dockStationListeners.fireDockableRemoved( oldDockable ); try{ dockStationListeners.fireDockableAdding(combination); leaf.setDockable( combination, token );
leaf.setDockable( dockable, null ); return true;
leaf.setDockable( dockable, null ); return true;
leaf.setDockable( dockable, token );
leaf.setDockable( dockable, token );
putInfo.getLeaf().setDockable( null, token ); putInfo.setLeaf(null);