[richfaces-svn-commits] JBoss Rich Faces SVN: r11733 - in trunk/test-applications/facelets/src/main: webapp/pics and 1 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri Dec 12 06:51:38 EST 2008
Author: adubovsky
Date: 2008-12-12 06:51:34 -0500 (Fri, 12 Dec 2008)
New Revision: 11733
Added:
trunk/test-applications/facelets/src/main/webapp/pics/1.gif
trunk/test-applications/facelets/src/main/webapp/pics/2.gif
trunk/test-applications/facelets/src/main/webapp/pics/3.gif
trunk/test-applications/facelets/src/main/webapp/pics/4.gif
Modified:
trunk/test-applications/facelets/src/main/java/tTree/TTree.java
trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml
Log:
+ some attributes to tTree
Modified: trunk/test-applications/facelets/src/main/java/tTree/TTree.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/TTree.java 2008-12-12 11:32:20 UTC (rev 11732)
+++ trunk/test-applications/facelets/src/main/java/tTree/TTree.java 2008-12-12 11:51:34 UTC (rev 11733)
@@ -6,6 +6,7 @@
import org.richfaces.component.UITree;
import org.richfaces.component.xml.XmlTreeDataBuilder;
import org.richfaces.event.NodeExpandedEvent;
+import org.richfaces.event.NodeSelectedEvent;
import org.richfaces.model.TreeNode;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -20,7 +21,13 @@
private boolean ajaxSubmitSelection = false;
private String anOpened = "null";
private String anSelected = "null";
+ private boolean rendered = true;
+ private boolean showConnectingLines = false;
+ private boolean toggleOnClick = false;
+ private boolean useCustomIcons = false;
+ private String reRenderCheck = "... waiting ...";
+
public TTree() {
try {
data = XmlTreeDataBuilder.build(new InputSource(getClass()
@@ -41,12 +48,30 @@
e.printStackTrace();
}
}
-
- public void add(){
+
+ public void addCustomIcons() {
+ if (useCustomIcons) {
+ tree.setIcon("/pics/1.gif");
+ tree.setIconCollapsed("/pics/3.gif");
+ tree.setIconExpanded("/pics/4.gif");
+ tree.setIconLeaf("/pics/2.gif");
+ } else {
+ tree.setIcon(null);
+ tree.setIconCollapsed(null);
+ tree.setIconExpanded(null);
+ tree.setIconLeaf(null);
+ }
+ }
+
+ public void add() {
ComponentInfo info = ComponentInfo.getInstance();
info.addField(tree);
}
+ public void resetReRenderCheck() {
+ reRenderCheck = "... waiting ...";
+ }
+
public Boolean adviseNodeOpened(UITree t) {
Boolean tAnOpened = null;
if (anOpened.equals("FALSE"))
@@ -63,14 +88,40 @@
tAnSelected = Boolean.FALSE;
else if (anSelected.equals("TRUE"))
tAnSelected = Boolean.TRUE;
-
+
return tAnSelected;
}
public void changeExpandListener(NodeExpandedEvent e) {
+ reRenderCheck = "!!! I am WORKing !!!";
System.out.println("!!! changeExpandListener !!!");
}
+ public void nodeSelectListener(NodeSelectedEvent e) {
+ reRenderCheck = "!!! I am WORKing !!!";
+ System.out.println("!!! nodeSelectListener !!!");
+ }
+
+ public String getReRenderCheck() {
+ return reRenderCheck;
+ }
+
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public boolean isAjaxSubmitSelection() {
+ return ajaxSubmitSelection;
+ }
+
+ public void setAjaxSubmitSelection(boolean ajaxSubmitSelection) {
+ this.ajaxSubmitSelection = ajaxSubmitSelection;
+ }
+
public String getSwitchType() {
return switchType;
}
@@ -95,22 +146,6 @@
this.tree = tree;
}
- public boolean isImmediate() {
- return immediate;
- }
-
- public void setImmediate(boolean immediate) {
- this.immediate = immediate;
- }
-
- public boolean isAjaxSubmitSelection() {
- return ajaxSubmitSelection;
- }
-
- public void setAjaxSubmitSelection(boolean ajaxSubmitSelection) {
- this.ajaxSubmitSelection = ajaxSubmitSelection;
- }
-
public String getAnOpened() {
return anOpened;
}
@@ -126,4 +161,36 @@
public void setAnSelected(String anSelected) {
this.anSelected = anSelected;
}
-}
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public boolean isShowConnectingLines() {
+ return showConnectingLines;
+ }
+
+ public void setShowConnectingLines(boolean showConnectingLines) {
+ this.showConnectingLines = showConnectingLines;
+ }
+
+ public boolean isToggleOnClick() {
+ return toggleOnClick;
+ }
+
+ public void setToggleOnClick(boolean toggleOnClick) {
+ this.toggleOnClick = toggleOnClick;
+ }
+
+ public boolean isUseCustomIcons() {
+ return useCustomIcons;
+ }
+
+ public void setUseCustomIcons(boolean useCustomIcons) {
+ this.useCustomIcons = useCustomIcons;
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/webapp/pics/1.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/facelets/src/main/webapp/pics/1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/facelets/src/main/webapp/pics/2.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/facelets/src/main/webapp/pics/2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/facelets/src/main/webapp/pics/3.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/facelets/src/main/webapp/pics/3.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/facelets/src/main/webapp/pics/4.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/facelets/src/main/webapp/pics/4.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml 2008-12-12 11:32:20 UTC (rev 11732)
+++ trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml 2008-12-12 11:51:34 UTC (rev 11733)
@@ -34,7 +34,11 @@
<rich:tree id="dTree" switchType="#{tTree.switchType}"
value="#{tTree.data}" var="defTree" binding="#{tTree.tree}"
ajaxSubmitSelection="#{tTree.ajaxSubmitSelection}"
- immediate="#{tTree.immediate}"
+ immediate="#{tTree.immediate}" rendered="#{tTree.rendered}"
+ reRender="reRenderID"
+ showConnectingLines="#{tTree.showConnectingLines}" focus="focusID"
+ nodeSelectListener="#{tTree.nodeSelectListener}"
+ toggleOnClick="#{tTree.toggleOnClick}"
changeExpandListener="#{tTree.changeExpandListener}"
adviseNodeOpened="#{tTree.adviseNodeOpened}"
adviseNodeSelected="#{tTree.adviseNodeSelected}"
@@ -62,11 +66,19 @@
</rich:treeNode>
</rich:tree>
<hr />
- <h:commandButton action="#{tTree.add}" value="add test" />
+ <h:commandButton id="focusID" action="#{tTree.add}" value="add test" />
<h:panelGrid columns="2">
<f:facet name="header">
<h:outputText value="Tree Properties" />
</f:facet>
+
+ <h:outputText value="reRender:" />
+ <h:panelGroup>
+ <a4j:commandButton value="reset"
+ action="#{tTree.resetReRenderCheck}" reRender="reRenderID"></a4j:commandButton>
+ <h:outputText id="reRenderID" value="#{tTree.reRenderCheck}" />
+ </h:panelGroup>
+
<h:outputText value="Change tree switchType:" />
<h:selectOneRadio value="#{tTree.switchType}" onclick="submit();">
<f:selectItem itemLabel="client" itemValue="client" />
@@ -74,6 +86,18 @@
<f:selectItem itemLabel="ajax" itemValue="ajax" />
</h:selectOneRadio>
+ <h:outputText value="rendered:" />
+ <h:selectBooleanCheckbox value="#{tTree.rendered}"
+ onchange="submit();" />
+
+ <h:outputText value="showConnectingLines:" />
+ <h:selectBooleanCheckbox value="#{tTree.showConnectingLines}"
+ onchange="submit();" />
+
+ <h:outputText value="toggleOnClick:" />
+ <h:selectBooleanCheckbox value="#{tTree.toggleOnClick}"
+ onchange="submit();" />
+
<h:outputText value="ajaxSubmitSelection:" />
<h:selectBooleanCheckbox value="#{tTree.ajaxSubmitSelection}"
onchange="submit();" />
@@ -82,6 +106,12 @@
<h:selectBooleanCheckbox value="#{tTree.immediate}"
onchange="submit();" />
+ <h:outputText value="use custom icons:" />
+ <h:selectBooleanCheckbox value="#{tTree.useCustomIcons}">
+ <a4j:support action="#{tTree.addCustomIcons}" event="onchange"
+ reRender="dTreePanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+
<h:outputText value="adviseNodeOpened:" />
<h:selectOneRadio value="#{tTree.anOpened}" onclick="submit();">
<f:selectItem itemLabel="null (default)" itemValue="null" />
More information about the richfaces-svn-commits
mailing list