/** * Removes all actions between <code>index</code> (incl.) * and <code>index+length</code> (excl.). * @param index The index of the first action to remove * @param length The number of actions to remove * @throws IllegalArgumentException If some actions should be removed that * do not exist */ public void remove( int index, int length ){ if( index < 0 ) throw new IllegalArgumentException( "Index must not be negative" ); if( length < 0 ) throw new IllegalArgumentException( "Length must not be negative" ); if( index + length > getDockActionCount() ) throw new IllegalArgumentException( "index + length too great" ); if( length > 0 ){ for( int i = length-1; i>=0; i-- ) actions.remove( index + i ); fireRemoved( index, index+length-1 ); } } }