/** * Informs this model about the {@link DockController} in whose realm it is used. * @param controller the realm in which this model works */ public void setController( DockController controller ){ if( this.controller != null ){ DockController old = this.controller; this.controller = null; for( BasicButtonModelListener listener : listeners() ){ listener.unbound( this, old ); } } if( controller != null ){ this.controller = controller; for( BasicButtonModelListener listener : listeners() ){ listener.bound( this, this.controller ); } } }