예제 #1
0
파일: VMManager.java 프로젝트: nbearson/IDV
 /**
  * Get all of the view managers of the given class
  *
  * @param c ViewManager class
  * @return List of ViewManagers
  */
 public List getViewManagers(Class c) {
   List result = new ArrayList();
   List vms = getViewManagers();
   for (int i = 0; i < vms.size(); i++) {
     ViewManager vm = (ViewManager) vms.get(i);
     if (c.isAssignableFrom(vm.getClass())) {
       result.add(vm);
     }
   }
   return result;
 }
예제 #2
0
 /**
  * Accepts only cookies that can provide <code>Toolbar</code>.
  *
  * @param cookie an <code>InstanceCookie</code> to test
  * @return true if the cookie can provide accepted instances
  */
 protected InstanceCookie acceptCookie(InstanceCookie cookie)
     throws java.io.IOException, ClassNotFoundException {
   Class c = cookie.instanceClass();
   if (Toolbar.class.isAssignableFrom(c)) {
     return cookie;
   }
   if (Presenter.Toolbar.class.isAssignableFrom(c)) {
     return cookie;
   }
   if (separatorClass.isAssignableFrom(c)) {
     return cookie;
   }
   return null;
 }