[seam-commits] Seam SVN: r11436 - in sandbox/trunk/modules/xwidgets: examples/helloworld and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Aug 26 19:29:17 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-08-26 19:29:17 -0400 (Wed, 26 Aug 2009)
New Revision: 11436

Added:
   sandbox/trunk/modules/xwidgets/examples/README
   sandbox/trunk/modules/xwidgets/examples/panels/
   sandbox/trunk/modules/xwidgets/examples/panels/index.html
   sandbox/trunk/modules/xwidgets/examples/panels/panels.xw
Removed:
   sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Button.js
   sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Label.js
   sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Panel.js
Modified:
   sandbox/trunk/modules/xwidgets/examples/helloworld/helloworld.xw
   sandbox/trunk/modules/xwidgets/examples/helloworld/index.html
   sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js
Log:
minor fixes, add panels example


Added: sandbox/trunk/modules/xwidgets/examples/README
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/README	                        (rev 0)
+++ sandbox/trunk/modules/xwidgets/examples/README	2009-08-26 23:29:17 UTC (rev 11436)
@@ -0,0 +1,10 @@
+Running the examples locally in Firefox
+=======================================
+
+Because of Firefox's restrictive default settings, you may receive a security 
+error when trying to load the examples.  To get around this, you need to modify
+Firefox's configuration by following these steps:
+
+1) type about:config in the address bar
+
+2) Find the setting security.fileuri.strict_origin_policy and change it to false.

Modified: sandbox/trunk/modules/xwidgets/examples/helloworld/helloworld.xw
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/helloworld/helloworld.xw	2009-08-26 22:51:54 UTC (rev 11435)
+++ sandbox/trunk/modules/xwidgets/examples/helloworld/helloworld.xw	2009-08-26 23:29:17 UTC (rev 11436)
@@ -10,5 +10,6 @@
         </action>
       </event>
     </button>
-  </panel>
+  </panel>
+
 </view>

Modified: sandbox/trunk/modules/xwidgets/examples/helloworld/index.html
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/helloworld/index.html	2009-08-26 22:51:54 UTC (rev 11435)
+++ sandbox/trunk/modules/xwidgets/examples/helloworld/index.html	2009-08-26 23:29:17 UTC (rev 11436)
@@ -7,10 +7,9 @@
     <script src="../../src/main/javascript/xw.js"></script>
       
     <script type="text/javascript">           
-      // Can't set the resource base to a higher path
-      // because of browser security restrictions
-      //xw.setResourceBase("../../src/main/javascript");
-      
+      // See README for notes on running in Firefox
+      xw.setResourceBase("../../src/main/javascript");
+
       xw.openView("helloworld.xw", "container");      
     </script>
   </body>

Deleted: sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Button.js
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Button.js	2009-08-26 22:51:54 UTC (rev 11435)
+++ sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Button.js	2009-08-26 23:29:17 UTC (rev 11436)
@@ -1,36 +0,0 @@
-Package("xw.controls");
-
-xw.controls.Button = function()
-{
-  this.control = null;
-  this.value = null;
-  
-  xw.controls.Button.prototype.setParent = function(parent)
-  {
-    this.parent = parent;
-  }
-  
-  xw.controls.Button.prototype.paint = function()
-  {
-     if (this.control == null)
-     {
-       this.control = document.createElement("button");
-       this.control.widget = this;
-       this.parent.control.appendChild(this.control);
-       var text = document.createTextNode(this.value);
-       this.control.appendChild(text);       
-       
-       if (!xw.Sys.isUndefined(this.events))
-       {        
-         if (!xw.Sys.isUndefined(this.events.onclick))
-         {
-           var events = this.events;
-           var action = function() {
-             events.onclick.invoke();
-           };
-           xw.Sys.chainEvent(this.control, "click", action);
-         }
-       }
-     }    
-  }
-}

Deleted: sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Label.js
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Label.js	2009-08-26 22:51:54 UTC (rev 11435)
+++ sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Label.js	2009-08-26 23:29:17 UTC (rev 11436)
@@ -1,24 +0,0 @@
-Package("xw.controls");
-
-xw.controls.Label = function()
-{
-  this.value = "";
-  this.parent = null;
-  this.control = null;
-  
-  xw.controls.Label.prototype.setParent = function(parent)
-  {
-    this.parent = parent;
-  }
-  
-  xw.controls.Label.prototype.paint = function()
-  {
-    if (this.control == null)
-    {
-      this.control = document.createTextNode(this.value);
-      // IE doesn't support setting random properties on text nodes
-      // this.control.widget = this;
-      this.parent.control.appendChild(this.control);
-    }       
-  }
-}

Deleted: sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Panel.js
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Panel.js	2009-08-26 22:51:54 UTC (rev 11435)
+++ sandbox/trunk/modules/xwidgets/examples/helloworld/xw.Panel.js	2009-08-26 23:29:17 UTC (rev 11436)
@@ -1,64 +0,0 @@
-Package("xw.controls");
-
-xw.controls.Panel = function()
-{
-  this.width = 200;
-  this.height = 100; 
-  this.parent = null;
-  this.control = null;
-  this.align = null;
-    
-  xw.controls.Panel.prototype.setParent = function(parent)
-  {
-    this.parent = parent;
-  }
-  
-  xw.controls.Panel.prototype.setAlign = function(align)
-  {
-    this.align = align;
-  }
-  
-  xw.controls.Panel.prototype.setWidth = function(width)
-  {
-    this.width = width;
-  }
-  
-  xw.controls.Panel.prototype.setHeight = function(height)
-  {
-    this.height = height;
-  }
-  
-  xw.controls.Panel.prototype.paint = function(layout)
-  {
-     if (this.control == null)
-     {
-       this.control = document.createElement("div");
-       this.control.widget = this;              
-       this.control.style.backgroundColor = "#ece9d6";
-       
-       // TODO make the border more configurable (or allow it to be turned off etc)
-       this.control.style.borderTop = "1px solid white";
-       this.control.style.borderLeft = "1px solid white";
-       this.control.style.borderBottom = "1px solid #555555";
-       this.control.style.borderRight = "1px solid #555555";
-       
-       if (layout != null)
-       {
-         layout.setBounds(this);
-       }
-       else
-       {
-         this.control.style.width = this.width;
-         this.control.style.height = this.height;         
-         this.control.style.display = "inline";
-       }
-
-       this.parent.control.appendChild(this.control);
-     }    
-     
-     for (var i = 0; i < this.children.length; i++)
-     {
-       this.children[i].paint(); 
-     }     
-  }
-}

Added: sandbox/trunk/modules/xwidgets/examples/panels/index.html
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/panels/index.html	                        (rev 0)
+++ sandbox/trunk/modules/xwidgets/examples/panels/index.html	2009-08-26 23:29:17 UTC (rev 11436)
@@ -0,0 +1,16 @@
+<html>
+  <body style="background-color:#eeeeee">
+    <h1>Panel Examples</h1>
+  
+    <div id="container" style="border:1px solid black;width:75%;height:75%"></div>
+    
+    <script src="../../src/main/javascript/xw.js"></script>
+      
+    <script type="text/javascript">           
+      // See README for notes on running in Firefox
+      xw.setResourceBase("../../src/main/javascript");
+      
+      xw.openView("panels.xw", "container");      
+    </script>
+  </body>
+</html>

Added: sandbox/trunk/modules/xwidgets/examples/panels/panels.xw
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/panels/panels.xw	                        (rev 0)
+++ sandbox/trunk/modules/xwidgets/examples/panels/panels.xw	2009-08-26 23:29:17 UTC (rev 11436)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<view xmlns="http://jboss.com/products/xwidgets">
+  <panel align="top" height="50">
+    <label value="top"/>
+  </panel>
+
+  <panel align="bottom" height="50">
+    <label value="bottom"/>
+  </panel>
+  
+  <panel align="left" width="50">
+    <label value="left"/>
+  </panel>  
+  
+  <panel align="right" width="50">
+    <label value="right"/>
+  </panel>    
+
+  <panel align="client">
+    <label value="client"/>  
+  </panel>
+</view>

Modified: sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js
===================================================================
--- sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js	2009-08-26 22:51:54 UTC (rev 11435)
+++ sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js	2009-08-26 23:29:17 UTC (rev 11436)
@@ -56,9 +56,12 @@
        this.parent.control.appendChild(this.control);
      }    
      
-     for (var i = 0; i < this.children.length; i++)
-     {
-       this.children[i].paint(); 
-     }     
+     if (this.children)
+     {
+       for (var i = 0; i < this.children.length; i++)
+       {
+         this.children[i].paint(); 
+       }     
+     }   
   }
 }



More information about the seam-commits mailing list