Author: SergeySmirnov
Date: 2007-11-08 22:04:24 -0500 (Thu, 08 Nov 2007)
New Revision: 3845
Added:
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/button.xhtml
trunk/sandbox/ui/componentControl/
trunk/sandbox/ui/componentControl/pom.xml
trunk/sandbox/ui/componentControl/src/
trunk/sandbox/ui/componentControl/src/main/
trunk/sandbox/ui/componentControl/src/main/config/
trunk/sandbox/ui/componentControl/src/main/config/component/
trunk/sandbox/ui/componentControl/src/main/config/component/componentControl.xml
trunk/sandbox/ui/componentControl/src/main/java/
trunk/sandbox/ui/componentControl/src/main/java/org/
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/README
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java
trunk/sandbox/ui/rex-button/
Modified:
trunk/sandbox/samples/rex-demo/pom.xml
trunk/sandbox/samples/rex-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml
trunk/sandbox/ui/pom.xml
trunk/sandbox/ui/rex-messageBox/pom.xml
trunk/sandbox/ui/rex-messageBox/src/main/templates/htmlMessageBox.jspx
Log:
component/componentControl has been added
Modified: trunk/sandbox/samples/rex-demo/pom.xml
===================================================================
--- trunk/sandbox/samples/rex-demo/pom.xml 2007-11-09 02:06:22 UTC (rev 3844)
+++ trunk/sandbox/samples/rex-demo/pom.xml 2007-11-09 03:04:24 UTC (rev 3845)
@@ -203,6 +203,21 @@
<version>3.2.0-SNAPSHOT</version>
</dependency>
<dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>rex-button</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>rex-messageBox</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>componentControl</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>org.richfaces.sandbox</groupId>
<artifactId>richfaces-sandbox-impl</artifactId>
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-09
02:06:22 UTC (rev 3844)
+++
trunk/sandbox/samples/rex-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-11-09
03:04:24 UTC (rev 3845)
@@ -1,4 +1,5 @@
# 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
+button= rexc, Button, /images/ico_common.gif,
/images/cn_button.gif, RichFacesComponentsLibrary.html#button,
jbossrichfaces/freezone/docs/tlddoc/rich/button.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIButton.html,
/richfaces/button.jsf
#messageBox= rexc, MessageBox, /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
Added: trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/button.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/button.xhtml
(rev 0)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/button.xhtml 2007-11-09
03:04:24 UTC (rev 3845)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
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 ExtJS Intergation Demo exj js
Button</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">
+
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/button/usage.xhtml"/>
+ </rich:tab>
+ <ui:include src="/templates/include/tagInfo.xhtml">
+ <ui:param name="path" value="rich/button"/>
+ </ui:include>
+ </rich:tabPanel>
+
+ </ui:define>
+</ui:composition>
+</html>
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-09
02:06:22 UTC (rev 3844)
+++
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml 2007-11-09
03:04:24 UTC (rev 3845)
@@ -7,10 +7,12 @@
xmlns:rich="http://richfaces.org/rich">
<f:view contentType="text/html">
-
- <rex:resizable name="mypanel" preserveRatio="false"
easing="easingInStrong" animate="true"
+
+
+
+ <rex:resizable draggable="true" name="mypanel"
preserveRatio="false" easing="easingInStrong" animate="true"
minWidth="480" minHeight="130" width="429"
height="200"
- style="padding-bottom:4px;z-index:2000">
+ style="padding-bottom:4px;padding-right:4px;z-index:2000">
<rich:panel style="height:100%">
<f:facet name="header">
Dialog Title
@@ -25,26 +27,9 @@
</rex:resizable>
-<p>
- <b>Confirm</b><br />
- Standard Yes/No dialog.
- <button id="mb1" onclick="go();">Show</button>
-</p>
-<script>
-
-
- function showResult(btn){
- alert('You clicked the '+btn+' button');
- };
-
-
- function go() {
-
- Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do
that?', showResult, document.body);
- }
-</script>
+
</f:view>
</ui:composition>
\ No newline at end of file
Property changes on: trunk/sandbox/ui/componentControl
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/ui/componentControl/pom.xml
===================================================================
--- trunk/sandbox/ui/componentControl/pom.xml (rev 0)
+++ trunk/sandbox/ui/componentControl/pom.xml 2007-11-09 03:04:24 UTC (rev 3845)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>componentControl</artifactId>
+ <name>componentControl</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces.sandbox</prefix>
+ <taglib>
+ <shortName>componentControl</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/componentControl/src/main/config/component/componentControl.xml
===================================================================
--- trunk/sandbox/ui/componentControl/src/main/config/component/componentControl.xml
(rev 0)
+++
trunk/sandbox/ui/componentControl/src/main/config/component/componentControl.xml 2007-11-09
03:04:24 UTC (rev 3845)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.sandbox.ComponentControl</name>
+ <family>org.richfaces.sandbox.ComponentControl</family>
+ <classname>org.richfaces.sandbox.component.html.HtmlComponentControl</classname>
+ <superclass>org.richfaces.sandbox.component.UIComponentControl</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.sandbox.ComponentControlRenderer</name>
+ <template>htmlComponentControl.jspx</template>
+ </renderer>
+ <tag>
+ <name>componentControl</name>
+ <classname>org.richfaces.sandbox.taglib.ComponentControlTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+
+ <property>
+ <name>event</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The Event that is used to trigger the operation on the target component
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>name</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The optional name of the function that might be used to trigger the operation on the
target component
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>for</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Client identifier of the target component.
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>operation</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The function of Javascript API that will be invoked. The API method
+ is attached to the 'component' property of the root DOM element that
represents
+ the target component. The function has two parameters - event and params. See:
'params'
+ attribute for details.
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>params</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The set of parameters passed to the function of Javascript API that will be invoked.
+ The JSON syntax is used to define the parameters, but without open and closed curve
+ bracket.
+ As an alternative, the set of f:param can be used to define the parameters passed to
the
+ API function. If both way are used to define the parameters, both set are
concatenated.
+ if names are equals, the f:param has a priority.
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>attachTo</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Client identifier of the component or id of the existing DOM element that is a
source
+ for given event. If attachTo is defined, the event is attached on the client
according
+ to the AttachTiming attribute.
+ If attachTo is not defined, the event is attached on the server to the closest in
the
+ component tree parent component.
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>attachTiming</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"immediate"</defaultvalue>
+ </property>
+ </component>
+</components>
Added:
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
===================================================================
---
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
(rev 0)
+++
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java 2007-11-09
03:04:24 UTC (rev 3845)
@@ -0,0 +1,58 @@
+package org.richfaces.renderkit;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.javascript.JSEncoder;
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.richfaces.sandbox.component.UIComponentControl;
+import org.richfaces.component.util.HtmlUtil;
+
+
+public class ComponentControlRendererBase extends HeaderResourcesRendererBase {
+
+ protected Class getComponentClass() {
+ return UIComponentControl.class;
+ }
+
+
+
+ protected void checkValidity(String clientId, String name, String attachTiming, String
forAttr, String operation) {
+
+ if ( ! "onJScall".equals(attachTiming) &&
+ ! "onload".equals(attachTiming) &&
+ ! "immediate".equals(attachTiming) ) {
+ throw new FacesException(
+ "The attachTiming attribute of the controlComponent
(id='"+clientId+"') has an invalid value:'"+ attachTiming +
+ "'. It may have only the following values: 'immediate',
'onload', 'onJScall'");
+ }
+
+ if ( name == null ) {
+ throw new FacesException(
+ "The name attribute of the controlComponent
(id='"+clientId+"') might not be null" );
+
+ }
+
+ if ( "".equals(operation.trim()) || operation==null ) {
+ throw new FacesException(
+ "The operation attribute of the controlComponent
(id='"+clientId+"') must be specified" );
+ }
+
+
+ if ( "".equals(name.trim()) &&
"onJScall".equals(attachTiming) ) {
+ throw new FacesException(
+ "The name attribute of the controlComponent
(id='"+clientId+"') must be specified when timing attribute equals to
'onJScall'" );
+ }
+
+
+ }
+ protected String replaceClientIds(FacesContext context, UIComponent component, String
selector) {
+ return HtmlUtil.expandIdSelector(selector, component, context);
+ }
+
+
+
+
+
+}
Added:
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/README
===================================================================
Added:
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java
===================================================================
---
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java
(rev 0)
+++
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java 2007-11-09
03:04:24 UTC (rev 3845)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+
+package org.richfaces.sandbox.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIComponentControl extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE =
"org.richfaces.sandbox.ComponentControl";
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.sandbox.ComponentControl";
+
+}
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-11-09 02:06:22 UTC (rev 3844)
+++ trunk/sandbox/ui/pom.xml 2007-11-09 03:04:24 UTC (rev 3845)
@@ -20,5 +20,7 @@
<module>columns</module>
<module>rex-resizable</module>
<module>rex-messageBox</module>
+ <module>rex-button</module>
+ <module>componentControl</module>
</modules>
</project>
\ No newline at end of file
Property changes on: trunk/sandbox/ui/rex-button
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Modified: trunk/sandbox/ui/rex-messageBox/pom.xml
===================================================================
--- trunk/sandbox/ui/rex-messageBox/pom.xml 2007-11-09 02:06:22 UTC (rev 3844)
+++ trunk/sandbox/ui/rex-messageBox/pom.xml 2007-11-09 03:04:24 UTC (rev 3845)
@@ -5,10 +5,9 @@
<version>3.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>rex-messageBox</artifactId>
<name>rex-messageBox</name>
- <version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
Modified: trunk/sandbox/ui/rex-messageBox/src/main/templates/htmlMessageBox.jspx
===================================================================
--- trunk/sandbox/ui/rex-messageBox/src/main/templates/htmlMessageBox.jspx 2007-11-09
02:06:22 UTC (rev 3844)
+++ trunk/sandbox/ui/rex-messageBox/src/main/templates/htmlMessageBox.jspx 2007-11-09
03:04:24 UTC (rev 3845)
@@ -9,16 +9,29 @@
baseclass="org.ajax4jsf.renderkit.AjaxComponentRendererBase"
component="org.richfaces.sandbox.component.UIMessageBox"
+
+ <h:styles>extjs/ext-all.css,extjs/ext-css-patch.xcss</h:styles>
+ <h:scripts>extjs/ext-base.js,extjs/ext-all.js,/org/richfaces/renderkit/html/scripts/jquery/jquery.js</h:scripts>
+
+
<f:clientid var="clientId"/>
<script type="text/javascript">
-
+ Ext.MessageBox.show({
+ title: 'Address',
+ msg: 'Please enter your address:',
+ width:300,
+ buttons: Ext.MessageBox.OKCANCEL,
+ multiline: true,
+ fn: showResultText,
+ animEl: 'mb3'
+ });
</script>
- <!--
+
<div id="#{clientId}"
x:passThruWithExclusions="value,name,type,id"
</div>
- -->
+
</f:root>
\ No newline at end of file