/** * Adds a child to this station at the location <code>index</code>. * @param dockable the new child * @param index the preferred location of the new child */ public void add( Dockable dockable, int index ){ add( dockable, index, null ); }
public void drop(){ add( dropping, insert.tab + (insert.right ? 1 : 0), null ); }
public void merge( StationDropOperation operation, DockStation parent, DockStation child ){ DisplayerCombinerTarget target = operation.getDisplayerCombination(); if( target instanceof TabDisplayerCombinerTarget ){ TabDisplayerCombinerTarget tab = (TabDisplayerCombinerTarget)target; StackDockStation station = (StackDockStation)operation.getItem(); if( station.getDockParent() != null ){ station.getDockParent().drag( station ); } Dockable dockable = tab.getTarget(); parent.replace( dockable, station ); Dockable selected = station.getFrontDockable(); if( tab.getIndex() == 0 ){ station.add( dockable, station.getDockableCount() ); } else{ station.add( dockable, 0 ); } DockController controller = station.getController(); if( controller != null ){ controller.setFocusedDockable( selected, false ); } } } }
public void merge( StationDropOperation operation, DockStation parent, DockStation child ){ DisplayerCombinerTarget target = operation.getDisplayerCombination(); if( target instanceof TabDisplayerCombinerTarget ){ TabDisplayerCombinerTarget tab = (TabDisplayerCombinerTarget)target; StackDockStation station = (StackDockStation)operation.getItem(); if( station.getDockParent() != null ){ station.getDockParent().drag( station ); } Dockable dockable = tab.getTarget(); parent.replace( dockable, station ); Dockable selected = station.getFrontDockable(); if( tab.getIndex() == 0 ){ station.add( dockable, station.getDockableCount() ); } else{ station.add( dockable, 0 ); } DockController controller = station.getController(); if( controller != null ){ controller.setFocusedDockable( selected, false ); } } } }
private void merge( StackDockStation parent, StackDockStation child ){ StackDockStation.Insert insert = parent.getInsert(); int index = parent.getDockableCount(); if( insert != null ){ index = insert.getTab(); if( insert.isRight() ){ index++; } } for( int i = child.getDockableCount()-1; i >= 0; i-- ){ Dockable dockable = child.getDockable( i ); child.remove( i ); parent.add( dockable, index ); } } }
/** * Adds <code>dockable</code> to this station. * @param dockable the element to drop * @param autoPlaceholder whether the {@link PlaceholderStrategy} can be invoked to search for a matching placeholder */ public void drop( Dockable dockable, boolean autoPlaceholder ){ Path placeholder = null; if( autoPlaceholder ){ PlaceholderStrategy strategy = getPlaceholderStrategy(); placeholder = strategy == null ? null : strategy.getPlaceholderFor( dockable ); } boolean done = false; if( placeholder != null ){ done = drop( dockable, new StackDockProperty( dockables.dockables().size(), placeholder ) ); } if( !done ){ add( dockable, dockables.dockables().size(), null ); } }
public void replace( Dockable old, Dockable next, boolean station ) { DockUtilities.checkLayoutLocked(); DockController controller = getController(); try{ if( controller != null ) controller.freezeLayout(); int index = indexOf( old ); int listIndex = dockables.levelToBase( index, Level.DOCKABLE ); DockablePlaceholderList<StationChildHandle>.Item oldItem = dockables.list().get( listIndex ); remove( index ); add( next, index ); DockablePlaceholderList<StationChildHandle>.Item newItem = dockables.list().get( listIndex ); if( station ){ newItem.setPlaceholderMap( old.asDockStation().getPlaceholders() ); } else{ newItem.setPlaceholderMap( oldItem.getPlaceholderMap() ); } newItem.setPlaceholderSet( oldItem.getPlaceholderSet() ); } finally{ if( controller != null ) controller.meltLayout(); } }