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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Sat Apr 25 11:08:12 EDT 2009


Author: ilya_shaikovsky
Date: 2009-04-25 11:08:12 -0400 (Sat, 25 Apr 2009)
New Revision: 13872

Added:
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tab/
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tab/TabsBean.java
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/examples/tabRemove.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/tabRemove.xhtml
Modified:
   trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
   trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml
Log:
tabs removing sample added

Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tab/TabsBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tab/TabsBean.java	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tab/TabsBean.java	2009-04-25 15:08:12 UTC (rev 13872)
@@ -0,0 +1,43 @@
+package org.richfaces.demo.tab;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+public class TabsBean {
+
+	private boolean[] tabRendered = { true, true, true };
+	private boolean tabsRendered = true;
+
+
+	public boolean[] getTabRendered() {
+		return tabRendered;
+	}
+
+	public void setTabRendered(boolean[] tabRendered) {
+		this.tabRendered = tabRendered;
+	}
+
+	public boolean isTabsRendered() {
+		return tabsRendered;
+	}
+
+	public void setTabsRendered(boolean tabsRendered) {
+		this.tabsRendered = tabsRendered;
+	}
+
+	public void deleteTab(ActionEvent event) {
+		int tabIndex = Integer.parseInt(FacesContext.getCurrentInstance()
+				.getExternalContext().getRequestParameterMap().get("tab"));
+		tabRendered[tabIndex] = false;
+		for (int i = 0; i < tabRendered.length; i++) {
+			tabsRendered = tabsRendered||tabRendered[i];
+		}
+	}
+	
+	public void resetTabs() {
+		for (int i = 0; i < tabRendered.length; i++) {
+			tabRendered[i]=true;
+		}
+	}
+
+}

Modified: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties	2009-04-25 15:03:59 UTC (rev 13871)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties	2009-04-25 15:08:12 UTC (rev 13872)
@@ -3,7 +3,7 @@
 panel=              richOutputs,          Panel,                /images/ico_panel.gif,                  /images/cn_panel.gif,                    panel.html,                                              jbossrichfaces/freezone/docs/tlddoc/rich/panel.html,              jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIPanel.html,                      /richfaces/panel.jsf
 separator=          richOutputs,          Separator,            /images/ico_separator.gif,              /images/cn_separator.gif,                separator.html,                                          jbossrichfaces/freezone/docs/tlddoc/rich/separator.html,          jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UISeparator.html,                  /richfaces/separator.jsf
 spacer=             richOutputs,          Spacer,               /images/ico_spacer.gif,                 /images/cn_spacer.gif,                   spacer.html,                                             jbossrichfaces/freezone/docs/tlddoc/rich/spacer.html,             jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UISpacer.html,                     /richfaces/spacer.jsf
-tabPanel=           richOutputs,          Tab Panel,            /images/ico_tabpanel.gif,               /images/cn_tabpanel.gif,                 tabPanel.html,                                           jbossrichfaces/freezone/docs/tlddoc/rich/tabPanel.html,           jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UITabPanel.html,                   /richfaces/tabPanel.jsf
+tabPanel=           richOutputs,          Tab Panel,            /images/ico_tabpanel.gif,               /images/cn_tabpanel.gif,                 tabPanel.html,                                           jbossrichfaces/freezone/docs/tlddoc/rich/tabPanel.html,           jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UITabPanel.html,                   /richfaces/tabPanel.jsf, new
 inputNumberSlider=  richInputs,           Input Number Slider,  /images/ico_DataFilterSlider.gif,                 /images/cn_slider.gif,                   inputNumberSlider.html,                                  jbossrichfaces/freezone/docs/tlddoc/rich/inputNumberSlider.html,  jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInputNumberSlider.html,          /richfaces/inputNumberSlider.jsf
 inputNumberSpinner= richInputs,           Input Number Spinner, /images/ico_spinner.gif,                /images/cn_spinner.gif,                  inputNumberSpinner.html,                                 jbossrichfaces/freezone/docs/tlddoc/rich/inputNumberSpinner.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInputNumberSpinner.html,         /richfaces/inputNumberSpinner.jsf
 dataFilterSlider=   richDataIterators,    Data Filter Slider,   /images/ico_DataFilterSlider.gif,       /images/cn_DataFilterSlider.gif,         dataFilterSlider.html,                                   jbossrichfaces/freezone/docs/tlddoc/rich/dataFilterSlider.html,   jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataFltrSlider.html,             /richfaces/dataFilterSlider.jsf

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	2009-04-25 15:03:59 UTC (rev 13871)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml	2009-04-25 15:08:12 UTC (rev 13872)
@@ -29,6 +29,11 @@
 		</managed-property>
 	</managed-bean> 
  <managed-bean>
+  <managed-bean-name>tabsBean</managed-bean-name>
+  <managed-bean-class>org.richfaces.demo.tab.TabsBean</managed-bean-class>
+  <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
   <managed-bean-name>loginbean</managed-bean-name>
   <managed-bean-class>org.richfaces.demo.stateApi.Bean</managed-bean-class>
   <managed-bean-scope>request</managed-bean-scope>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/examples/tabRemove.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/examples/tabRemove.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/examples/tabRemove.xhtml	2009-04-25 15:08:12 UTC (rev 13872)
@@ -0,0 +1,73 @@
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+      xmlns:rich="http://richfaces.org/rich">
+	<h:form id="form">
+	<a4j:outputPanel id="tabsWrapper" layout="block">
+	<rich:tabPanel rendered="#{tabsBean.tabsRendered}" id="tabPanel" switchType="ajax">
+		<rich:tab rendered="#{tabsBean.tabRendered[0]}">
+			<f:facet name="label">
+				<h:panelGroup>
+					<h:outputText value="Ajax with RichFaces" />
+					<h:graphicImage value="/images/modal/close.png" id="hidelink1" styleClass="hidelink" onclick="deleteTab('1');Event.stop(event);"/>
+				</h:panelGroup>
+			</f:facet>
+			<p>
+				The framework is implemented using a component library. 
+				The library set Ajax functionality into existing pages, so 
+				there is no need to write any JavaScript code or to replace 
+				existing components with new Ajax one. Ajax4jsf enables page-wide 
+				Ajax support instead of the traditional component-wide support and 
+				it gives the opportunity to define the event on the page. An event 
+				invokes an Ajax request and areas of the page which are synchronized
+				 with the JSF Component Tree after changing the data on the server 
+				 by Ajax request in accordance with events fired on the client.			
+			</p>
+		</rich:tab>
+		<rich:tab rendered="#{tabsBean.tabRendered[1]}">
+			<f:facet name="label">
+				<h:panelGroup>
+					<h:outputText value="RichFaces CDK" />
+					<h:graphicImage value="/images/modal/close.png" id="hidelink2" styleClass="hidelink" onclick="deleteTab('2');Event.stop(event);"/>
+				</h:panelGroup>
+			</f:facet>
+			<p>
+				 Component Development Kit (CDK) is a design-time extension for 
+				 Ajax4jsf. The CDK includes a code-generation facility and a 
+				 templating facility using a JSP-like syntax. These capabilities 
+				 help to avoid a routine process of a component creation. The 
+				 component factory works like a well-oiled machine allowing the 
+				 creation of first-class rich components with built-in Ajax 
+				 functionality even more easily than the creation of simpler 
+				 components by means of the traditional coding approach.
+			</p>
+		</rich:tab>
+		<rich:tab rendered="#{tabsBean.tabRendered[2]}">
+			<f:facet name="label">
+				<h:panelGroup>
+					<h:outputText value="RichFaces Skinability" />
+					<h:graphicImage value="/images/modal/close.png" id="hidelink3" styleClass="hidelink" onclick="deleteTab('3');Event.stop(event);"/>
+				</h:panelGroup>
+			</f:facet>
+			<p>
+				Ajax4jsf provides a skinnability feature that allows easily define 
+				and manage different color schemes and other parameters of the UI 
+				with the help of named skin parameters. Hence it is possible to 
+				access the skin parameters from JSP code and the Java code (e.g. to 
+				adjust generated on-the-fly images based on the text parts of the 
+				UI). Note: skinnability is not an equivalent of traditional CSS, 
+				but a complement.
+			</p>
+		</rich:tab>
+	</rich:tabPanel>
+	</a4j:outputPanel>
+	<a4j:jsFunction id="deleteFunc" reRender="tabsWrapper" name="deleteTab">
+		<a4j:actionparam name="tab" actionListener="#{tabsBean.deleteTab}"/>
+	</a4j:jsFunction>
+	<a4j:commandButton action="#{tabsBean.resetTabs}" value="Reset Tabs" reRender="tabsWrapper"/>
+	</h:form>
+	<a4j:log popup="false"/>
+	<rich:messages></rich:messages>
+</ui:composition>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/tabRemove.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/tabRemove.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel/tabRemove.xhtml	2009-04-25 15:08:12 UTC (rev 13872)
@@ -0,0 +1,22 @@
+<!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/component-sample.xhtml">
+		<ui:define name="sample">
+			<p>
+				description
+			</p>
+
+			<div class="sample-container">
+				<ui:include src="/richfaces/tabPanel/examples/tabRemove.xhtml"/>
+				<ui:include src="/templates/include/sourceview.xhtml">
+					<ui:param name="sourcepath" value="/richfaces/tabPanel/examples/tabRemove.xhtml"/>
+				</ui:include>	
+			</div>
+		</ui:define>
+
+	</ui:composition>
+</html>

Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml	2009-04-25 15:03:59 UTC (rev 13871)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml	2009-04-25 15:08:12 UTC (rev 13872)
@@ -16,6 +16,9 @@
 			<rich:tab name="look" label="Look Customization">
 				<ui:include src="/richfaces/tabPanel/look-customization.xhtml" />
 			</rich:tab>
+			<rich:tab name="delete" label="Tabs Deletion">
+				<ui:include src="/richfaces/tabPanel/tabRemove.xhtml" />
+			</rich:tab>
 			<rich:tab name="info" label="Tag Information">
 				<rich:insert
 					src="/WEB-INF/#{componentNavigator.currentComponent.tagInfoLocation}"




More information about the richfaces-svn-commits mailing list