/** * Gets the number of {@link DockAction}s that were added to this menu. * @return the number of actions */ public int getActionCount(){ return menu.getDockActionCount(); }
/** * Tells whether the action of this guard can be seen or not * @return <code>true</code> if the action can be seen */ public boolean isVisible(){ return source.getDockActionCount() > 0; }
/** * Gets the number of {@link DockAction}s that were added to this menu. * @return the number of actions */ public int getActionCount(){ return menu.getDockActionCount(); }
/** * Tells whether the action of this guard can be seen or not * @return <code>true</code> if the action can be seen */ public boolean isVisible(){ return source.getDockActionCount() > 0; }
public int size(){ return actions.getDockActionCount(); }
public int size(){ return actions.getDockActionCount(); }
/** * Removes all actions stored in this source. */ public void removeAll(){ remove( 0, getDockActionCount() ); }
/** * Adds all given actions to the end of this source. * @param action The actions to append */ public void add( DockAction...action ){ add( getDockActionCount(), action ); }
/** * 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 ); } } }
/** * Sets the visibility of the action. The visibility can be changed at any * time and has effect on all occurrences of the action. * @param visible the new state */ public void setVisible( boolean visible ){ if( visible != isVisible() ){ if( visible ) source.add( action ); else source.remove( 0, source.getDockActionCount() ); } }
/** * Sets the visibility of the action. The visibility can be changed at any * time and has effect on all occurrences of the action. * @param visible the new state */ public void setVisible( boolean visible ){ if( visible != isVisible() ){ if( visible ) source.add( action ); else source.remove( 0, source.getDockActionCount() ); } }