JBoss Rich Faces SVN: r19787 - in sandbox/trunk/ui/tree-actual/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-29 12:18:11 -0400 (Fri, 29 Oct 2010)
New Revision: 19787
Added:
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/package-info.java
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
Log:
https://jira.jboss.org/browse/RF-9315
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/package-info.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/package-info.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/package-info.java 2010-10-29 16:18:11 UTC (rev 19787)
@@ -0,0 +1,5 @@
+/**
+ * Implementation of RichFaces iteration components
+ */
+(a)org.richfaces.cdk.annotations.TagLibrary(uri="http://richfaces.org/tree", shortName="tree")
+package org.richfaces;
\ No newline at end of file
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-10-29 16:18:11 UTC (rev 19787)
@@ -0,0 +1,213 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+(function($, richfaces) {
+
+ var __initializeChildNodes = function(elt) {
+ var _this = this;
+ $(elt).children(".tree_node").each(function() {
+ _this.addChild(new richfaces.ui.TreeNode(this));
+ });
+ }
+
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.TreeNode = richfaces.BaseComponent.extendClass({
+
+ name: "TreeNode",
+
+ init: function (id) {
+ this.id = id;
+
+ this.__children = new Array();
+
+ this.elt = $(this.attachToDom());
+
+ this.handler = this.elt.find(" > .tree_item:first > .tree_handle:first");
+ this.handler.click($.proxy(this.toggle, this));
+
+ __initializeChildNodes.call(this, this.elt[0]);
+ },
+
+ getParent: function() {
+ return this.__parent;
+ },
+
+ setParent: function(newParent) {
+ this.__parent = newParent;
+ },
+
+ addChild: function(child, idx) {
+ var start;
+ if (typeof idx != 'undefined') {
+ start = idx;
+ } else {
+ start = this.__children.length;
+ }
+
+ this.__children.splice(start, 0, child);
+ child.setParent(this);
+ },
+
+ removeChild: function(child) {
+ if (this.__children.length) {
+ var idx = this.__children.indexOf(child);
+ if (idx != -1) {
+ var removedChildren = this.__children.splice(idx, 1);
+ if (removedChildren) {
+ for (var i = 0; i < removedChildren.length; i++) {
+ removedChildren[i].setParent(undefined);
+ }
+ }
+ }
+ }
+ },
+
+ clearChildren: function() {
+ for (var i = 0; i < this.__children.length; i++) {
+ this.__children[i].setParent(undefined);
+ }
+
+ this.__children = new Array();
+ },
+
+ isExpanded: function() {
+ return !this.isLeaf() && !this.isCollapsed();
+ },
+
+ isCollapsed: function() {
+ return !this.isLeaf() && this.elt.hasClass("tree_collapse");
+ },
+
+ isLeaf: function() {
+ return this.handler.hasClass("tree_handle_leaf");
+ },
+
+ toggle: function() {
+ if (this.isLeaf()) {
+ return;
+ }
+
+ if (this.isCollapsed()) {
+ this.expand();
+ } else {
+ this.collapse();
+ }
+ },
+
+ collapse: function() {
+ if (!this.isLeaf()) {
+ var tree = this.getTree();
+
+ switch (tree.getToggleMode()) {
+ case 'client':
+ this.elt.addClass("tree_collapse");
+ this.handler.addClass("tree_handle_collapsed").removeClass("tree_handle_expanded");
+ break;
+
+ case 'ajax':
+ tree.toggleByAjax(null, richfaces.getDomElement(this.id).id, false);
+ break;
+
+ case 'server':
+
+ break;
+ }
+
+ }
+ },
+
+ expand: function() {
+ if (!this.isLeaf()) {
+ var tree = this.getTree();
+
+ switch (tree.getToggleMode()) {
+ case 'client':
+ this.elt.removeClass("tree_collapse");
+ this.handler.removeClass("tree_handle_collapsed").addClass("tree_handle_expanded");
+ break;
+
+ case 'ajax':
+ tree.toggleByAjax(null, richfaces.getDomElement(this.id).id, true);
+ break;
+
+ case 'server':
+
+ break;
+ }
+ }
+ },
+
+ getTree: function() {
+ var component = this;
+ while (component && component.name != "Tree") {
+ component = component.getParent();
+ }
+ return component;
+ },
+
+ destroy: function() {
+ if (this.parent) {
+ this.parent.removeChild(this);
+ }
+
+ this.clearChildren();
+
+ this.elt = null;
+ this.handler = null;
+ }
+ });
+
+ richfaces.ui.Tree = richfaces.ui.TreeNode.extendClass({
+
+ name: "Tree",
+
+ init: function (id, options) {
+ this.$super.init.call(this, id, options);
+
+ this.__toggleMode = options.toggleMode || 'ajax';
+ this.__selectionMode = options.selectionMode || 'ajax';
+
+ if (options.ajaxToggler) {
+ this.__ajaxToggler = new Function("event", "nodeId", "newState", options.ajaxToggler);
+ }
+ },
+
+ destroy: function() {
+ this.$super.destroy();
+
+ this.__ajaxToggler = null;
+ },
+
+ toggleByAjax: function(event, nodeId, newState) {
+ this.__ajaxToggler(event, nodeId, newState);
+ },
+
+ getToggleMode: function() {
+ return this.__toggleMode;
+ },
+
+ getSelectionMode: function() {
+ return this.__selectionMode;
+ }
+ });
+
+}(jQuery, RichFaces));
\ No newline at end of file
14 years, 2 months
JBoss Rich Faces SVN: r19786 - in sandbox/trunk/ui/tree-actual: api and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-29 12:17:06 -0400 (Fri, 29 Oct 2010)
New Revision: 19786
Added:
sandbox/trunk/ui/tree-actual/api/
sandbox/trunk/ui/tree-actual/api/pom.xml
sandbox/trunk/ui/tree-actual/api/src/
sandbox/trunk/ui/tree-actual/api/src/main/
sandbox/trunk/ui/tree-actual/api/src/main/java/
Log:
https://jira.jboss.org/browse/RF-9315
Added: sandbox/trunk/ui/tree-actual/api/pom.xml
===================================================================
--- sandbox/trunk/ui/tree-actual/api/pom.xml (rev 0)
+++ sandbox/trunk/ui/tree-actual/api/pom.xml 2010-10-29 16:17:06 UTC (rev 19786)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui.iteration</groupId>
+ <artifactId>tree-api</artifactId>
+ <name>Richfaces UI Components: Tree API</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.common</groupId>
+ <artifactId>richfaces-ui-common-api</artifactId>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/iteration/datas...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/iteration/datascro...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+
+</project>
\ No newline at end of file
14 years, 2 months
JBoss Rich Faces SVN: r19785 - management/design-4x/panel_menu.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2010-10-29 12:03:28 -0400 (Fri, 29 Oct 2010)
New Revision: 19785
Modified:
management/design-4x/panel_menu/panel_menu.html
Log:
Modified: management/design-4x/panel_menu/panel_menu.html
===================================================================
--- management/design-4x/panel_menu/panel_menu.html 2010-10-29 16:00:55 UTC (rev 19784)
+++ management/design-4x/panel_menu/panel_menu.html 2010-10-29 16:03:28 UTC (rev 19785)
@@ -2,19 +2,19 @@
<html>
<head>
-<title>coll_panel</title>
+<title>coll-panel</title>
<style>
-.rf_pm_size{
+.rf-pm-size{
width : 300px;
}
-.rf_pm_lbl{
+.rf-pm-lbl{
border : 1px solid #BED6F8; /*panelBorderColor*/
margin-bottom : 3px
}
-.rf_pm_itm{
+.rf-pm-itm{
color : #000000; /*headerTextColor*/
padding : 2px 1px 2px 2px;
cursor : pointer;
@@ -26,7 +26,7 @@
//white-space : normal;
}
-.rf_pm_1{
+.rf-pm-1{
background-image : url(pmenu_bg.gif); /*from headerGradientColor to headerBackgroundColor*/
background-position : top left;
background-repeat : repeat-x;
@@ -35,43 +35,43 @@
font-weight : bold;
}
-.rf_pm_2 .rf_pm_ico_lft{
+.rf-pm-2 .rf-pm-ico-lft{
margin-left : 20px;
}
-.rf_pm_3 .rf_pm_ico_lft{
+.rf-pm-3 .rf-pm-ico-lft{
margin-left : 40px;
}
-.rf_pm_4 .rf_pm_ico_lft{
+.rf-pm-4 .rf-pm-ico-lft{
margin-left : 50px;
}
-.rf_pm_5 .rf_pm_ico_lft{
+.rf-pm-5 .rf-pm-ico-lft{
margin-left : 80px;
}
-.rf_pm_6 .rf_pm_ico_lft{
+.rf-pm-6 .rf-pm-ico-lft{
margin-left : 100px;
}
-.rf_pm_grp{
+.rf-pm-grp{
font-weight : regular;
font-size : 11px; /*generalSizeFont*/
font-family : verdana; /*generalFamilyFont*/
}
-.rf_pm_ico_lft{
+.rf-pm-ico-lft{
float : left;
}
-.rf_pm_ico_rgt{
+.rf-pm-ico-rgt{
float : right;
}
-.rf_pm_icon{
+.rf-pm-icon{
width : 16px;
height : 16px;
display : inline-block;
@@ -79,29 +79,29 @@
margin : 0px 3px;
}
-.rf_pm_dis{
+.rf-pm-dis{
color : #BED6F8; /*panelBorderColor*/
}
-.rf_pm_sel{
+.rf-pm-sel{
background : #C7D7EC; /*additionalBackgroundColor*/
border-top : 1px solid #FFFFFF; /*panelBorderColor*/
}
-.rf_pm_gr_sel{
+.rf-pm-gr-sel{
background-image : url(pmenu_bg.gif); /*from additionalBackgroundColor to headerGradientColor*/
border-top : 1px solid #FFFFFF; /*panelBorderColor*/
}
-.rf_pm_vis{
+.rf-pm-vis{
display : block;
}
-.rf_pm_hid{
+.rf-pm-hid{
display : none;
}
-.rf_pm_txt{
+.rf-pm-txt{
display : inline-block;
padding : 2px 0px 3px 0px;
margin : 0px 50px 0px 0px;
@@ -119,28 +119,28 @@
<body>
-<div class="rf_pm_size">
+<div class="rf-pm-size">
- <div class="rf_pm_lbl">
+ <div class="rf-pm-lbl">
<div id="1">
- <div class="rf_pm_itm rf_pm_1">
- <span class="rf_pm_ico_lft rf_pm_icon"></span>
- <span class="rf_pm_ico_rgt rf_pm_icon"></span>
- <span class="rf_pm_txt">
+ <div class="rf-pm-itm rf-pm-1">
+ <span class="rf-pm-ico-lft rf-pm-icon"></span>
+ <span class="rf-pm-ico-rgt rf-pm-icon"></span>
+ <span class="rf-pm-txt">
Display item name 1
</span>
<br clear="all">
</div>
- <div class="rf_pm_2 rf_pm_vis">
+ <div class="rf-pm-2 rf-pm-vis">
<div id="1.1">
- <div class="rf_pm_itm">
- <span class="rf_pm_ico_lft rf_pm_icon"></span>
- <span class="rf_pm_ico_rgt rf_pm_icon"></span>
- <span class="rf_pm_txt">
+ <div class="rf-pm-itm">
+ <span class="rf-pm-ico-lft rf-pm-icon"></span>
+ <span class="rf-pm-ico-rgt rf-pm-icon"></span>
+ <span class="rf-pm-txt">
Display item 1.1
</span>
<br clear="all">
@@ -148,22 +148,22 @@
</div>
<div id="1.2">
- <div class="rf_pm_itm">
- <span class="rf_pm_ico_lft rf_pm_icon"></span>
- <span class="rf_pm_ico_rgt rf_pm_icon"></span>
- <span class="rf_pm_txt">
+ <div class="rf-pm-itm">
+ <span class="rf-pm-ico-lft rf-pm-icon"></span>
+ <span class="rf-pm-ico-rgt rf-pm-icon"></span>
+ <span class="rf-pm-txt">
Display item name 1.2
</span>
<br clear="all">
</div>
- <div class="rf_pm_3 rf_pm_vis ">
+ <div class="rf-pm-3 rf-pm-vis ">
<div id="1.2.1">
- <div class="rf_pm_itm">
- <span class="rf_pm_ico_lft rf_pm_icon"></span>
- <span class="rf_pm_ico_rgt rf_pm_icon"></span>
- <span class="rf_pm_txt">
+ <div class="rf-pm-itm">
+ <span class="rf-pm-ico-lft rf-pm-icon"></span>
+ <span class="rf-pm-ico-rgt rf-pm-icon"></span>
+ <span class="rf-pm-txt">
Display item name 1.2.1
</span>
<br clear="all">
@@ -171,10 +171,10 @@
</div>
<div id="1.2.2">
- <div class="rf_pm_itm rf_pm_sel">
- <span class="rf_pm_ico_lft rf_pm_icon"></span>
- <span class="rf_pm_ico_rgt rf_pm_icon"></span>
- <span class="rf_pm_txt">
+ <div class="rf-pm-itm rf-pm-sel">
+ <span class="rf-pm-ico-lft rf-pm-icon"></span>
+ <span class="rf-pm-ico-rgt rf-pm-icon"></span>
+ <span class="rf-pm-txt">
Display item name 1.2.2
</span>
<br clear="all">
@@ -185,10 +185,10 @@
</div>
<div id="1.3">
- <div class="rf_pm_itm rf_pm_dis">
- <span class="rf_pm_ico_lft rf_pm_icon"></span>
- <span class="rf_pm_ico_rgt rf_pm_icon"></span>
- <span class="rf_pm_txt">
+ <div class="rf-pm-itm rf-pm-dis">
+ <span class="rf-pm-ico-lft rf-pm-icon"></span>
+ <span class="rf-pm-ico-rgt rf-pm-icon"></span>
+ <span class="rf-pm-txt">
Display item name 1.3
</span>
<br clear="all">
@@ -196,10 +196,10 @@
</div>
<div id="1.4">
- <div class="rf_pm_itm rf_pm_dis">
- <span class="rf_pm_ico_lft rf_pm_icon"></span>
- <span class="rf_pm_ico_rgt rf_pm_icon"></span>
- <span class="rf_pm_txt">
+ <div class="rf-pm-itm rf-pm-dis">
+ <span class="rf-pm-ico-lft rf-pm-icon"></span>
+ <span class="rf-pm-ico-rgt rf-pm-icon"></span>
+ <span class="rf-pm-txt">
Display item name 1.4
</span>
<br clear="all">
14 years, 2 months
JBoss Rich Faces SVN: r19784 - management/design-4x/panel_menu.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2010-10-29 12:00:55 -0400 (Fri, 29 Oct 2010)
New Revision: 19784
Modified:
management/design-4x/panel_menu/panel_menu.html
Log:
Modified: management/design-4x/panel_menu/panel_menu.html
===================================================================
--- management/design-4x/panel_menu/panel_menu.html 2010-10-29 15:57:44 UTC (rev 19783)
+++ management/design-4x/panel_menu/panel_menu.html 2010-10-29 16:00:55 UTC (rev 19784)
@@ -8,14 +8,7 @@
width : 300px;
}
-.rf_pm_txt{
- display : inline-block;
- padding : 2px 3px 3px 3px;
- font-size : 11px; /*generalSizeFont*/
- font-family : verdana; /*generalFamilyFont*/
-}
-
.rf_pm_lbl{
border : 1px solid #BED6F8; /*panelBorderColor*/
margin-bottom : 3px
@@ -29,6 +22,8 @@
padding-top : 2px;
margin-top : 1px;
cursor : pointer;
+ white-space : nowrap;
+ //white-space : normal;
}
.rf_pm_1{
@@ -76,6 +71,14 @@
float : right;
}
+.rf_pm_icon{
+ width : 16px;
+ height : 16px;
+ display : inline-block;
+ background : url(icon.gif) center center no-repeat;
+ margin : 0px 3px;
+}
+
.rf_pm_dis{
color : #BED6F8; /*panelBorderColor*/
}
@@ -85,6 +88,11 @@
border-top : 1px solid #FFFFFF; /*panelBorderColor*/
}
+.rf_pm_gr_sel{
+ background-image : url(pmenu_bg.gif); /*from additionalBackgroundColor to headerGradientColor*/
+ border-top : 1px solid #FFFFFF; /*panelBorderColor*/
+}
+
.rf_pm_vis{
display : block;
}
@@ -93,7 +101,17 @@
display : none;
}
+.rf_pm_txt{
+ display : inline-block;
+ padding : 2px 0px 3px 0px;
+ margin : 0px 50px 0px 0px;
+ //margin : 0px 0px 0px 0px;
+ font-size : 11px; /*generalSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ white-space: normal !important;
+}
+
</style>
</head>
@@ -104,188 +122,94 @@
<div class="rf_pm_size">
<div class="rf_pm_lbl">
- <div class="rf_pm_itm rf_pm_1">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
+
+ <div id="1">
- <div class="rf_pm_2 rf_pm_vis">
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
+ <div class="rf_pm_itm rf_pm_1">
+ <span class="rf_pm_ico_lft rf_pm_icon"></span>
+ <span class="rf_pm_ico_rgt rf_pm_icon"></span>
<span class="rf_pm_txt">
- Display item name
+ Display item name 1
</span>
+ <br clear="all">
</div>
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
- <div class="rf_pm_3 rf_pm_vis ">
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
- <div class="rf_pm_itm rf_pm_sel">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
- </div>
-
- <div class="rf_pm_itm rf_pm_dis">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
- <div class="rf_pm_itm rf_pm_dis">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
- </div>
- </div>
+ <div class="rf_pm_2 rf_pm_vis">
+ <div id="1.1">
+ <div class="rf_pm_itm">
+ <span class="rf_pm_ico_lft rf_pm_icon"></span>
+ <span class="rf_pm_ico_rgt rf_pm_icon"></span>
+ <span class="rf_pm_txt">
+ Display item 1.1
+ </span>
+ <br clear="all">
+ </div>
+ </div>
- <div class="rf_pm_lbl">
- <div class="rf_pm_itm rf_pm_1">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
- <div class="rf_pm_2 rf_pm_hid">
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
- <div class="rf_pm_3 rf_pm_hid ">
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
+ <div id="1.2">
+ <div class="rf_pm_itm">
+ <span class="rf_pm_ico_lft rf_pm_icon"></span>
+ <span class="rf_pm_ico_rgt rf_pm_icon"></span>
+ <span class="rf_pm_txt">
+ Display item name 1.2
+ </span>
+ <br clear="all">
+ </div>
+
+ <div class="rf_pm_3 rf_pm_vis ">
+
+ <div id="1.2.1">
+ <div class="rf_pm_itm">
+ <span class="rf_pm_ico_lft rf_pm_icon"></span>
+ <span class="rf_pm_ico_rgt rf_pm_icon"></span>
+ <span class="rf_pm_txt">
+ Display item name 1.2.1
+ </span>
+ <br clear="all">
+ </div>
+ </div>
+
+ <div id="1.2.2">
+ <div class="rf_pm_itm rf_pm_sel">
+ <span class="rf_pm_ico_lft rf_pm_icon"></span>
+ <span class="rf_pm_ico_rgt rf_pm_icon"></span>
+ <span class="rf_pm_txt">
+ Display item name 1.2.2
+ </span>
+ <br clear="all">
+ </div>
+ </div>
+
+ </div>
</div>
- <div class="rf_pm_itm rf_pm_sel">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
+
+ <div id="1.3">
+ <div class="rf_pm_itm rf_pm_dis">
+ <span class="rf_pm_ico_lft rf_pm_icon"></span>
+ <span class="rf_pm_ico_rgt rf_pm_icon"></span>
+ <span class="rf_pm_txt">
+ Display item name 1.3
+ </span>
+ <br clear="all">
+ </div>
</div>
- </div>
-
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
- </div>
-
- </div>
-
- <div class="rf_pm_lbl">
- <div class="rf_pm_itm rf_pm_1">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
- <div class="rf_pm_2 rf_pm_hid">
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
- <div class="rf_pm_3 rf_pm_hid ">
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
+ <div id="1.4">
+ <div class="rf_pm_itm rf_pm_dis">
+ <span class="rf_pm_ico_lft rf_pm_icon"></span>
+ <span class="rf_pm_ico_rgt rf_pm_icon"></span>
+ <span class="rf_pm_txt">
+ Display item name 1.4
+ </span>
+ <br clear="all">
+ </div>
</div>
- <div class="rf_pm_itm rf_pm_sel">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
+
</div>
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
- <div class="rf_pm_itm">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_lft">
- <img src="icon.gif" width="16" height="16" class="rf_pm_ico_rgt">
- <span class="rf_pm_txt">
- Display item name
- </span>
- </div>
-
</div>
-
+
</div>
14 years, 2 months
JBoss Rich Faces SVN: r19783 - in sandbox/trunk/ui/tree-actual/ui: src and 13 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-29 11:57:44 -0400 (Fri, 29 Oct 2010)
New Revision: 19783
Added:
sandbox/trunk/ui/tree-actual/ui/src/
sandbox/trunk/ui/tree-actual/ui/src/main/
sandbox/trunk/ui/tree-actual/ui/src/main/java/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeDataVisitor.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/convert/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/convert/SequenceRowKeyConverter.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKey.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
sandbox/trunk/ui/tree-actual/ui/src/main/resources/
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/last.gif
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/leaf_icon.gif
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/line.gif
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/minus.gif
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/node_icon.gif
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/plus.gif
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
sandbox/trunk/ui/tree-actual/ui/src/main/templates/
sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml
sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml
Log:
https://jira.jboss.org/browse/RF-9315
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.model.DataComponentState;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.convert.SequenceRowKeyConverter;
+import org.richfaces.model.TreeDataModelImpl;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterators;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@JsfComponent(
+ type = AbstractTree.COMPONENT_TYPE,
+ family = AbstractTree.COMPONENT_FAMILY,
+ tag = @Tag(name = "tree"),
+ renderer = @JsfRenderer(type = "org.richfaces.TreeRenderer")
+)
+public abstract class AbstractTree extends UIDataAdaptor {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Tree";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Tree";
+
+ private static final Predicate<UIComponent> RENDERED_UITREE_NODE = new Predicate<UIComponent>() {
+ public boolean apply(UIComponent input) {
+ return (input instanceof AbstractTreeNode) && input.isRendered();
+ };
+ };
+
+ private static final Converter ROW_KEY_CONVERTER = new SequenceRowKeyConverter();
+
+ public AbstractTree() {
+ setRendererType("org.richfaces.TreeRenderer");
+ }
+
+ public abstract Object getValue();
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ @Attribute(defaultValue = "SwitchType.DEFAULT")
+ public abstract SwitchType getToggleMode();
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.UIDataAdaptor#createExtendedDataModel()
+ */
+ @Override
+ protected ExtendedDataModel<?> createExtendedDataModel() {
+ TreeDataModelImpl model = new TreeDataModelImpl();
+ model.setWrappedData(getValue());
+ return model;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.UIDataAdaptor#createComponentState()
+ */
+ @Override
+ protected DataComponentState createComponentState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Converter getRowKeyConverter() {
+ Converter converter = super.getRowKeyConverter();
+ if (converter == null) {
+ converter = ROW_KEY_CONVERTER;
+ }
+ return converter;
+ }
+
+ public Iterator<Object> getChildrenIterator(FacesContext faces, Object rowKey) {
+ return ((TreeDataModelImpl) getExtendedDataModel()).getChildrenIterator(faces, rowKey);
+ }
+
+ public AbstractTreeNode getTreeNodeComponent() {
+ if (getChildCount() == 0) {
+ return null;
+ }
+
+ Iterator<UIComponent> iterator = Iterators.filter(getChildren().iterator(), RENDERED_UITREE_NODE);
+ if (iterator.hasNext()) {
+ return (AbstractTreeNode) iterator.next();
+ }
+
+ return null;
+ }
+
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@JsfComponent(
+ type = AbstractTreeNode.COMPONENT_TYPE,
+ family = AbstractTreeNode.COMPONENT_FAMILY,
+ tag = @Tag(name = "treeNode"),
+ renderer = @JsfRenderer(type = "org.richfaces.TreeNodeRenderer")
+)
+public abstract class AbstractTreeNode extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TreeNode";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.TreeNode";
+
+ public AbstractTreeNode() {
+ setRendererType("org.richfaces.TreeNodeRenderer");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeDataVisitor.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeDataVisitor.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeDataVisitor.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface TreeDataVisitor extends DataVisitor {
+
+ public void processLevelDown(FacesContext context);
+
+ public void processLevelUp(FacesContext context);
+
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/convert/SequenceRowKeyConverter.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/convert/SequenceRowKeyConverter.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/convert/SequenceRowKeyConverter.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.convert;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.richfaces.model.SequenceRowKey;
+
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.base.Splitter;
+import com.google.common.base.Strings;
+import com.google.common.collect.Iterables;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class SequenceRowKeyConverter implements Converter {
+
+ private static final Joiner DOT_JOINER = Joiner.on('.');
+
+ private static final Splitter DOT_SPLITTER = Splitter.on('.');
+
+ private static final Function<String, Integer> INTEGER_PARSER = new Function<String, Integer>() {
+ public Integer apply(String from) {
+ return Integer.parseInt(from);
+ };
+ };
+
+ public Object getAsObject(FacesContext context, UIComponent component, String value) {
+ if (Strings.isNullOrEmpty(value)) {
+ return null;
+ }
+
+ Iterable<String> split = DOT_SPLITTER.split(value);
+
+ //TODO - handle another types
+ return new SequenceRowKey<Integer>(Iterables.toArray(Iterables.transform(split, INTEGER_PARSER), Integer.class));
+ }
+
+ public String getAsString(FacesContext context, UIComponent component, Object value) {
+ if (value == null) {
+ return "";
+ }
+
+ SequenceRowKey<?> sequenceRowKey = (SequenceRowKey<?>) value;
+ Object[] simpleKeys=sequenceRowKey.getSimpleKeys();
+
+ return DOT_JOINER.join(simpleKeys);
+ }
+
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKey.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKey.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKey.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+import com.google.common.collect.ObjectArrays;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class SequenceRowKey<T> implements Serializable {
+
+ private static final long serialVersionUID = 5605581090240141910L;
+
+ private T[] simpleKeys;
+
+ public SequenceRowKey(T... keys) {
+ super();
+ this.simpleKeys = keys;
+ }
+
+ public T[] getSimpleKeys() {
+ return simpleKeys;
+ }
+
+ public SequenceRowKey<T> append(T segment) {
+ return new SequenceRowKey<T>(ObjectArrays.concat(simpleKeys, segment));
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + Arrays.hashCode(simpleKeys);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ SequenceRowKey<?> other = (SequenceRowKey<?>) obj;
+ if (!Arrays.equals(simpleKeys, other.simpleKeys)) {
+ return false;
+ }
+ return true;
+ }
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import java.util.Iterator;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class SequenceRowKeyIterator<T> implements Iterator<Object> {
+
+ private int counter = 0;
+
+ private SequenceRowKey<Integer> baseKey;
+
+ private Iterator<T> itr;
+
+ private T element;
+
+ private SequenceRowKey<Integer> elementKey;
+
+ public SequenceRowKeyIterator(SequenceRowKey<Integer> baseKey, Iterator<T> itr) {
+ super();
+ this.baseKey = baseKey;
+ this.itr = itr;
+ }
+
+ public boolean hasNext() {
+ return itr.hasNext();
+ }
+
+ public Object next() {
+ element = itr.next();
+ elementKey = baseKey.append(counter++);
+
+ return elementKey;
+ }
+
+ public T getElement() {
+ return element;
+ }
+
+ public SequenceRowKey<Integer> getElementKey() {
+ return elementKey;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+import javax.swing.tree.TreeNode;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+
+import com.google.common.collect.Iterators;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class TreeDataModelImpl extends ExtendedDataModel<TreeNode> {
+
+ private static final SequenceRowKey<Integer> EMPTY_SEQUENCE_ROW_KEY = new SequenceRowKey<Integer>();
+
+ private SwingTreeNodeImpl rootNode;
+
+ private TreeNode selectedNode;
+
+ private SequenceRowKey<Integer> selectedRowKey;
+
+ private TreeNode walkNode;
+
+ private SequenceRowKey<Integer> walkRowKey;
+
+ private void setWalkContextData(TreeNode node, SequenceRowKey<Integer> key) {
+ this.walkNode = node;
+ this.walkRowKey = key;
+ }
+
+ private Iterator<TreeNode> findChildren(SequenceRowKey<Integer> compositeKey) {
+ TreeNode treeNode = findNode(compositeKey);
+
+ if (treeNode == null) {
+ return Iterators.emptyIterator();
+ }
+
+ return Iterators.forEnumeration((Enumeration<TreeNode>) treeNode.children());
+ }
+
+ private TreeNode findNode(SequenceRowKey<Integer> compositeKey) {
+ if (compositeKey == null) {
+ return null;
+ }
+
+ TreeNode result = rootNode;
+
+ for (Integer simpleKey : compositeKey.getSimpleKeys()) {
+ int idx = simpleKey.intValue();
+
+ if (idx < result.getChildCount()) {
+ result = result.getChildAt(idx);
+ } else {
+ result = null;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ this.selectedRowKey = (SequenceRowKey<Integer>) key;
+
+ if (walkRowKey != null && walkRowKey.equals(key)) {
+ this.selectedNode = walkNode;
+ } else {
+ this.selectedNode = findNode(selectedRowKey);
+ }
+ }
+
+ @Override
+ public Object getRowKey() {
+ return selectedRowKey;
+ }
+
+ @Override
+ public boolean isRowAvailable() {
+ return selectedNode != null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+ @Override
+ public int getRowCount() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public TreeNode getRowData() {
+ return selectedNode;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowIndex()
+ */
+ @Override
+ public int getRowIndex() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#setRowIndex(int)
+ */
+ @Override
+ public void setRowIndex(int rowIndex) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Object getWrappedData() {
+ return rootNode.getChildrenList();
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ this.rootNode = new SwingTreeNodeImpl((List<TreeNode>) data);
+ }
+
+ private SequenceRowKey<Integer> castKeyAndWrapNull(Object rowKey) {
+ if (rowKey == null) {
+ return EMPTY_SEQUENCE_ROW_KEY;
+ }
+
+ return (SequenceRowKey<Integer>) rowKey;
+ }
+
+ public Iterator<Object> getChildrenIterator(FacesContext faces, Object rowKey) {
+ SequenceRowKey<Integer> sequenceKey = castKeyAndWrapNull(rowKey);
+ Iterator<TreeNode> itr = findChildren(sequenceKey);
+
+ return new SequenceRowKeyIterator<TreeNode>(sequenceKey, itr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.model.ExtendedDataModel#walk(javax.faces.context.FacesContext, org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range, java.lang.Object)
+ */
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,218 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit;
+
+import static org.richfaces.renderkit.util.AjaxRendererUtils.AJAX_FUNCTION_NAME;
+import static org.richfaces.renderkit.util.AjaxRendererUtils.buildAjaxFunction;
+import static org.richfaces.renderkit.util.AjaxRendererUtils.buildEventOptions;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSReference;
+import org.richfaces.component.AbstractTree;
+import org.richfaces.component.SwitchType;
+import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.UnmodifiableIterator;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public abstract class TreeRendererBase extends RendererBase {
+
+ private static final Logger LOGGER = RichfacesLogger.RENDERKIT.getLogger();
+
+ private static final String NODE_ID = "nodeId";
+
+ private static final String NEW_STATE = "newState";
+
+ private static final String TOGGLE_ID_PARAM = "org.richfaces.Tree.TOGGLE_ID";
+
+ private static final String NEW_STATE_PARAM = "org.richfaces.Tree.NEW_STATE";
+
+ private static final class QueuedData {
+
+ private Object rowKey;
+
+ private boolean lastNode;
+
+ private boolean encoded;
+
+ public QueuedData(Object rowKey, boolean lastNode) {
+ this.rowKey = rowKey;
+ this.lastNode = lastNode;
+ }
+
+ public void setEncoded(boolean encoded) {
+ this.encoded = encoded;
+ }
+
+ public boolean isEncoded() {
+ return encoded;
+ }
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public boolean isLastNode() {
+ return lastNode;
+ }
+ }
+
+ private class TreeEncoder {
+
+ private static final String TREE_NODE_HANDLE_CLASS_ATTRIBUTE = "__treeNodeHandleClass";
+
+ private static final String TREE_NODE_ICON_CLASS_ATTRIBUTE = "__treeNodeIconClass";
+
+ private FacesContext context;
+
+ private ResponseWriter responseWriter;
+
+ private AbstractTree tree;
+
+ private LinkedList<QueuedData> queuedData = new LinkedList<QueuedData>();
+
+ public TreeEncoder(FacesContext context, AbstractTree tree) {
+ super();
+ this.context = context;
+ this.responseWriter = context.getResponseWriter();
+ this.tree = tree;
+ }
+
+ protected void encodeTree(Iterator<Object> childrenIterator) throws IOException {
+ Predicate<Object> renderedTreeNodeKeyPredicate = new Predicate<Object>() {
+ public boolean apply(Object input) {
+ tree.setRowKey(input);
+
+ if (!tree.isRowAvailable()) {
+ return false;
+ }
+
+ return tree.getTreeNodeComponent() != null;
+ }
+ };
+
+ UnmodifiableIterator<Object> filteredIterator = Iterators.filter(childrenIterator, renderedTreeNodeKeyPredicate);
+ while (filteredIterator.hasNext()) {
+ Object rowKey = filteredIterator.next();
+
+ encodeTreeNode(rowKey, !filteredIterator.hasNext());
+ }
+ }
+
+ protected void encodeTreeNode(Object rowKey, boolean isLastNode) throws IOException {
+ if (!queuedData.isEmpty()) {
+ QueuedData data = queuedData.getLast();
+ if (!data.isEncoded()) {
+ tree.setRowKey(context, data.getRowKey());
+
+ writeTreeNodeStartElement(data.isLastNode(), false);
+
+ data.setEncoded(true);
+ }
+ }
+
+ queuedData.add(new QueuedData(rowKey, isLastNode));
+
+ tree.setRowKey(context, rowKey);
+
+ encodeTree(tree.getChildrenIterator(context, rowKey));
+
+ QueuedData data = queuedData.removeLast();
+ if (!data.isEncoded()) {
+ writeTreeNodeStartElement(data.isLastNode(), true);
+ }
+
+ writeTreeNodeEndElement();
+ }
+
+ protected void writeTreeNodeStartElement(boolean isLast, boolean isLeaf) throws IOException {
+ context.getAttributes().put(TREE_NODE_HANDLE_CLASS_ATTRIBUTE, isLeaf ? "tree_handle_leaf" : "tree_handle_expanded");
+ context.getAttributes().put(TREE_NODE_ICON_CLASS_ATTRIBUTE, isLeaf ? "tree_icon_leaf" : "tree_icon_node");
+
+ responseWriter.startElement(HtmlConstants.DIV_ELEM, tree);
+ responseWriter.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
+ HtmlUtil.concatClasses("tree_node", isLast ? "tree_node_last" : null),
+ null);
+ responseWriter.writeAttribute(HtmlConstants.ID_ATTRIBUTE, tree.getClientId(context), null);
+
+ tree.getTreeNodeComponent().encodeAll(context);
+ }
+
+ protected void writeTreeNodeEndElement() throws IOException {
+ responseWriter.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ public void encode() throws IOException {
+ Object initialRowKey = tree.getRowKey();
+ try {
+ encodeTree(tree.getChildrenIterator(context, null));
+ } finally {
+ try {
+ tree.setRowKey(context, initialRowKey);
+ } catch (Exception e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ public void encodeTree(FacesContext context, UIComponent component) throws IOException {
+ AbstractTree tree = (AbstractTree) component;
+
+ new TreeEncoder(context, tree).encode();
+ }
+
+ protected String getAjaxToggler(FacesContext context, UIComponent component) {
+ AbstractTree tree = (AbstractTree) component;
+
+ if (!SwitchType.ajax.equals(tree.getToggleMode())) {
+ return null;
+ }
+
+ JSFunction ajaxFunction = buildAjaxFunction(context, component, AJAX_FUNCTION_NAME);
+ AjaxEventOptions eventOptions = buildEventOptions(context, component);
+
+ eventOptions.setParameter(TOGGLE_ID_PARAM, new JSReference(NODE_ID));
+ eventOptions.setParameter(NEW_STATE_PARAM, new JSReference(NEW_STATE));
+
+ if (!eventOptions.isEmpty()) {
+ ajaxFunction.addParameter(eventOptions);
+ }
+
+ return ajaxFunction.toScript();
+ }
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/last.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/last.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/leaf_icon.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/leaf_icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/line.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/line.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/minus.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/minus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/node_icon.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/node_icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/plus.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/plus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,71 @@
+.tree_item {
+ background: "url(#{resource['org.richfaces.images:last.gif']}) no-repeat center left";
+ cursor: default;
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ color: '#{richSkin.generalTextColor}';
+ padding: 1px 0px 1px 0px;
+ overflow: hidden;
+ width: 100%;
+ white-space: nowrap;
+}
+
+.tree_item_label {
+ padding: 0px 4px 0px 2px;
+ vertical-align: middle;
+ cursor: pointer;
+ display: inline-block;
+}
+
+.tree_selarea {
+ display: inline-block;
+}
+
+.tree_selected {
+ background: '#{richSkin.additionalBackgroundColor}';
+}
+
+.tree_node {
+ background: "url(#{resource['org.richfaces.images:line.gif']}) repeat-y";
+}
+
+.tree_node_last {
+ background: none;
+}
+
+.tree_node .tree_node {
+ margin-left: 16px;
+}
+
+.tree_icon, .tree_handle {
+ vertical-align: middle;
+ margin: 0px;
+ cursor: pointer;
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+}
+
+.tree_handle_leaf {
+ cursor: default;
+}
+
+.tree_handle_collapsed {
+ background: "url(#{resource['org.richfaces.images:plus.gif']}) no-repeat center";
+}
+
+.tree_handle_expanded {
+ background: "url(#{resource['org.richfaces.images:minus.gif']}) no-repeat center";
+}
+
+.tree_icon_node {
+ background: "url(#{resource['org.richfaces.images:node_icon.gif']}) no-repeat center";
+}
+
+.tree_icon_leaf {
+ background: "url(#{resource['org.richfaces.images:leaf_icon.gif']}) no-repeat center";
+}
+
+.tree_node.tree_collapse .tree_node {
+ display: none;
+}
Added: sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+ xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core" xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.TreeRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.TreeRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.Tree</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.TreeRenderer</cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+
+ <cdk:resource-dependency name="base-component.reslib" library="org.richfaces" />
+ <cdk:resource-dependency name="tree.js" library="org.richfaces" />
+ <cdk:resource-dependency name="tree.ecss" library="org.richfaces" />
+
+ <cdk:import package="org.richfaces.component" names="SwitchType" />
+ </cc:interface>
+
+ <cc:implementation>
+ <div id="#{clientId}" class="#{concatClasses('rf-tree', component.attributes['styleClass'])}"
+ cdk:passThroughWithExclusions="">
+ <cdk:body>
+ <cdk:call expression="encodeTree(facesContext, component)" />
+ </cdk:body>
+
+ <script type="text/javascript">
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption attributes="toggleMode selectionMode" defaultValue="SwitchType.DEFAULT" />
+ <cdk:scriptOption name="ajaxToggler" value="#{getAjaxToggler(facesContext, component)}" />
+ </cdk:scriptObject>
+
+ new RichFaces.ui.Tree(#{toScriptArgs(clientId, options)});
+ </script>
+ </div>
+ </cc:implementation>
+
+</cdk:root>
Added: sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml 2010-10-29 15:57:44 UTC (rev 19783)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+ xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core" xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+ xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.TreeNodeRenderer
+ </cdk:class>
+ <cdk:superclass>javax.faces.render.Renderer</cdk:superclass>
+ <cdk:component-family>org.richfaces.TreeNode
+ </cdk:component-family>
+ <cdk:renderer-type>org.richfaces.TreeNodeRenderer
+ </cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <div class="tree_item">
+ <div class="tree_handle #{facesContext.attributes['__treeNodeHandleClass']}"></div>
+ <div class="tree_selarea">
+ <div class="tree_icon #{facesContext.attributes['__treeNodeIconClass']}"></div>
+ <span class="tree_item_label">
+ <cdk:body />
+ </span>
+ </div>
+ </div>
+ </cc:implementation>
+
+</cdk:root>
14 years, 2 months
JBoss Rich Faces SVN: r19782 - in sandbox/trunk/ui: tree-actual and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-29 11:48:19 -0400 (Fri, 29 Oct 2010)
New Revision: 19782
Added:
sandbox/trunk/ui/tree-actual/
sandbox/trunk/ui/tree-actual/ui/
sandbox/trunk/ui/tree-actual/ui/pom.xml
Log:
https://jira.jboss.org/browse/RF-9315
Added: sandbox/trunk/ui/tree-actual/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/pom.xml (rev 0)
+++ sandbox/trunk/ui/tree-actual/ui/pom.xml 2010-10-29 15:48:19 UTC (rev 19782)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.iteration</groupId>
+ <artifactId>tree-ui</artifactId>
+ <name>Richfaces UI Components: Tree UI</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <!-- runtime -->
+ <dependency>
+ <groupId>org.richfaces.ui.common</groupId>
+ <artifactId>richfaces-ui-common-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.iteration</groupId>
+ <artifactId>richfaces-ui-iteration-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.iteration</groupId>
+ <artifactId>richfaces-ui-iteration-ui</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
14 years, 2 months
JBoss Rich Faces SVN: r19781 - trunk/examples.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-10-29 11:31:03 -0400 (Fri, 29 Oct 2010)
New Revision: 19781
Modified:
trunk/examples/pom.xml
Log:
uodate pom
Modified: trunk/examples/pom.xml
===================================================================
--- trunk/examples/pom.xml 2010-10-29 15:30:18 UTC (rev 19780)
+++ trunk/examples/pom.xml 2010-10-29 15:31:03 UTC (rev 19781)
@@ -44,7 +44,6 @@
<module>misc-demo</module>
<module>output-demo</module>
<module>input-demo</module>
- <module>calendar-demo</module>
<module>repeater-demo</module>
<module>iteration-demo</module>
<module>richfaces-showcase</module>
14 years, 2 months
JBoss Rich Faces SVN: r19779 - in trunk/examples/input-demo/src/main/webapp: examples and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-10-29 11:22:24 -0400 (Fri, 29 Oct 2010)
New Revision: 19779
Added:
trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
Modified:
trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/input-demo/src/main/webapp/templates/template.xhtml
Log:
add calendar sample
Modified: trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-29 15:04:54 UTC (rev 19778)
+++ trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-29 15:22:24 UTC (rev 19779)
@@ -26,7 +26,12 @@
<navigation-case>
<from-outcome>autocomplete</from-outcome>
<to-view-id>/examples/autocomplete.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>calendar</from-outcome>
+ <to-view-id>/examples/calendar.xhtml</to-view-id>
</navigation-case>
+
<!-- QUnit -->
<navigation-case>
Added: trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml (rev 0)
+++ trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2010-10-29 15:22:24 UTC (rev 19779)
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:calendar="http://richfaces.org/input">
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+ <h:head>
+ <title>Richfaces Calendar Demo</title>
+ </h:head>
+ <h:body>
+ <h:form id="form">
+ <calendar:calendar popup="true"/>
+ <h:commandButton value="submit"></h:commandButton>
+ </h:form>
+ </h:body>
+</html>
Modified: trunk/examples/input-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/templates/template.xhtml 2010-10-29 15:04:54 UTC (rev 19778)
+++ trunk/examples/input-demo/src/main/webapp/templates/template.xhtml 2010-10-29 15:22:24 UTC (rev 19779)
@@ -31,6 +31,7 @@
<h:form id="nav">
<p>Input Component's Examples</p>
<ul>
+ <li><h:commandLink value="rich:calendar" action="calendar" /></li>
<li><h:commandLink value="rich:inplaceInput" action="inplaceInput" /></li>
<li><h:commandLink value="rich:inplaceSelect" action="inplaceSelect" /></li>
<li><h:commandLink value="rich:inputNumberSlider" action="inputNumberSlider" /></li>
14 years, 2 months
JBoss Rich Faces SVN: r19778 - trunk/ui.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-10-29 11:04:54 -0400 (Fri, 29 Oct 2010)
New Revision: 19778
Removed:
trunk/ui/calendar/
Log:
remove calendar
14 years, 2 months