/** * Checks whether the action should be shown or not, and fires * events if the value changed since the last update. */ public void update(){ boolean enabled = isFullscreenEnabled(); if( showing != enabled ){ showing = enabled; if( showing ){ fireAdded( 0, 0 ); } else{ fireRemoved( 0, 0 ); } } }
public DockAction next(){ return getDockAction( index++ ); }
public boolean hasNext(){ return index < getDockActionCount(); }
@Override public void addDockActionSourceListener( DockActionSourceListener listener ){ if( !hasListeners() ){ listen( true ); update(); } super.addDockActionSourceListener( listener ); }
@Override public void removeDockActionSourceListener( DockActionSourceListener listener ){ super.removeDockActionSourceListener( listener ); if( !hasListeners() ){ listen( false ); } }
public int getDockActionCount(){ if( hasListeners() ){ if( showing ){ return 1; } else{ return 0; } } else if( isFullscreenEnabled() ){ showing = true; return 1; } else{ showing = false; return 0; } }
private void filterChanged(){ for( FullscreenActionSource source : filterSources ){ source.update(); } }
@Override public void addDockActionSourceListener( DockActionSourceListener listener ){ if( !hasListeners() ){ listen( true ); update(); } super.addDockActionSourceListener( listener ); }
@Override public void removeDockActionSourceListener( DockActionSourceListener listener ){ super.removeDockActionSourceListener( listener ); if( !hasListeners() ){ listen( false ); } }
public int getDockActionCount(){ if( hasListeners() ){ if( showing ){ return 1; } else{ return 0; } } else if( isFullscreenEnabled() ){ showing = true; return 1; } else{ showing = false; return 0; } }
/** * Checks whether the action should be shown or not, and fires * events if the value changed since the last update. */ public void update(){ boolean enabled = isFullscreenEnabled(); if( showing != enabled ){ showing = enabled; if( showing ){ fireAdded( 0, 0 ); } else{ fireRemoved( 0, 0 ); } } }
public boolean hasNext(){ return index < getDockActionCount(); }
public DockAction next(){ return getDockAction( index++ ); }
public DockAction getDockAction( int index ){ if( index < 0 || index >= getDockActionCount() ){ throw new IllegalArgumentException( "index out of bounds" ); } return action; }
public DockAction getDockAction( int index ){ if( index < 0 || index >= getDockActionCount() ){ throw new IllegalArgumentException( "index out of bounds" ); } return action; }