Author: SergeySmirnov
Date: 2007-10-31 22:05:50 -0400 (Wed, 31 Oct 2007)
New Revision: 3664
Added:
trunk/sandbox/impl/src/main/resources/META-INF/
trunk/sandbox/impl/src/main/resources/META-INF/resources-config.xml
trunk/sandbox/ui/rex-resizable/design/
trunk/sandbox/ui/rex-resizable/design/todo-list.txt
trunk/sandbox/ui/rex-resizable/src/main/java/org/richfaces/renderkit/
trunk/sandbox/ui/rex-resizable/src/main/java/org/richfaces/renderkit/ResizableRendererBase.java
trunk/sandbox/ui/rex-resizable/src/main/resources/
trunk/sandbox/ui/rex-resizable/src/main/resources/org/
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/renderkit/
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/renderkit/html/
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/renderkit/html/script/
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/renderkit/html/script/rexInitWidget.js
Modified:
trunk/sandbox/samples/rex-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable.xhtml
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml
trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml
trunk/sandbox/ui/pom.xml
trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml
trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx
Log:
rex resizable component and demo updates
Added: trunk/sandbox/impl/src/main/resources/META-INF/resources-config.xml
===================================================================
--- trunk/sandbox/impl/src/main/resources/META-INF/resources-config.xml
(rev 0)
+++ trunk/sandbox/impl/src/main/resources/META-INF/resources-config.xml 2007-11-01
02:05:50 UTC (rev 3664)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource-config>
+ <resource>
+ <name>extjs/ext-all.js</name>
+ <path>org/richfaces/renderkit/html/scripts/extjs/ext-all.js</path>
+ <renderer class="org.ajax4jsf.resource.ScriptRenderer"/>
+ </resource>
+ <resource>
+ <name>extjs/ext-base.js</name>
+ <path>org/richfaces/renderkit/html/scripts/extjs/ext-base.js</path>
+ <renderer class="org.ajax4jsf.resource.ScriptRenderer"/>
+ </resource>
+ <resource>
+ <name>extjs/ext-all.css</name>
+ <path>org/richfaces/renderkit/html/scripts/extjs/ext-all.css</path>
+ <renderer class="org.ajax4jsf.resource.StyleRenderer"/>
+ </resource>
+ <resource>
+ <name>extjs/ext-css-patch.xcss</name>
+ <path>org/richfaces/renderkit/html/scripts/extjs/ext-css-patch.xcss</path>
+ </resource>
+</resource-config>
\ No newline at end of file
Modified:
trunk/sandbox/samples/rex-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
---
trunk/sandbox/samples/rex-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-11-01
01:37:44 UTC (rev 3663)
+++
trunk/sandbox/samples/rex-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-11-01
02:05:50 UTC (rev 3664)
@@ -1,4 +1,4 @@
# list of components in comma-separated format
#id=name,iconImage,captionImage,devGuideLocation,tldDocLocation,javaDocLocation
-resizable= rexc, resizable, /images/ico_common.gif,
/images/cn_resizable.gif,
RichFacesComponentsLibrary.html#resizable,
jbossrichfaces/freezone/docs/tlddoc/rich/resizable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIResizable.html,
/richfaces/resizable.jsf
+resizable= rexc, Resizable, /images/ico_common.gif,
/images/cn_resizable.gif,
RichFacesComponentsLibrary.html#resizable,
jbossrichfaces/freezone/docs/tlddoc/rich/resizable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIResizable.html,
/richfaces/resizable.jsf
jQuery= rexc, jQuery, /images/ico_common.gif,
/images/cn_jQuery.gif, RichFacesComponentsLibrary.html#jQuery,
jbossrichfaces/freezone/docs/tlddoc/rich/jQuery.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIJQuery.html,
/richfaces/jQuery.jsf
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css 2007-11-01 01:37:44 UTC
(rev 3663)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css 2007-11-01 02:05:50 UTC
(rev 3664)
@@ -14,6 +14,12 @@
font-family: Verdana,Arial;
}
+.sheader {
+ font-size:18px;
+ }
+
+
+
.footer-text {
font-size: 10px;
}
Modified:
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml
===================================================================
---
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml 2007-11-01
01:37:44 UTC (rev 3663)
+++
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml 2007-11-01
02:05:50 UTC (rev 3664)
@@ -3,12 +3,24 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rex="http://labs.jboss.com/jbossrichfaces/ui/ui/rex-resizable&...
xmlns:rich="http://richfaces.org/rich">
- <rich:separator lineType="solid" height="1" />
+ <h:form>
+ <rex:resizable preserveRatio="false" easing="easingInStrong"
animate="true"
+ minWidth="450" minHeight="100" width="429"
height="200"
+ style="padding-bottom:4px;z-index:2000">
+ <rich:panel style="height:100%">
+ <f:facet name="header">
+ Dialog Title
+ </f:facet>
+ Drag botton right hand corner to resize<br /><br />
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a,
porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non,
sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero
lectus bibendum purus, sit amet tincidunt quam turpis vel lacus.
+ </rich:panel>
+
+ </rex:resizable>
+ </h:form>
-
- <rich:separator height="1" style="padding-top:10px" />
</ui:composition>
\ No newline at end of file
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable.xhtml 2007-11-01
01:37:44 UTC (rev 3663)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable.xhtml 2007-11-01
02:05:50 UTC (rev 3664)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/main.xhtml">
- <ui:define name="title">RichFaces - Open Source Rich JSF Components -
exj js resizable</ui:define>
+ <ui:define name="title">RichFaces ExtJS Intergation Demo exj js
resizable</ui:define>
<ui:define name="body">
<rich:tabPanel switchType="server"
value="#{componentNavigator.activeTab}" styleClass="top_tab"
contentClass="content_tab" headerClass="header_tabs_class"
inactiveTabClass="inactive_tab" activeTabClass="active_tab">
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml 2007-11-01
01:37:44 UTC (rev 3663)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml 2007-11-01
02:05:50 UTC (rev 3664)
@@ -32,10 +32,13 @@
</tr>
</tbody>
</table>
+<h:outputText styleClass="component_name sheader"
value="#{componentNavigator.currentComponent.name}"
+ rendered="#{componentNavigator.hasCurrentComponent}" height="40"
alt="" border="0"/>
+<ui:remove>
<h:graphicImage value="#{componentNavigator.currentComponent.captionImage}"
rendered="#{componentNavigator.hasCurrentComponent}" height="40"
alt="" border="0" styleClass="component_name"/>
-
+</ui:remove>
<table cellpadding="0" cellspacing="0" border="0"
class="content_container" width="100%">
<tbody>
<tr>
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-11-01 01:37:44 UTC (rev 3663)
+++ trunk/sandbox/ui/pom.xml 2007-11-01 02:05:50 UTC (rev 3664)
@@ -18,5 +18,6 @@
<module>listShuttle</module>
<module>orderingList</module>
<module>columns</module>
+ <module>rex-resizable</module>
</modules>
</project>
\ No newline at end of file
Added: trunk/sandbox/ui/rex-resizable/design/todo-list.txt
===================================================================
--- trunk/sandbox/ui/rex-resizable/design/todo-list.txt (rev 0)
+++ trunk/sandbox/ui/rex-resizable/design/todo-list.txt 2007-11-01 02:05:50 UTC (rev
3664)
@@ -0,0 +1,4 @@
+1. name attribute that allow to specify the variable for the Ext.Resizable object
+2. enable wrap: false/true mode. 'for' attribute to point to the component or
dom element to attach (equals to wrap:false)
+3. process right adjustments and resizeChild attributes that allow variable types
+4. skining for used images
\ No newline at end of file
Modified: trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml
===================================================================
--- trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml 2007-11-01
01:37:44 UTC (rev 3663)
+++ trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml 2007-11-01
02:05:50 UTC (rev 3664)
@@ -23,16 +23,218 @@
org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
</superclass>
</tag>
+
&ui_component_attributes;
+ &html_events;
+ &html_style_attributes;
<property>
- <name>name</name>
+ <name>adjustments</name>
<classname>java.lang.String</classname>
<description>
- The name of the function that will be generated to execute the query.
- The name attribute is required if timing attribute equals to
"onJScall"
+ String "auto" or an array [width, height]
+ with values to be added to the resize operation's new size
+ (defaults to [0,0])
</description>
<defaultvalue>""</defaultvalue>
</property>
+ <property>
+ <name>animate</name>
+ <classname>java.lang.String</classname>
+ <description>
+ True to animate the resize
+ (not compatible with dynamic sizing, defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>disableTrackOver</name>
+ <classname>java.lang.String</classname>
+ <description>
+ True to disable mouse tracking.
+ This is only applied at config time. (defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>draggable</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Convenience to initialize drag drop (defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>duration</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Animation duration if animate = true (defaults to .35)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>dynamic</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Animation duration if animate = true (defaults to .35)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>easing</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Animation easing if animate = true (defaults to 'easingOutStrong')
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>enabled</name>
+ <classname>java.lang.String</classname>
+ <description>
+ False to disable resizing (defaults to true)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>handles</name>
+ <classname>java.lang.String</classname>
+ <description>
+ String consisting of the resize handles to display (defaults to undefined)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>height</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The height of the element in pixels (defaults to 50)
+ </description>
+ <defaultvalue>"50"</defaultvalue>
+ </property>
+ <property>
+ <name>heightIncrement</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The increment to snap the height resize in pixels
+ (dynamic must be true, defaults to 0)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>maxHeight</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The maximum height for the element (defaults to 10000)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>maxWidth</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The maximum width for the element (defaults to 10000)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>minHeight</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The minimum height for the element (defaults to 5)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>minWidth</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The minimum width for the element (defaults to 5)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>minX</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The minimum allowed page X for the element
+ (only used for west resizing, defaults to 0)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>minY</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The minimum allowed page Y for the element
+ (only used for north resizing, defaults to 0)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>multiDirectional</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Deprecated. The old style of adding multi-direction
+ resize handles, deprecated in favor of the handles
+ config option (defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>pinned</name>
+ <classname>java.lang.String</classname>
+ <description>
+ True to ensure that the resize handles are always visible,
+ false to display them only when the user mouses over the
+ resizable borders. This is only applied at config time.
+ (defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>preserveRatio</name>
+ <classname>java.lang.String</classname>
+ <description>
+ True to preserve the original ratio between height and width
+ during resize (defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>resizeChild</name>
+ <classname>java.lang.String</classname>
+ <description>
+ True to resize the first child, or id/element to resize
+ (defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>transparent</name>
+ <classname>java.lang.String</classname>
+ <description>
+ True for transparent handles. This is only applied at
+ config time. (defaults to false)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>width</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The width of the element in pixels (defaults to 100)
+ </description>
+ <defaultvalue>"100"</defaultvalue>
+ </property>
+ <property>
+ <name>widthIncrement</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The increment to snap the width resize in pixels
+ (dynamic must be true, defaults to 0)
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
</component>
</components>
Added:
trunk/sandbox/ui/rex-resizable/src/main/java/org/richfaces/renderkit/ResizableRendererBase.java
===================================================================
---
trunk/sandbox/ui/rex-resizable/src/main/java/org/richfaces/renderkit/ResizableRendererBase.java
(rev 0)
+++
trunk/sandbox/ui/rex-resizable/src/main/java/org/richfaces/renderkit/ResizableRendererBase.java 2007-11-01
02:05:50 UTC (rev 3664)
@@ -0,0 +1,29 @@
+package org.richfaces.renderkit;
+
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.richfaces.component.UIResizable;
+import javax.faces.component.UIComponent;
+
+public class ResizableRendererBase extends HeaderResourcesRendererBase {
+ protected Class getComponentClass() {
+ return UIResizable.class;
+ }
+
+ protected void formParamList(UIComponent component,String[] vals,
+ StringBuffer strb, boolean quoted) {
+
+ for (int i=0; i < vals.length; i++) {
+ String val = (String)component.getAttributes().get(vals[i]);
+ if (! "".equals(val) ) {
+ if (strb.length()!=0)strb.append(",");
+ strb.append(vals[i]);
+ strb.append(":");
+ if (quoted) strb.append("'");
+ strb.append(val);
+ if (quoted) strb.append("'");
+ }
+ }
+
+ }
+
+}
Added:
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/renderkit/html/script/rexInitWidget.js
===================================================================
---
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/renderkit/html/script/rexInitWidget.js
(rev 0)
+++
trunk/sandbox/ui/rex-resizable/src/main/resources/org/richfaces/renderkit/html/script/rexInitWidget.js 2007-11-01
02:05:50 UTC (rev 3664)
@@ -0,0 +1,5 @@
+if (!window.Richfaces) window.Richfaces={};
+
+window.Richfaces.rexInitWidget =
+function(func) {Event.observe(window, "load", func );} ;
+
Modified: trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx
===================================================================
--- trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx 2007-11-01 01:37:44
UTC (rev 3663)
+++ trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx 2007-11-01 02:05:50
UTC (rev 3664)
@@ -6,16 +6,48 @@
xmlns:u="
http://ajax4jsf.org/cdk/u"
xmlns:x="
http://ajax4jsf.org/cdk/x"
class="org.richfaces.renderkit.html.ResizableRenderer"
- baseclass="org.ajax4jsf.renderkit.HeaderResourcesRendererBase"
+ baseclass="org.richfaces.renderkit.ResizableRendererBase"
component="org.richfaces.component.UIResizable">
+
<f:clientid var="clientId"/>
-
<c:set var="name"
value="#{component.attributes['name']}"/>
- <!--
- <h:scripts></h:scripts>
- -->
+
+ <h:styles>extjs/ext-all.css,extjs/ext-css-patch.xcss</h:styles>
+ <h:scripts>extjs/ext-base.js,extjs/ext-all.js,script/rexInitWidget.js</h:scripts>
-<div>Start here</div>
+<jsp:scriptlet>
+<![CDATA[
+ String[] attr = {"animate","disableTrackOver",
"draggable",
+ "duration", "dynamic",
"enabled","height",
+ "heightIncrement", "maxHeight", "maxWidth",
"minHeight",
+ "minWidth", "minX", "minY",
"multiDirectional", "pinned",
+ "preserveRatio","resizeChild", "transparent",
"width",
+ "widthIncrement"};
+ String[] qattr = { "adjustments", "easing",
"handles"};
+ StringBuffer json = new StringBuffer();
+
+ formParamList(component, attr,json, false);
+ formParamList(component, qattr,json, true);
+
+ variables.setVariable("params", json.toString());
+
+]]>
+</jsp:scriptlet>
+
+
+
+<div id="#{clientId}"
x:passThruWithExclusions="id,styleClass,class">
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ <f:clientid var="clientId"/>
+<script type="text/javascript">
+window.Richfaces.rexInitWidget(function(){
+new Ext.Resizable("#{clientId}", { #{params} });
+});
+
+</script>
+</div>
</f:root>
\ No newline at end of file