You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/09/08 20:34:13 UTC

svn commit: r441604 - in /myfaces/tomahawk/trunk/sandbox/core/src/main: java/org/apache/myfaces/custom/dojolayouts/ tld/

Author: werpu
Date: Fri Sep  8 11:34:12 2006
New Revision: 441604

URL: http://svn.apache.org/viewvc?view=rev&rev=441604
Log:
renamed the split pane and content pane
to remove the dojo prefix, added a bunch of dojo related attributes
to the split pane which are predefined in the dojo source code
updated the example to reflect the namechange

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoContentPaneTag.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPane.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneRenderer.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneTag.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoContentPaneTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoContentPaneTag.java?view=diff&rev=441604&r1=441603&r2=441604
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoContentPaneTag.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoContentPaneTag.java Fri Sep  8 11:34:12 2006
@@ -24,31 +24,35 @@
 
     private static final String TAG_PARAM_STYLE_CLASS = "styleClass";
 
-    private static final String TAG_PARAM_STYLE = "style";
+    private static final String TAG_PARAM_STYLE       = "style";
 
-    public static String TAG_PARAM_SIZESHARE = "sizeShare";
 
-    private String       _sizeShare          = null;
-    private String       _style              = null;
-    private String       _styleClass         = null;
+    public static final String  TAG_PARAM_SIZESHARE   = "sizeShare";
+
+    private String              _sizeShare            = null;
+
+    private String              _style                = null;
+
+    private String              _styleClass           = null;
+
 
     protected void setProperties(UIComponent component) {
         super.setProperties(component);
         super.setIntegerProperty(component, TAG_PARAM_SIZESHARE, _sizeShare);
         super.setStringProperty(component, TAG_PARAM_STYLE, _style);
         super.setStringProperty(component, TAG_PARAM_STYLE_CLASS, _styleClass);
+
+
     }
 
-    
-    
     public void release() {
         super.release();
         _style = null;
         _styleClass = null;
         _sizeShare = null;
-    }
 
 
+    }
 
     public void setSizeShare(String sizeShare) {
         this._sizeShare = sizeShare;
@@ -69,5 +73,6 @@
     public void setStyleClass(String styleClass) {
         this._styleClass = styleClass;
     }
+
 
 }

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPane.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPane.java?view=diff&rev=441604&r1=441603&r2=441604
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPane.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPane.java Fri Sep  8 11:34:12 2006
@@ -20,82 +20,140 @@
 import javax.faces.el.ValueBinding;
 
 public class DojoSplitPane extends DojoContentPane {
-    //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+    // ------------------ GENERATED CODE BEGIN (do not modify!)
+    // --------------------
+
+    public static final String COMPONENT_TYPE        = "org.apache.myfaces.DojoSplitPane";
+
+    public static final String COMPONENT_FAMILY      = "javax.faces.Output";
 
-    public static final String COMPONENT_TYPE = "org.apache.myfaces.DojoSplitPane";
-    public static final String COMPONENT_FAMILY = "javax.faces.Output";
     public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.DojoSplitPaneRenderer";
 
-    private String _splitOrientation = null;
-    private Integer _sizerWidth = null;
-    private Integer _activeSizing = null;
+    private String             _splitOrientation     = null;
+
+    private Integer            _sizerWidth           = null;
+
+    private Integer            _activeSizing         = null;
+
+    private Boolean            _persist              = null;
 
-    public DojoSplitPane()
-    {
+    private Integer            _startPoint           = null;
+
+    private Integer            _lastPoint            = null;
+
+
+    public DojoSplitPane() {
         super();
         setRendererType(DEFAULT_RENDERER_TYPE);
     }
 
-    public String getFamily()
-    {
+    public String getFamily() {
         return COMPONENT_FAMILY;
     }
 
-    public void setSplitOrientationation(String orientation)
-    {
+    public void setSplitOrientationation(String orientation) {
         _splitOrientation = orientation;
     }
 
-    public String getSplitOrientationation()
-    {
-        if (_splitOrientation != null) return _splitOrientation;
+    public String getSplitOrientationation() {
+        if (_splitOrientation != null)
+            return _splitOrientation;
         ValueBinding vb = getValueBinding("orientation");
-        return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+        return vb != null ? (String) vb.getValue(getFacesContext()) : null;
     }
 
-    public void setSizerWidth(Integer sizerWidth)
-    {
+    public void setSizerWidth(Integer sizerWidth) {
         _sizerWidth = sizerWidth;
     }
 
-    public Integer getSizerWidth()
-    {
-        if (_sizerWidth != null) return _sizerWidth;
+    public Integer getSizerWidth() {
+        if (_sizerWidth != null)
+            return _sizerWidth;
         ValueBinding vb = getValueBinding("sizerWidth");
-        return vb != null ? (Integer)vb.getValue(getFacesContext()) : null;
+        return vb != null ? (Integer) vb.getValue(getFacesContext()) : null;
     }
 
-    public void setActiveSizing(Integer activeSizing)
-    {
+    public void setActiveSizing(Integer activeSizing) {
         _activeSizing = activeSizing;
     }
 
-    public Integer getActiveSizing()
-    {
-        if (_activeSizing != null) return _activeSizing;
+    public Integer getActiveSizing() {
+        if (_activeSizing != null)
+            return _activeSizing;
         ValueBinding vb = getValueBinding("activeSizing");
-        return vb != null ? (Integer)vb.getValue(getFacesContext()) : null;
+        return vb != null ? (Integer) vb.getValue(getFacesContext()) : null;
+    }
+
+    public void setPersist(Boolean persist) {
+        _persist = persist;
     }
 
+    public Boolean getPersist() {
+        if (_persist != null)
+            return _persist;
+        ValueBinding vb = getValueBinding("persist");
+        return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+    }
+
+    public void setLastPoint(Integer lastPoint) {
+        _lastPoint = lastPoint;
+    }
+
+    public Integer getLastPoint() {
+        if (_lastPoint != null)
+            return _lastPoint;
+        ValueBinding vb = getValueBinding("lastPoint");
+        return vb != null ? (Integer) vb.getValue(getFacesContext()) : null;
+    }
 
+    public void setStartPoint(Integer startPoint) {
+        _startPoint = startPoint;
+    }
 
-    public Object saveState(FacesContext context)
-    {
-        Object values[] = new Object[4];
+    public Integer getStartPoint() {
+        if (_startPoint != null)
+            return _startPoint;
+        ValueBinding vb = getValueBinding("startPoint");
+        return vb != null ? (Integer) vb.getValue(getFacesContext()) : null;
+    }
+    
+    
+    public Object saveState(FacesContext context) {
+        Object values[] = new Object[7];
         values[0] = super.saveState(context);
         values[1] = _splitOrientation;
         values[2] = _sizerWidth;
         values[3] = _activeSizing;
+        values[4] = _persist;
+
+        // //savestate startPoint begin
+        values[5] = _startPoint;
+        // //savestate startPoint end
+
+        // //savestate lastPoint begin
+        values[6] = _lastPoint;
+        // //savestate lastPoint end
+
         return ((Object) (values));
     }
 
-    public void restoreState(FacesContext context, Object state)
-    {
-        Object values[] = (Object[])state;
+    public void restoreState(FacesContext context, Object state) {
+        Object values[] = (Object[]) state;
         super.restoreState(context, values[0]);
-        _splitOrientation = (String)values[1];
-        _sizerWidth = (Integer)values[2];
-        _activeSizing = (Integer)values[3];
+        _splitOrientation = (String) values[1];
+        _sizerWidth = (Integer) values[2];
+        _activeSizing = (Integer) values[3];
+        _persist = (Boolean) values[4];
+
+        // //restorestate startPoint begin
+        _startPoint = (Integer) values[5];
+        // //restorestate startPoint end
+
+        // //restorestate lastPoint begin
+        _lastPoint = (Integer) values[6];
+        // //restorestate lastPoint end
+
     }
-    //------------------ GENERATED CODE END ---------------------------------------
+    // ------------------ GENERATED CODE END
+    // ---------------------------------------
 }

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneRenderer.java?view=diff&rev=441604&r1=441603&r2=441604
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneRenderer.java Fri Sep  8 11:34:12 2006
@@ -89,11 +89,27 @@
         DojoSplitPane pane = (DojoSplitPane) component;
         Map attributes = new HashedMap();
 
-        attributes.put("sizeShare", pane.getSizeShare());
-        attributes.put("activeSizing", pane.getActiveSizing());
-        attributes.put("orientation", pane.getSplitOrientationation());
-        attributes.put("sizerWidth", pane.getSizerWidth());
-     
+        if (pane.getSizeShare() != null)
+            attributes.put("sizeShare", pane.getSizeShare());
+
+        if (pane.getActiveSizing() != null)
+            attributes.put("activeSizing", pane.getActiveSizing());
+
+        if (pane.getSplitOrientationation() != null)
+            attributes.put("orientation", pane.getSplitOrientationation());
+
+        if (pane.getSizerWidth() != null)
+            attributes.put("sizerWidth", pane.getSizerWidth());
+
+        if (pane.getPersist() != null)
+            attributes.put("persist", pane.getPersist());
+
+        if (pane.getStartPoint() != null)
+            attributes.put("startPoint", pane.getStartPoint());
+
+        if (pane.getStartPoint() != null)
+            attributes.put("lastPoint", pane.getLastPoint());
+
         DojoUtils.renderWidgetInitializationCode(context, component, "SplitContainer", attributes);
         ResponseWriter writer = context.getResponseWriter();
         writer.startElement(HTML.SCRIPT_ELEM, component);

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneTag.java?view=diff&rev=441604&r1=441603&r2=441604
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneTag.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojolayouts/DojoSplitPaneTag.java Fri Sep  8 11:34:12 2006
@@ -26,12 +26,25 @@
 
     private static final String TAG_PARAM_ACTIVESIZING = "activesizing";
 
+    public static final String  TAG_PARAM_Persist     = "persist";
+
+    public static final String  TAG_PARAM_StartPoint  = "startPoint";
+
+    public static final String  TAG_PARAM_LastPoint   = "lastPoint";
+
+    
     private String              _orientation           = null;
 
     private String              _sizerWidth            = null;
 
     private String              _activeSizing          = null;
 
+    private String              _persist               = null;
+
+    private String              _startPoint            = null;
+
+    private String              _lastPoint             = null;
+
     public void setActiveSizing(String activeSizing) {
         this._activeSizing = activeSizing;
     }
@@ -44,20 +57,48 @@
         this._sizerWidth = sizerWidth;
     }
 
+    public void setPersist(String persist) {
+        _persist = persist;
+    }
+
+    public void setLastPoint(String lastPoint) {
+        _lastPoint = lastPoint;
+    }
+
+    public void setStartPoint(String startPoint) {
+        _startPoint = startPoint;
+    }
+
     public String getComponentType() {
         return DojoSplitPane.COMPONENT_TYPE;
     }
+
     public String getRendererType() {
         return DojoSplitPane.DEFAULT_RENDERER_TYPE;
     }
 
-
     protected void setProperties(UIComponent component) {
 
         super.setProperties(component);
         super.setIntegerProperty(component, TAG_PARAM_ACTIVESIZING, _activeSizing);
         super.setIntegerProperty(component, TAG_PARAM_ORIENTATION, _orientation);
         super.setIntegerProperty(component, TAG_PARAM_SIZERWIDTH, _sizerWidth);
+        // //setProperties persist begin
+        super.setBooleanProperty(component, TAG_PARAM_Persist, _persist);
+        // //setProperties persist end
+
+        // // setProperties startPoint begin
+        super.setIntegerProperty(component, TAG_PARAM_StartPoint, _startPoint);
+        // //setProperties startPoint end
+
+        // //setProperties lastPoint begin
+        super.setIntegerProperty(component, TAG_PARAM_LastPoint, _lastPoint);
+        // //setProperties lastPoint end
+
+        // //release lastPoint begin
+        _lastPoint = null;
+        // //release lastPoint end
+
     }
 
     public void release() {
@@ -65,5 +106,15 @@
         _activeSizing = null;
         _orientation = null;
         _sizerWidth = null;
+        // //release persist begin
+        _persist = null;
+        // //release persist end
+        // //release startPoint begin
+        _startPoint = null;
+        // //release startPoint end
+        // //release startPoint begin
+        _lastPoint = null;
+        // //release startPoint end
+
     }
 }

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld?view=diff&rev=441604&r1=441603&r2=441604
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld Fri Sep  8 11:34:12 2006
@@ -1205,7 +1205,7 @@
 	</tag>
 
 	<tag>
-		<name>dojoContentPane</name>
+		<name>layoutingContentPane</name>
 		<tag-class>org.apache.myfaces.custom.dojolayouts.DojoContentPaneTag</tag-class>
 		<body-content>JSP</body-content>
 		<description>PanelGroup which supports a partialTriggers Attribute similar to the one in Trinidad</description>
@@ -1232,7 +1232,7 @@
 
 	</tag>
 	<tag>
-		<name>dojoSplitPane</name>
+		<name>layoutingSplitPane</name>
 		<tag-class>org.apache.myfaces.custom.dojolayouts.DojoSplitPaneTag</tag-class>
 		<body-content>JSP</body-content>
 		<description>PanelGroup which supports a partialTriggers Attribute similar to the one in Trinidad</description>
@@ -1277,6 +1277,27 @@
 			<rtexprvalue>false</rtexprvalue>
 			<type>java.lang.String</type>
             <description>horizontal or vertical</description>
+        </attribute>
+		<attribute>
+            <name>persist</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+            <type>java.lang.Boolean</type>
+            <description>If true, cookie persisting of the split pane is enabled</description>
+        </attribute>
+        <attribute>
+            <name>startPoint</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+            <type>java.lang.Integer</type>
+            <description>Starting Point of the split pane as defined by dojo</description>
+        </attribute>
+        <attribute>
+            <name>lastPoint</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+            <type>java.lang.Integer</type>
+            <description>Last point of the split pane</description>
         </attribute>
 	</tag>