JBoss Rich Faces SVN: r5465 - in management/design/comboBox/markup: images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-01-18 08:53:55 -0500 (Fri, 18 Jan 2008)
New Revision: 5465
Added:
management/design/comboBox/markup/ComboBox_Strict.html
management/design/comboBox/markup/images/bg_shadow.png
Log:
Added: management/design/comboBox/markup/ComboBox_Strict.html
===================================================================
--- management/design/comboBox/markup/ComboBox_Strict.html (rev 0)
+++ management/design/comboBox/markup/ComboBox_Strict.html 2008-01-18 13:53:55 UTC (rev 5465)
@@ -0,0 +1,87 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>Untitled</title>
+<style>
+.cb_width_field{ width : 250px;}
+.cb_width_list{ width : 248px;}
+.cb_font{ font-size : 11px/*generalSizeFont*/; font-family : arial/*generalFamilyFont*/; color : #000000/*generalTextColor*/}
+.cb_shell{ position : relative;}
+.cb_field{ width : 225px;position : absolute; top : 0px; left : 0; padding-right :20px; padding-left :3px; margin : 0px; border : 1px solid #c0c0c0; background-image: url(SpinnerFieldGradient.gif); background-position:left top;
+background-repeat:repeat-x; border-color: #BED6F8 rgb(255, 255, 255) #BED6F8 rgb(190, 214, 248); } /*panelBorderColor*/
+.cb_strut{ position : relative; visibility : hidden; padding-right :20px; padding-top :0px; padding-bottom :0px; padding-left :3px; margin : 0px; border : 1px solid #c0c0c0; margin : 0px; border : 1px solid #c0c0c0;}
+.cb_button{ position : absolute; top : 0px; right : 0; width : 17px;padding-left : 0px; padding-right : 0px; margin : 0px; border : 1px solid #c0c0c0; border-color: #BED6F8 rgb(190, 214, 248) #BED6F8 rgb(190, 214, 248); } /*panelBorderColor*/
+.cb_button_bg{ background : url(images/bg_btn.png) top repeat-x #C7D7EC;} /*gradient - from generalBackgroundColor to tabBackgroundColor, background-color - tabBackgroundColor*/
+.cb_button_bg_press{ background : url(images/bg_press.png) repeat-x bottom #C7D7EC} /*gradient - from tabBackgroundColor to generalBackgroundColor, background-color - tabBackgroundColor*/
+.cb_button_arrow{ background : url(images/down.gif) center no-repeat; cursor : pointer;}
+.cb_button_select{ border : 1px solid #E79A00;} /*selectControlColor*/
+
+.cb_list_cord{ position : relative; font-size : 0px;d!isplay : none}/*DDL is hidden!!!!!*/
+.cb_list_position{ position : absolute; top:0px; left:0px;}
+.cb_list_decoration{border : 1px solid #BED6F8 /*panelBorderColor*/; padding : 0px; background : #FFFFFF; /*tableBackgroundColor*/}
+.cb_list_scroll{ overflow : auto; overflow-x : hidden; height : 100px;}
+.cb_option{ padding : 2px; white-space : nowrap;}
+.cb_select{ padding : 1px; width : 100%; background-color: #DFE8F6; border : 1px dotted #a3bae9;/*generalTextColor*/}
+.cb_shadow{ top:-5; left:0; position : absolute;}
+.cb_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left;}
+.cb_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right;}
+.cb_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left;}
+.cb_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right;}
+</style>
+</head>
+
+<body style="margin : 30px">
+
+<div class="cb_width_list cb_font cb_shell">
+ <div class="cb_width_field cb_font cb_shell">
+ <input type="Text" value="Input text or select option" class="cb_width_field cb_font cb_field">
+ <input readonly="" type="Text" value="" class="cb_button cb_font cb_button_bg">
+ <input readonly="" type="Text" value="" class="cb_button cb_font cb_button_arrow" onmouseover="this.className='cb_button cb_font cb_button_arrow cb_button_select'" onmouseout="this.className='cb_button cb_font cb_button_arrow'">
+ <input type="Text"class="cb_width_field cb_strut cb_font">
+ </div><div class="cb_list_cord">
+ <iframe class="cb_width_list cb_list_scroll cb_list_position" frameborder="0"></iframe>
+ <div class="cb_shadow">
+ <table cellpadding="0" cellspacing="0" border="0" width="257" height="109">
+ <tr>
+ <td class="cb_shadow_tl">
+ <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
+ </td>
+ <td class="cb_shadow_tr">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ </tr>
+ <tr>
+ <td class="cb_shadow_bl">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ <td class="cb_shadow_br">
+ <img src="images/spacer.gif" width="10" height="10" alt="" border="0"><br>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="cb_list_position">
+ <div class="cb_list_decoration">
+ <div class="cb_list_scroll cb_width_list">
+ <div class="cb_option cb_font">Option 1</div>
+ <div class="cb_option cb_font">Option 2</div>
+ <div class="cb_option cb_font">Option 3</div>
+ <div class="cb_option cb_font">Option 4</div>
+ <div class="cb_option cb_font cb_select">Opt</div>
+ <div class="cb_option cb_font">Option 6</div>
+ <div class="cb_option cb_font">Option 7</div>
+ <div class="cb_option cb_font">Option 8</div>
+ <div class="cb_option cb_font">Option 9</div>
+ <div class="cb_option cb_font">Option 0</div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+
+
+</body>
+</html>
Added: management/design/comboBox/markup/images/bg_shadow.png
===================================================================
(Binary files differ)
Property changes on: management/design/comboBox/markup/images/bg_shadow.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years
JBoss Rich Faces SVN: r5464 - management/design/fileUpload.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-01-18 04:18:30 -0500 (Fri, 18 Jan 2008)
New Revision: 5464
Modified:
management/design/fileUpload/Func Spec - File Upload Component.doc
Log:
Modified: management/design/fileUpload/Func Spec - File Upload Component.doc
===================================================================
(Binary files differ)
17 years
JBoss Rich Faces SVN: r5463 - branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-01-17 16:21:52 -0500 (Thu, 17 Jan 2008)
New Revision: 5463
Modified:
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
Log:
Merge changes from trunk
Modified: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2008-01-17 21:21:21 UTC (rev 5462)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2008-01-17 21:21:52 UTC (rev 5463)
@@ -52,9 +52,9 @@
}
public String getFunction(FacesContext context, UIAjaxFunction component) {
- StringBuffer script = new StringBuffer();
+ StringBuffer script = new StringBuffer(component.getName()).append("=");
JSFunctionDefinition func = new JSFunctionDefinition();
- func.setName(component.getName());
+ //func.setName(component.getName());
// Create AJAX Submit function.
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(
component, context,AjaxRendererUtils.AJAX_FUNCTION_NAME);
17 years
JBoss Rich Faces SVN: r5462 - branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-01-17 16:21:21 -0500 (Thu, 17 Jan 2008)
New Revision: 5462
Modified:
branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
Merge changes from trunk
Modified: branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-17 20:12:54 UTC (rev 5461)
+++ branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-17 21:21:21 UTC (rev 5462)
@@ -89,7 +89,8 @@
}
if(_this.onready){
_this.onready(_this);
- }
+ }
+
} else {
_this._errorMessage = "Reqest error, status : "+requestStatus +" " + requestStatusText ;
LOG.error(_this._errorMessage);
@@ -97,10 +98,11 @@
_this._onerror(_this,requestStatus,_this._errorMessage);
}
}
- if(_this.onfinish){
+ if (_this.onfinish)
+ {
_this.onfinish(_this);
}
- _this = undefined;
+ _this = undefined;
}
}; //this._onReady;
try{
@@ -233,8 +235,12 @@
LOG.debug("selectNodes found "+elements.length);
}
catch (ex) {
- elements = element.getElementsByTagName(elementname);
- LOG.debug("getElementsByTagName found "+elements.length);
+ try {
+ elements = element.getElementsByTagName(elementname);
+ LOG.debug("getElementsByTagName found "+elements.length);
+ } catch(nf){
+ LOG.debug("getElementsByTagName found no elements, "+nf.Message);
+ }
}
// return document.getElementsByTagName(tagName);
// elements = element.getElementsByTagNameNS("http://www.w3.org/1999/xhtml",elementname);
@@ -284,10 +290,11 @@
return data;
},
- evalScripts : function(node){
+ evalScripts : function(node, isLast){
var newscripts = this.getElementsByTagName("script",node);
LOG.debug("Scripts in updated part count : " + newscripts.length);
if( newscripts.length > 0 ){
+ var _this = this;
window.setTimeout(function() {
for (var i = 0; i < newscripts.length; i++){
var newscript = Sarissa.getText( newscripts[i],true ) ; // TODO - Mozilla disable innerHTML in XML page ..."";
@@ -303,14 +310,39 @@
}
}
newscripts = null;
+ if (isLast)
+ {
+ if(_this.onfinish){
+ _this.onfinish(_this);
+ _this=undefined;
+ }
+ }
},50);
+ } else
+ {
+ if (isLast)
+ {
+ if(this.onfinish){
+ this.onfinish(this);
+ }
+ }
}
+
},
+
+ beforeUpdatePagePart: function (id)
+ {
+ var oldnode = window.document.getElementById(id);
+ if ( oldnode ) {
+
+ }
+ },
+
/**
* Update DOM element with given ID by element with same ID in parsed responseXML
*/
- updatePagePart : function(id){
+ updatePagePart : function(id, isLast){
var newnode = this.getElementById(id);
if( ! newnode ) { LOG.error("New node for ID "+id+" is not present in response");return;}
var oldnode = window.document.getElementById(id);
@@ -343,34 +375,83 @@
// re-execute all script fragments in imported subtree...
// TODO - opera 8 run scripts at replace content stage.
if(!A4J.AJAX._scriptEvaluated){
- this.evalScripts(newnode);
+ this.evalScripts(newnode, isLast);
}
LOG.debug("Update part of page for Id: "+id + " successful");
} else {
LOG.warn("Node for replace by response with id "+id+" not found in document");
}
+ if (A4J.AJAX._scriptEvaluated && isLast)
+ {
+ if(this.onfinish){
+ this.onfinish(this);
+ }
+ }
+
},
appendNewHeadElements : function(){
- // Append scripts and styles to head, if not presented in page before.
- this._appendNewElements("script","src",["type","language","charset"]);
- this._appendNewElements("link","href",["type","rel","rev","media"]);
+ // Append scripts and styles to head, if not presented in page before.
+ this._appendNewElements("script","src",null,null,["type","language","charset"]);
+
+ var _this = this;
+ this._appendNewElements("link","href","class",["component","user"],["type","rev","media"],{"class": "className"},
+ function (element, script) {
+ //IE requires to re-set rel or href after insertion to initialize correctly
+ //see http://jira.jboss.com/jira/browse/RF-1627#action_12394642
+ _this._copyAttribute(element,script,"rel");
+ }
+ );
},
- _appendNewElements : function(tag,href,attributes){
+ _appendNewElements : function(tag,href,role,roles,attributes,mappings,callback){
+ var head = document.getElementsByTagName("head")[0]||document.documentElement;
var newscripts = this.getElementsByTagName(tag);
var oldscripts = document.getElementsByTagName(tag);
- var head = document.getElementsByTagName("head")[0]||document.documentElement;
+ var mappedRole = (mappings && mappings[role]) || role;
+
+ var roleAnchors = {};
+ if (roles) {
+ var i = 0;
+
+ for(var j = 0; j < oldscripts.length; j++){
+ var oldscript = oldscripts[j];
+ var scriptRole = oldscript[mappedRole];
+
+ for ( ; i < roles.length && roles[i] != scriptRole; i++) {
+ roleAnchors[roles[i]] = oldscript;
+ }
+
+ if (i == roles.length) {
+ break;
+ }
+ }
+ }
+
for(var i=0 ; i<newscripts.length;i++){
var element = newscripts[i];
var src = element.getAttribute(href);
+ var elementRole;
+
+ if (roles) {
+ elementRole = element.getAttribute(role);
+ }
+
if(src){
var exist = false;
LOG.debug("<"+tag+"> in response with src="+src);
for(var j = 0 ; j < oldscripts.length; j++){
if(this._noSessionHref(src) == this._noSessionHref(oldscripts[j].getAttribute(href))){
LOG.debug("Such element exist in document");
+
+ if (role) {
+ var oldRole = oldscripts[j][mappedRole];
+ if ((!elementRole ^ !oldRole) || (elementRole && oldRole && elementRole != oldRole)) {
+ LOG.warn("Roles are different");
+ }
+ }
+
exist = true;
break;
}
@@ -382,8 +463,23 @@
for(var j = 0 ; j < attributes.length; j++){
this._copyAttribute(element,script,attributes[j]);
}
+
+ if (elementRole) {
+ script[mappedRole] = elementRole;
+ }
+
LOG.debug("append element to document");
- head.appendChild(script);
+
+ var anchor = roleAnchors[elementRole];
+ if (anchor && anchor.parentNode) {
+ anchor.parentNode.insertBefore(script, anchor);
+ } else {
+ head.appendChild(script);
+ }
+
+ if (callback) {
+ callback(element,script);
+ }
}
}
}
@@ -447,7 +543,7 @@
}
A4J.AJAX._pollers[options.pollId] = window.setTimeout(function(){
A4J.AJAX._pollers[options.pollId]=undefined;
- if((typeof(options.onsubmit) == 'function') && (!options.onsubmit())){
+ if((typeof(options.onsubmit) == 'function') && (options.onsubmit()==false)){
// Onsubmit disable current poll, start next interval.
A4J.AJAX.Poll(containerId,form,options);
} else {
@@ -479,18 +575,16 @@
if (request.readyState == 4 ) {
try {
if(request.status == 200){
-// A4J.AJAX._pollers[options.pushId]=undefined;
A4J.AJAX.SubmitRequest(containerId,form||options.dummyForm,null,options);
}
} catch(e){
// Network error.
}
+ // Clear variables.
+ request=null;
+ A4J.AJAX._pollers[options.pushId] = null;
// Re-send request.
A4J.AJAX.Push( containerId, form, options );
- request=null;
-// A4J.AJAX._pollers[options.pushId] = window.setTimeout(function(){
-// A4J.AJAX.SendPush( request,options );
-// },options.pushinterval);
}
}
A4J.AJAX.SendPush( request,options );
@@ -504,13 +598,13 @@
if(options.timeout){
request.setRequestHeader( "Timeout", options.timeout);
}
- request.send();
+ request.send(null);
}
A4J.AJAX.StopPush = function( Id ) {
if(A4J.AJAX._pollers[Id]){
window.clearTimeout(A4J.AJAX._pollers[Id]);
- A4J.AJAX._pollers[Id] = undefined;
+ A4J.AJAX._pollers[Id] = null;
}
};
@@ -720,7 +814,7 @@
req.appendNewHeadElements();
for ( var k =0; k < options.affected.length ; k++ ) {
LOG.debug("Update page part from call parameter for ID " + options.affected[k]);
- req.updatePagePart(options.affected[k]);
+ req.updatePagePart(options.affected[k], k==childs.length-1);
};
// if resopnce contains element with ID "ajax:update" get id's from
// child text element . like :
@@ -737,7 +831,7 @@
for ( var k=0 ; k < childs.length ; k++ ) {
var id = childs[k];
LOG.debug("Attempt to update part of page for Id: "+id);
- if ( id ) {req.updatePagePart(id);};
+ if ( id ) {req.updatePagePart(id, k==childs.length-1);};
};
} else {
// if none of above - error ?
@@ -894,22 +988,20 @@
var options = request.options;
// we can set listener for complete request - for example,
// it can shedule next request for update page.
- var oncomplete = request.getElementById('org.ajax4jsf.oncomplete');
- if(oncomplete) {
+ var oncomp = request.getElementById('org.ajax4jsf.oncomplete');
+ if(oncomp) {
LOG.debug( "Call request oncomplete function after processing updates" );
window.setTimeout(function(){
var event = request.domEvt;
var data = request.getJSON('_ajax:data');
try {
- var newscript = Sarissa.getText(oncomplete,true);
- if (!window.data) {
- window.data = data;
- } else {
- for (property in data) {
- window.data[property] = data[property];
- }
- }
- window.eval(newscript);
+ var newscript = Sarissa.getText(oncomp,true);
+ var oncomplete = new Function("request","event","data",newscript);
+ var target = null;
+ if (event) {
+ target = event.target ? event.target : event.srcElement;
+ };
+ oncomplete.call(target,request,event,data);
} catch(e){
LOG.error('Error evaluate oncomplete function '+e.Message);
}
17 years
JBoss Rich Faces SVN: r5461 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-17 15:12:54 -0500 (Thu, 17 Jan 2008)
New Revision: 5461
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
Log:
http://jira.jboss.com/jira/browse/RF-1625
Fixed z-index for default indicator.
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2008-01-17 18:41:45 UTC (rev 5460)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2008-01-17 20:12:54 UTC (rev 5461)
@@ -129,18 +129,22 @@
if (!dragDiv) {
dragDiv = document.createElement("div");
dragDiv.id = "_rfDefaultDragIndicatorLeft";
+ Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
document.body.appendChild(dragDiv);
+
dragDiv = document.createElement("div");
dragDiv.id = "_rfDefaultDragIndicatorRight";
+ Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
document.body.appendChild(dragDiv);
+
dragDiv = document.createElement("div");
dragDiv.id = "_rfDefaultDragIndicatorBottom";
- Element.setStyle(dragDiv, {"font-size" : "0px"});
+ Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
document.body.appendChild(dragDiv);
dragDiv = document.createElement("div");
dragDiv.id = "_rfDefaultDragIndicator";
- Element.setStyle(dragDiv, {"font-size" : "0px"});
+ Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
Object.extend(dragDiv, DefaultDragIndicator);
document.body.appendChild(dragDiv);
}
17 years
JBoss Rich Faces SVN: r5460 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-17 13:41:45 -0500 (Thu, 17 Jan 2008)
New Revision: 5460
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Small optimization for utils.js
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-01-17 18:37:50 UTC (rev 5459)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-01-17 18:41:45 UTC (rev 5460)
@@ -67,9 +67,10 @@
callback.call(this, node);
- var children = node.childNodes;
- for (var i = 0; i < children.length; i++ ) {
- Richfaces.visitTree(children[i], callback);
+ var child = node.firstChild;
+ while (child) {
+ Richfaces.visitTree(child, callback);
+ child = child.nextSibling;
}
};
17 years
JBoss Rich Faces SVN: r5459 - trunk/framework/impl/src/main/java/org/ajax4jsf/resource.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-17 13:37:50 -0500 (Thu, 17 Jan 2008)
New Revision: 5459
Removed:
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/PreprocessingRenderer.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/TemplateCSSRenderer.java
Log:
Automatic resources registration changes reverted
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2008-01-17 18:24:39 UTC (rev 5458)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2008-01-17 18:37:50 UTC (rev 5459)
@@ -179,18 +179,6 @@
*/
public void setRenderer(ResourceRenderer renderer) {
this.renderer = renderer;
-
- if (renderer instanceof PreprocessingRenderer) {
- try {
- if (log.isDebugEnabled()) {
- log.debug("Preprocessing resource " + this);
- }
-
- ((PreprocessingRenderer) renderer).preprocess(this, null);
- } catch (IOException e) {
- log.error(e.getLocalizedMessage(), e);
- }
- }
}
/**
Deleted: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/PreprocessingRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/resource/PreprocessingRenderer.java 2008-01-17 18:24:39 UTC (rev 5458)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/resource/PreprocessingRenderer.java 2008-01-17 18:37:50 UTC (rev 5459)
@@ -1,45 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import java.io.IOException;
-
-/**
- * Renderers that wish to provide special handling for resource being associated with <code>this</code>
- * renderer instance can implement this interface.
- *
- * Created 14.01.2008
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public interface PreprocessingRenderer {
-
- /**
- * Method is called by resource being associated with <code>this</code> renderer
- *
- * @param resource resource that is being associated
- * @param resourceContext resource context
- * @throws IOException
- */
- public void preprocess(InternetResource resource, ResourceContext resourceContext) throws IOException;
-}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/TemplateCSSRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/resource/TemplateCSSRenderer.java 2008-01-17 18:24:39 UTC (rev 5458)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/resource/TemplateCSSRenderer.java 2008-01-17 18:37:50 UTC (rev 5459)
@@ -45,7 +45,7 @@
* @author shura
*
*/
-public class TemplateCSSRenderer extends StyleRenderer implements PreprocessingRenderer {
+public class TemplateCSSRenderer extends StyleRenderer {
private static final String COMPILED_TEMPLATE_PROPERTY = "compiled-template";
@@ -157,9 +157,4 @@
return value;
}
- public void preprocess(InternetResource resource,
- ResourceContext resourceContext) throws IOException {
-
- getTemplate(resource, resourceContext);
- }
}
17 years
JBoss Rich Faces SVN: r5458 - in trunk/ui: dropdown-menu/src/main/config/resources and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-17 13:24:39 -0500 (Thu, 17 Jan 2008)
New Revision: 5458
Removed:
trunk/ui/dataTable/src/main/config/resources/resources-config.xml
trunk/ui/dropdown-menu/src/main/config/resources/resources-config.xml
trunk/ui/inputnumber-slider/src/main/config/resources/resources-config.xml
trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml
trunk/ui/menu-components/src/main/config/resources/resources-config.xml
trunk/ui/scrollableDataTable/src/main/config/resources/resources-config.xml
trunk/ui/tabPanel/src/main/config/resources/resources-config.xml
Log:
excess resources-config.xml files removed
Deleted: trunk/ui/dataTable/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/resources/resources-config.xml 2008-01-17 18:07:36 UTC (rev 5457)
+++ trunk/ui/dataTable/src/main/config/resources/resources-config.xml 2008-01-17 18:24:39 UTC (rev 5458)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
- <resource class="org.richfaces.renderkit.html.iconimages.DataTableIconSortAsc">
- <name>org.richfaces.renderkit.html.iconimages.DataTableIconSortAsc</name>
- </resource>
- <resource class="org.richfaces.renderkit.html.iconimages.DataTableIconSortDesc">
- <name>org.richfaces.renderkit.html.iconimages.DataTableIconSortDesc</name>
- </resource>
-</resource-config>
Deleted: trunk/ui/dropdown-menu/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/dropdown-menu/src/main/config/resources/resources-config.xml 2008-01-17 18:07:36 UTC (rev 5457)
+++ trunk/ui/dropdown-menu/src/main/config/resources/resources-config.xml 2008-01-17 18:24:39 UTC (rev 5458)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
-<!-- Menu list background -->
-
- <resource class="org.richfaces.renderkit.html.images.background.MenuListBackground">
- <name>org.richfaces.renderkit.html.images.background.MenuListBackground</name>
- </resource>
-</resource-config>
Deleted: trunk/ui/inputnumber-slider/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/inputnumber-slider/src/main/config/resources/resources-config.xml 2008-01-17 18:07:36 UTC (rev 5457)
+++ trunk/ui/inputnumber-slider/src/main/config/resources/resources-config.xml 2008-01-17 18:24:39 UTC (rev 5458)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
-<!-- Include manual created resource -->
- <resource class="org.richfaces.renderkit.html.images.SliderFieldGradient">
- <name>org.richfaces.renderkit.html.images.SliderFieldGradient</name>
- </resource>
- <resource class="org.richfaces.renderkit.html.images.SliderTrackGradient">
- <name>org.richfaces.renderkit.html.images.SliderTrackGradient</name>
- </resource>
-
-</resource-config>
Deleted: trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml 2008-01-17 18:07:36 UTC (rev 5457)
+++ trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml 2008-01-17 18:24:39 UTC (rev 5458)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
- <resource class="org.richfaces.renderkit.html.images.SpinnerButtonGradient">
- <name>org.richfaces.renderkit.html.images.SpinnerButtonGradient</name>
- </resource>
- <resource class="org.richfaces.renderkit.html.images.SpinnerFieldGradient">
- <name>org.richfaces.renderkit.html.images.SpinnerFieldGradient</name>
- </resource>
- <!--resource class="org.richfaces.renderkit.html.images.buttons.SpinnerButtonImage">
- <name>org.richfaces.renderkit.html.images.buttons.SpinnerButtonImage</name>
- </resource-->
-</resource-config>
Deleted: trunk/ui/menu-components/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/menu-components/src/main/config/resources/resources-config.xml 2008-01-17 18:07:36 UTC (rev 5457)
+++ trunk/ui/menu-components/src/main/config/resources/resources-config.xml 2008-01-17 18:24:39 UTC (rev 5458)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
-<!-- Menu list background -->
-
- <resource class="org.richfaces.renderkit.html.images.background.MenuListBackground">
- <name>org.richfaces.renderkit.html.images.background.MenuListBackground</name>
- </resource>
-</resource-config>
Deleted: trunk/ui/scrollableDataTable/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/resources/resources-config.xml 2008-01-17 18:07:36 UTC (rev 5457)
+++ trunk/ui/scrollableDataTable/src/main/config/resources/resources-config.xml 2008-01-17 18:24:39 UTC (rev 5458)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
- <resource class="org.richfaces.renderkit.html.iconimages.DataTableIconSortAsc">
- <name>org.richfaces.renderkit.html.iconimages.DataTableIconSortAsc</name>
- </resource>
- <resource class="org.richfaces.renderkit.html.iconimages.DataTableIconSortDesc">
- <name>org.richfaces.renderkit.html.iconimages.DataTableIconSortDesc</name>
- </resource>
- <resource class="org.richfaces.renderkit.html.iconimages.ScrollableDataTableIconSplit">
- <name>org.richfaces.renderkit.html.iconimages.ScrollableDataTableIconSplit</name>
- </resource>
-</resource-config>
Deleted: trunk/ui/tabPanel/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/tabPanel/src/main/config/resources/resources-config.xml 2008-01-17 18:07:36 UTC (rev 5457)
+++ trunk/ui/tabPanel/src/main/config/resources/resources-config.xml 2008-01-17 18:24:39 UTC (rev 5458)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
- <resource class="org.richfaces.renderkit.images.TabStripeImage">
- <name>org.richfaces.renderkit.images.TabStripeImage</name>
- </resource>
- <resource class="org.richfaces.renderkit.images.TabGradientA">
- <name>org.richfaces.renderkit.images.TabGradientA</name>
- </resource>
- <resource class="org.richfaces.renderkit.images.TabGradientB">
- <name>org.richfaces.renderkit.images.TabGradientB</name>
- </resource>
-</resource-config>
17 years
JBoss Rich Faces SVN: r5456 - trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-17 12:47:04 -0500 (Thu, 17 Jan 2008)
New Revision: 5456
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
Log:
XCSS Parsing for f:resource registration added
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2008-01-17 16:48:09 UTC (rev 5455)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2008-01-17 17:47:04 UTC (rev 5456)
@@ -32,14 +32,19 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Set;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import org.ajax4jsf.builder.config.BuilderConfig;
import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.ComponentBaseBean;
import org.ajax4jsf.builder.config.RendererBean;
import org.ajax4jsf.templatecompiler.builder.CompilationContext;
import org.ajax4jsf.templatecompiler.builder.CompilationException;
@@ -50,6 +55,9 @@
import org.ajax4jsf.templatecompiler.elements.vcp.HeaderResourceElement;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* @author Nick - mailto:nbelaevski@exadel.com
@@ -260,7 +268,7 @@
try {
// Put common properties
- ResourcesConfigGeneratorBean bean = new ResourcesConfigGeneratorBean();
+ final ResourcesConfigGeneratorBean bean = new ResourcesConfigGeneratorBean();
List<ComponentBean> components = config.getComponents();
for (ComponentBean componentBean : components) {
@@ -274,9 +282,57 @@
addResources(bean, rendererBean, config);
}
+ Set<String> pathResourcesSet = new LinkedHashSet<String>(bean.getPathResources().values());
+ for (Iterator<String> iterator = pathResourcesSet.iterator(); iterator
+ .hasNext();) {
+ String resourcePath = iterator.next();
+
+ if (resourcePath != null && resourcePath.endsWith(".xcss")) {
+ debug("XCSS file detected: " + resourcePath);
+
+ InputStream resourceStream = getClassLoader().getResourceAsStream(resourcePath);
+ if (resourceStream != null) {
+ debug("XCSS file exists in classpath");
+
+ try {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ SAXParser parser = parserFactory.newSAXParser();
+ parser.parse(resourceStream, new DefaultHandler() {
+ @Override
+ public void startElement(String uri,
+ String localName, String name,
+ Attributes attributes)
+ throws SAXException {
+
+ super.startElement(uri, localName, name, attributes);
+
+ if ("f:resource".equals(name)) {
+ String value = attributes.getValue("f:key");
+
+ if (value != null) {
+ debug("Adding resource: " + value);
+
+ addResource(value, "", bean);
+ }
+ }
+ }
+ });
+
+ } finally {
+ try {
+ resourceStream.close();
+ } catch (IOException e) {
+ getLog().error(e.getLocalizedMessage(), e);
+ }
+ }
+ }
+ }
+ }
+
context.put("classResources", bean.getClassResources());
context.put("pathResources", bean.getPathResources());
context.put("resourcesConfig", this);
+
File configFile = getResourcesConfig();
File javaDir = configFile.getParentFile();
if (!javaDir.exists()) {
17 years
JBoss Rich Faces SVN: r5455 - in trunk/docs/userguide/en/src/main: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2008-01-17 11:48:09 -0500 (Thu, 17 Jan 2008)
New Revision: 5455
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
trunk/docs/userguide/en/src/main/resources/images/tree4.png
Log:
http://jira.jboss.com/jira/browse/RF-1137 - rewrote description for tree.
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-01-17 15:59:45 UTC (rev 5454)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-01-17 16:48:09 UTC (rev 5455)
@@ -90,7 +90,7 @@
HtmlTree myTree = new HtmlTree();
...]]></programlisting>
</section>
- <section>
+ <!--section>
<title>Details of Usage</title>
<para>As it has been mentioned <link linkend="tree">above</link> the <emphasis role="bold">
<property><rich:tree></property>
@@ -307,7 +307,298 @@
<property>"ajaxSubmitSelection"</property>
</emphasis>, for instance. </para>
+ </section-->
+
+ <section>
+ <title>Details of Usage</title>
+ <para>As it has been mentioned <link linkend="tree">above</link> the <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component allows rendering any tree-like data model.</para>
+ <para>The component interacts with data model through
+ <property>"TreeNode"</property> interface (<ulink
+ url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..."
+ >org.richfaces.model.TreeNode</ulink>) that is used for tree nodes representation. The <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute of the <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component contains a nodes structure defined in a bean property. The property
+ keeps a structure of objects that implement <property>"TreeNode"</property>
+ interface.</para>
+ <para><property>"TreeNode"</property> has a property
+ <property>"data"</property> (see <ulink
+ url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..."
+ >org.richfaces.model.TreeNode</ulink>). Data contained in the property are placed in a
+ request scope variable, which name is defined with <emphasis>
+ <property>"var"</property>
+ </emphasis> attribute for the <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component.</para>
+ <para>You can develop and use your own implementation for the
+ <property>"TreeNode"</property> interface or use a default implementation,
+ which is defined with a default class <property>"TreeNodeImpl"</property>
+ (<ulink
+ url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..."
+ >org.richfaces.model.TreeNodeImpl</ulink>).</para>
+ <para>There is <property>"XmlTreeDataBuilder"</property> class (<ulink
+ url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..."
+ >org.richfaces.component.xml.XmlTreeDataBuilder</ulink>) that allows transforming XML into
+ structures of objects containing <property>"XmlNodeData"</property> (<ulink
+ url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..."
+ >org.richfaces.component.xml.XmlNodeData</ulink>) instances as data, which could be
+ represented by the <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component.</para>
+ <para>It's possible to define a visual representation of a data model node (to define a
+ node icon) and its behavior in a compliance with data contained in this node (with a value of
+ the <emphasis>
+ <property>"var"</property>
+ </emphasis> attribute). The node behavior is defined by components nested to the <emphasis
+ role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> (it could be links or buttons, for example). For these purposes you should use <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute. For each tree node a value of <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute is evaluated and <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> with a value of <emphasis>
+ <property>"type"</property>
+ </emphasis> attribute equal to a value of <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> is used for node representation. An example is placed below.</para>
+
+ <para id="example">
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ <h:form>
+ <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
+ <rich:treeNode type="artist" iconLeaf="/images/tree/singer.png" icon="/images/tree/singer.png">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" iconLeaf="/images/tree/disc.png" icon="/images/tree/disc.png">
+ <h:outputText value="#{item.title}" />
+ </rich:treeNode>
+ <rich:treeNode type="song" iconLeaf="/images/tree/song.png" icon="/images/tree/song.png">
+ <h:outputText value="#{item.title}" />
+ </rich:treeNode>
+ </rich:tree>
+</h:form>
+...]]></programlisting>
+ <para>This is a result: </para>
+ <figure>
+ <title>The <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute usage</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tree2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>In the example when each node of data model is processed, data contained in the property
+ <property>"data"</property> of
+ <property>"TreeNode"</property> interface are placed in a request scope
+ variable, which name is defined with <emphasis>
+ <property>"var"</property>
+ </emphasis> attribute. The value of the <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute is evaluated in compliance with data placed in the <emphasis>
+ <property>"var"</property>
+ </emphasis> attribute. And for the node representation is used corresponding <emphasis
+ role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> component (with a value of <emphasis>
+ <property>"type"</property>
+ </emphasis> attribute equal to a value of <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis>). For example, during processing of data model an object with name "Chris
+ Rea" was placed in the <emphasis>
+ <property>"var"</property>
+ </emphasis> attribute. Then value of <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute is evaluated as "artist". Thus, for node
+ representation the <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> with <emphasis>
+ <property>"type"</property>
+ </emphasis> equal to "artist" is used.</para>
+ <para>Also you can define an EL-expression as value of the <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute. See an example below: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[nodeFace="#{data.name != 'param-value' ? 'artist' : 'album'}" ]]></programlisting>
+ <para>There are some essential moments in a <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute usage. For their description it's necessary to define notions
+ of a <property>"typeless node"</property> and a <property>"default
+ node"</property>.</para>
+ <para>The <property>typeless node</property> is the first <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> component (from all children nodes nested to the <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component) with not defined <emphasis>
+ <property>"type"</property>
+ </emphasis> attribute and defined <emphasis>
+ <property>"rendered"</property>
+ </emphasis> attribute. The <property>typeless node</property> is used for representation when <emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute is null.</para>
+ <para><property>Default node</property> has the following interior presentation:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[<h: outputText value="#{varAttributeName}">]]></programlisting>
+ <para>
+ <property>"varAttributeName"</property> is a value for <emphasis>
+ <property>"var"</property>
+ </emphasis> attribute. </para>
+ <para><property>Default node</property> is used in the following cases:</para>
+ <itemizedlist>
+ <listitem><emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute is defined, but its value isn't equal to any <emphasis>
+ <property>"type"</property>
+ </emphasis> attribute value from all children nodes;</listitem>
+ <listitem><emphasis>
+ <property>"nodeFace"</property>
+ </emphasis> attribute is defined and its value is equal to a value of some <emphasis>
+ <property>"type"</property>
+ </emphasis> attribute from all children nodes , but the value of <emphasis>
+ <property>"rendered"</property>
+ </emphasis> attribute for this node is
+ <property>"false"</property>.</listitem>
+ </itemizedlist>
+ <para>There is also one especial moment in the <emphasis>
+ <property>"type"</property>
+ </emphasis> and <emphasis>
+ <property>"rendered"</property>
+ </emphasis> attributes usage. It's possible to define several <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> components with the equal values of <emphasis>
+ <property>"type"</property>
+ </emphasis> attribute and different values of <emphasis>
+ <property>"rendered"</property>
+ </emphasis> attribute. It provides the possibility to define different representation for the
+ same nodes type. In the example with artists and their albums (see <link linkend="example"
+ >above</link>) it's possible to represent albums that are available for sale and
+ albums that are not available. An example is placed below:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ <h:form>
+ <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
+ ...
+ <rich:treeNode type="album" iconLeaf="/images/tree/album.gif" icon="/images/tree/album.gif"
+ rendered="#{item.exist}">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" iconLeaf="/images/tree/album_absent.gif" icon="/images/tree/album_absent.gif"
+ rendered="#{not item.exist}">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ ...
+ </rich:tree>
+</h:form>
+...]]></programlisting>
+ <para>This is a result: </para>
+ <figure>
+ <title>The <emphasis>
+ <property>"type"</property>
+ </emphasis> and the <emphasis>
+ <property>"rendered"</property>
+ </emphasis> attributes usage</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tree4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>In the example the <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> components has equal values of the <emphasis>
+ <property>"type"</property>
+ </emphasis> attribute. In a compliance with value of the <emphasis>
+ <property>"rendered"</property>
+ </emphasis> attribute corresponding <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> component is selected for node representation. If an album is available for sale
+ the value of the <emphasis>
+ <property>"rendered"</property>
+ </emphasis> for the first <emphasis>
+ <property><rich:treeNode></property>
+ </emphasis> component is <property>"true"</property>, for the second one is
+ <property>"false"</property>. Thus, the first <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> is selected for node representation. </para>
+ <para>Switching on tree nodes could be performed in three modes. Modes could be specified with <emphasis>
+ <property>"switchType"</property>
+ </emphasis> attribute for<emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component.</para>
+ <itemizedlist>
+ <listitem>Ajax (default value) - Ajax submission is used for switching. Note, that for
+ collapse/expand operations it is sent an Ajax request to the server. It could be seen a
+ short delay in this case.</listitem>
+ <listitem>Server - regular form submission request is used. Note, that all nodes actually
+ render up-front and expanding/collapsing do not require server call.</listitem>
+ <listitem>Client - switching is done as a whole on a client, no interaction with a server
+ presents. Full page content is reloaded after every click.</listitem>
+ </itemizedlist>
+ <para> The <emphasis>
+ <property>"icon"</property>
+ </emphasis>, <emphasis>
+ <property>"iconCollapsed"</property>
+ </emphasis>, <emphasis>
+ <property>"iconExpanded"</property>
+ </emphasis>, <emphasis>
+ <property>"iconLeaf"</property>
+ </emphasis> attributes define icons for the component. Also you can define icons using facets
+ with the same names. If the facets are defined, the corresponding attributes are ignored and
+ facets contents are used as icons. By default the width of a rendered facet area is 16px. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ <rich:tree ....>
+ ...
+ <f:facet name="icon">
+ <h:graphicImage value="/images/tree/singer.png "/>
+ </f:facet>
+ <f:facet name="iconCollapsed">
+ <h:graphicImage value="/images/tree/singer.png " />
+ </f:facet>
+ <f:facet name="iconExpanded">
+ <h:graphicImage value="/images/tree/singer.png " />
+ </f:facet>
+ <f:facet name="iconLeaf">
+ <h:graphicImage value="/images/tree/song.png " />
+ </f:facet>
+ ...
+ </rich:tree>
+...]]></programlisting>
+
+ <para> The <emphasis role="bold">
+ <property><rich: tree></property>
+ </emphasis> component can be used together with <emphasis role="bold">
+ <property><rich: treeNodeAdaptor></property>
+ </emphasis>. In this case there is no need to specify the attributes <emphasis>
+ <property>"value"</property>
+ </emphasis> and <emphasis>
+ <property>"var"</property>
+ </emphasis>. Besides, visual representation shouldn't be defined right in the
+ <property>tree</property>. In this case a tree tag is intended mainly for defining common
+ attributes such as <emphasis>
+ <property>"ajaxSubmitSelection"</property>
+ </emphasis>, for instance. </para>
</section>
+
<section>
<title>Built-In Drag and Drop</title>
<para>The <emphasis role="bold">
@@ -404,8 +695,8 @@
<property>"acceptedTypes"</property>
</emphasis>="song". Its value is equal to the value of the<emphasis>
<property>"type"</property>
- </emphasis>attribute defined for the third treeNode (see picture below).
- Also an album can be dragged into <property>treeNode</property> with <emphasis>
+ </emphasis>attribute defined for the third treeNode (see picture below). Also an album can be
+ dragged into <property>treeNode</property> with <emphasis>
<property>"type"</property>
</emphasis>="artist".</para>
Modified: trunk/docs/userguide/en/src/main/resources/images/tree4.png
===================================================================
(Binary files differ)
17 years