예제 #1
0
 // Get the delegated-to editor kit. Specified by classname, not
 // prototype; specifying by prototype would be possible but a little
 // harder, and would make it difficult to make a good property
 // editor for.
 private void updateDelegate() {
   try {
     delegate =
         (EditorKit)
             Beans.instantiate(TopManager.getDefault().systemClassLoader(), Settings.kitClass);
     if (Settings.debug) System.err.println("The delegate kit: " + delegate);
   } catch (Exception e) {
     TopManager.getDefault().notifyException(e);
   }
 }
예제 #2
0
 /**
  * Instantiate a JavaBean.
  *
  * @param cls the class-loader from which we should create the bean. If this is null, then the
  *     system class-loader is used.
  * @param beanName the name of the bean within the class-loader. For example "sun.beanbox.foobah"
  * @param beanContext The BeanContext in which to nest the new bean
  * @exception java.lang.ClassNotFoundException if the class of a serialized object could not be
  *     found.
  * @exception java.io.IOException if an I/O error occurs.
  */
 public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext)
     throws java.io.IOException, ClassNotFoundException {
   return Beans.instantiate(cls, beanName, beanContext, null);
 }