/** * Adds a separator at the end of the current list of actions */ public void addSeparator(){ add( SeparatorAction.SEPARATOR ); }
/** * Adds several actions to this source. * @param actions the new actions */ public void add( DockAction... actions ){ add( new DefaultDockActionSource( actions )); }
multiSource.add( action );
private void updateActionSource( boolean force ){ boolean showChildren = behavior.isShowChildren(); boolean showActions = behavior.isShowActions(); boolean filterActions = behavior.isFilterActions(); if( force || this.showChildren != showChildren || this.showActions != showActions || this.filterActions != filterActions ){ allActionsSource.removeAll(); if( showChildren ){ allActionsSource.add( getChildrenActionSourceFor( getDockable() ) ); } if( showActions ){ if( filterActions ){ allActionsSource.add( createFilter( getDefaultActionSourceFor( getDockable() ) ) ); } else{ allActionsSource.add( getDefaultActionSourceFor( getDockable() ) ); } } this.showChildren = showChildren; this.showActions = showActions; } }
private void updateActionSource( boolean force ){ boolean showChildren = behavior.isShowChildren(); boolean showActions = behavior.isShowActions(); boolean filterActions = behavior.isFilterActions(); if( force || this.showChildren != showChildren || this.showActions != showActions || this.filterActions != filterActions ){ allActionsSource.removeAll(); if( showChildren ){ allActionsSource.add( getChildrenActionSourceFor( getDockable() ) ); } if( showActions ){ if( filterActions ){ allActionsSource.add( createFilter( getDefaultActionSourceFor( getDockable() ) ) ); } else{ allActionsSource.add( getDefaultActionSourceFor( getDockable() ) ); } } this.showChildren = showChildren; this.showActions = showActions; } }
private void updateActionSource( boolean force ){ boolean showChildren = behavior.isShowChildren(); boolean showActions = behavior.isShowActions(); boolean filterActions = behavior.isFilterActions(); if( force || this.showChildren != showChildren || this.showActions != showActions || this.filterActions != filterActions ){ allActionsSource.removeAll(); if( showChildren ){ allActionsSource.add( getChildrenActionSourceFor( getDockable() ) ); } if( showActions ){ if( filterActions ){ allActionsSource.add( createFilter( getDefaultActionSourceFor( getDockable() ) ) ); } else{ allActionsSource.add( getDefaultActionSourceFor( getDockable() ) ); } } this.showChildren = showChildren; this.showActions = showActions; } }
@Override public DockActionSource getSharedActions( DockStation station ){ Dockable selected = station.getFrontDockable(); if( selected == null ){ return null; } LocationMode mode = getCurrentMode( selected ); if( mode == null ){ return null; } MultiDockActionSource result = new MultiDockActionSource(); for( LocationMode other : modes() ){ if( behavior.shouldForwardActions( this, station, selected, other.getExtendedMode() ) ){ DockActionSource source = other.getActionsFor( selected, mode ); if( source != null ){ result.add( source ); } } } return result; }
@Override public DockActionSource getSharedActions( DockStation station ){ Dockable selected = station.getFrontDockable(); if( selected == null ){ return null; } LocationMode mode = getCurrentMode( selected ); if( mode == null ){ return null; } MultiDockActionSource result = new MultiDockActionSource(); for( LocationMode other : modes() ){ if( behavior.shouldForwardActions( this, station, selected, other.getExtendedMode() ) ){ DockActionSource source = other.getActionsFor( selected, mode ); if( source != null ){ result.add( source ); } } } return result; }