KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > gumby > factory > SwingFactory


1 package org.sapia.gumby.factory;
2
3 import org.sapia.util.xml.confix.CreationStatus;
4 import org.sapia.util.xml.confix.ObjectCreationException;
5 import org.sapia.util.xml.confix.ReflectionFactory;
6
7 /**
8  * @author Yanick Duchesne
9  *
10  * <dl>
11  * <dt><b>Copyright: </b>
12  * <dd>Copyright &#169; 2002-2005 <a HREF="http://www.sapia-oss.org">Sapia Open
13  * Source Software </a>. All Rights Reserved.</dd>
14  * </dt>
15  * <dt><b>License: </b>
16  * <dd>Read the license.txt file of the jar or visit the <a
17  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the Sapia
18  * OSS web site</dd>
19  * </dt>
20  * </dl>
21  */

22 public class SwingFactory extends NamespacedFactory {
23
24   private ReflectionFactory _swingFac = new ReflectionFactory(
25                                           new String JavaDoc[] { "javax.swing" });
26
27   /**
28    * @see org.sapia.gumby.factory.NamespacedFactory#newObjectFor(java.lang.String,
29    * java.lang.String, java.lang.String, java.lang.Object)
30    */

31   public CreationStatus newObjectFor(String JavaDoc prefix, String JavaDoc uri, String JavaDoc name,
32       Object JavaDoc parent) throws ObjectCreationException {
33     if(super.hasDefFor(name)) {
34       return super.newObjectFor(prefix, uri, name, parent);
35     } else {
36       return _swingFac.newObjectFor(prefix, uri, name, parent);
37     }
38   }
39
40 }
41
Popular Tags