/** * Tells whether there is a factory with the importance <code>priority</code>, * or not. * @param priority the searched priority * @return <code>true</code> if there is a factory */ public boolean isSet( Priority priority ){ return factories[ map( priority ) ] != null; }
/** * Gets the factory with the given priority. * @param priority the priority * @return the factory or <code>null</code> */ public DockTitleFactory getFactory( Priority priority ){ return factories[ map( priority ) ]; }
/** * Stores <code>factory</code> at the slot <code>priority</code>. * @param factory the factory * @param priority the importance of the factory */ public void setFactory( DockTitleFactory factory, Priority priority ){ DockTitleFactory oldFactory = getFactory(); factories[ map( priority ) ] = factory; DockTitleFactory newFactory = getFactory(); if( oldFactory != newFactory ){ if( oldFactory != null ){ for( DockTitleRequest request : requests ){ oldFactory.uninstall( request ); } } if( newFactory != null ){ for( DockTitleRequest request : requests ){ newFactory.install( request ); if( !onThemeChange ){ request.request(); } } } } }