2002/07/16 00:39:23
[org.ibex.core.git] / src / org / xwt / Static.java
index 035a4ed..cb7a510 100644 (file)
@@ -8,13 +8,14 @@ import org.mozilla.javascript.*;
 public class Static extends JSObject {
 
     public static Static getStatic(String resourcename) {
+        return (Static)cache.get(resourcename);
+    }
+
+    public static Static createStatic(String resourcename) {
         Static ret = (Static)cache.get(resourcename);
         if (ret == null) {
             Template t = Template.getTemplate(resourcename, null);
-
-            // FIXME: ugly
             if (t == null) return new Static(resourcename, true);
-
             ret = new Static(resourcename, false);
             t.link();
             return ret;
@@ -58,4 +59,6 @@ public class Static extends JSObject {
         return getStatic(resourcename + (resourcename.length() == 0 ? "" : ".") + name);
     }
 
+    static { createStatic(""); }
+
 }