[richfaces-svn-commits] JBoss Rich Faces SVN: r11492 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo/editor and 6 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Dec 2 11:20:19 EST 2008


Author: ilya_shaikovsky
Date: 2008-12-02 11:20:19 -0500 (Tue, 02 Dec 2008)
New Revision: 11492

Added:
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java
   trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/
   trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties
   trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties
Modified:
   trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
Log:


Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java	2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1,61 @@
+package org.richfaces.demo.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class EditorBean {
+
+	private String currentConfiguration = CONFIGS_PACKAGE + "simple";
+	private String viewMode = "visual";
+	private String value;
+	private boolean liveUpdatesEnabled=false;
+	
+	private static final String CONFIGS_PACKAGE = "/org/richfaces/demo/editor/";
+	List<SelectItem> configurations = new ArrayList<SelectItem>();
+	
+	public EditorBean() {
+		configurations.add(new SelectItem(CONFIGS_PACKAGE + "simple", "Simple"));
+		configurations.add(new SelectItem(CONFIGS_PACKAGE + "advanced", "Advanced"));
+	}
+	
+	public String getCurrentConfiguration() {
+		return currentConfiguration;
+	}
+
+	public void setCurrentConfiguration(String currentConfiguration) {
+		this.currentConfiguration = currentConfiguration;
+	}
+
+	public List<SelectItem> getConfigurations() {
+		return configurations;
+	}
+
+	public String getViewMode() {
+		return viewMode;
+	}
+
+	public void setViewMode(String viewMode) {
+		this.viewMode = viewMode;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	public boolean isLiveUpdatesEnabled() {
+		return liveUpdatesEnabled;
+	}
+
+	public void setLiveUpdatesEnabled(boolean liveUpdatesEnabled) {
+		this.liveUpdatesEnabled = liveUpdatesEnabled;
+	}
+	
+	
+	
+}

Added: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties	2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1,5 @@
+theme="advanced"
+theme_advanced_toolbar_location="top"
+theme_advanced_toolbar_align="center"
+plugins="preview,insertdatetime"
+theme_advanced_buttons3="hr,removeformat,visualaid,separator,sub,sup,separator,charmap"

Added: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties	2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1 @@
+theme="simple"

Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml	2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml	2008-12-02 16:20:19 UTC (rev 11492)
@@ -403,6 +403,16 @@
   <managed-bean-class>org.richfaces.demo.extendedDataTable.ExtendedTableBean</managed-bean-class>
   <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>
+ <managed-bean>
+  <managed-bean-name>queueBean</managed-bean-name>
+  <managed-bean-class>org.richfaces.demo.queue.QueueBean</managed-bean-class>
+  <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+  <managed-bean-name>editorBean</managed-bean-name>
+  <managed-bean-class>org.richfaces.demo.editor.EditorBean</managed-bean-class>
+  <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
  <navigation-rule>
   <from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
   <navigation-case>

Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml	2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml	2008-12-02 16:20:19 UTC (rev 11492)
@@ -13,10 +13,14 @@
 		} 
 	</style>
 	<h:form>
-
+		<script type="text/javascript">
+			function custom(){
+				alert(1);
+			}
+		</script>
 		<h:panelGrid id="panel" columns="2" columnClasses="ecol1, ecol2">
 			<a4j:outputPanel id="calendar" layout="block">
-					<rich:calendar value="#{calendarBean.selectedDate}"
+					<rich:calendar value="#{calendarBean.selectedDate}" oncollapse="custom()"
 						locale="#{calendarBean.locale}"
 						popup="#{calendarBean.popup}"
 						datePattern="#{calendarBean.pattern}"

Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml	2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml	2008-12-02 16:20:19 UTC (rev 11492)
@@ -4,9 +4,44 @@
       xmlns:f="http://java.sun.com/jsf/core"
 	  xmlns:a4j="http://richfaces.org/a4j"
 	  xmlns:rich="http://richfaces.org/rich">
+		<style>
+			.column{
+				width:50%;
+				vertical-align:top;
+			}
+		</style>
 		<h:form>
-			<rich:editor>
+			<a4j:jsFunction name="submit" reRender="result"/>
+			<h:panelGrid columns="2" width="100%" columnClasses="column,column">
+			<rich:editor configuration="#{editorBean.currentConfiguration}" id="editor" width="400" viewMode = "#{editorBean.viewMode}" value="#{editorBean.value}" onchange="submit">
+			</rich:editor>
 			
-			</rich:editor>
+			<rich:panel>
+				<f:facet name="header">
+					<h:outputText value="Editor Settings"/>
+				</f:facet>
+				<h:panelGrid columns="2">
+					<h:outputText value="Select Editor Theme"/>
+					<h:selectOneRadio value="#{editorBean.currentConfiguration}" layout="pageDirection">
+						<f:selectItems value="#{editorBean.configurations}"/>
+						<a4j:support event="onchange" reRender="editor" />
+					</h:selectOneRadio>
+					<h:outputText value="Toggle Modes"/>
+					<h:selectOneRadio value="#{editorBean.viewMode}" layout="pageDirection">
+						<f:selectItem itemLabel="WYSIWYG mode" itemValue="visual"/>
+						<f:selectItem itemLabel="Simple Text Area" itemValue="source"/>
+						<a4j:support event="onchange" reRender="editor" />
+					</h:selectOneRadio>
+				</h:panelGrid>
+			</rich:panel>
+			</h:panelGrid>
+			
+			<rich:panel id="result">
+				<f:facet name="header">
+					<h:outputText value="Preview"/>
+				</f:facet>
+				<h:outputText escape="false" value="#{editorBean.value}"/>
+			</rich:panel>
+			
 		</h:form>
 	</ui:composition>

Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml	2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml	2008-12-02 16:20:19 UTC (rev 11492)
@@ -4,7 +4,21 @@
       xmlns:f="http://java.sun.com/jsf/core"
 	  xmlns:a4j="http://richfaces.org/a4j"
 	  xmlns:rich="http://richfaces.org/rich">
+	<style>
+		.link{
+			width:40px;
+			height:40px;
+		}
+	</style>
 		<h:form>
-			QUEUE SAMPLE
+			<rich:dataGrid value="#{queueBean.buttons}" var="button" columns="4">
+				<rich:paint2D cacheable="false" paint="#{queueBean.paint}" data="#{button.color}">
+				</rich:paint2D>
+				<ui:remove>
+				<h:panelGroup layout="block" style="background-color: #{button.color}" styleClass="link">
+					<h:outputText value="#{button.name}"/>
+				</h:panelGroup>
+				</ui:remove>
+			</rich:dataGrid>
 		</h:form>
 	</ui:composition>




More information about the richfaces-svn-commits mailing list