JBoss Rich Faces SVN: r6508 - trunk/samples/sortingFilteringDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-03-03 14:36:04 -0500 (Mon, 03 Mar 2008)
New Revision: 6508
Modified:
trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
Log:
update demo
Modified: trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-03-03 19:29:43 UTC (rev 6507)
+++ trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-03-03 19:36:04 UTC (rev 6508)
@@ -17,7 +17,7 @@
</h:selectOneRadio>
<dt:dataTable id="dataTable" value="#{jiraService.channel.issues}" var="issue" sortMode="#{bean.sortMode}" sortPriority="#{bean.sortPriority}">
<dt:column filterBy="#{issue.key.value}" filterValue="CH-" sortBy="#{issue.key}" width="60px"
- sortOrder="#{bean.sortOrder[0]}">
+ sortOrder="#{bean.sortOrder[0]}" filterEvent="onkeyup">
<f:facet name="header">
<h:outputText value="Key"></h:outputText>
</f:facet>
16 years, 9 months
JBoss Rich Faces SVN: r6507 - in trunk/ui/dataTable/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-03-03 14:29:43 -0500 (Mon, 03 Mar 2008)
New Revision: 6507
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx
Log:
RF-1742
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-03 19:28:47 UTC (rev 6506)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-03 19:29:43 UTC (rev 6507)
@@ -26,6 +26,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.faces.FacesException;
import javax.faces.component.UIColumn;
@@ -438,8 +439,9 @@
@Override
protected void doDecode(FacesContext context, UIComponent component) {
Map<String, String> map = context.getExternalContext().getRequestParameterMap();
- if (SORT_FILTER_PARAMETER.equals(map.get(component.getClientId(context)))) {
- String clientId = map.get(SORT_FILTER_PARAMETER);
+ String clientId = component.getClientId(context);
+ if (SORT_FILTER_PARAMETER.equals(map.get(clientId))) {
+ String sortColumnId = map.get(SORT_FILTER_PARAMETER);
List<UIComponent> list = component.getChildren();
UIDataTable table = (UIDataTable) component;
boolean isSingleSortMode = !"multi".equals(table.getSortMode());
@@ -449,8 +451,8 @@
if (child instanceof org.richfaces.component.UIColumn) {
org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) child;
child.setId(child.getId());
- if (clientId != null) {
- if (clientId.equals(child.getClientId(context))) {
+ if (sortColumnId != null) {
+ if (sortColumnId.equals(child.getClientId(context))) {
String id = child.getId();
Collection<Object> sortPriority = table.getSortPriority();
if (isSingleSortMode) {
@@ -477,9 +479,20 @@
}
AjaxContext.getCurrentInstance()
.addComponentToAjaxRender(component);
+ AjaxContext.getCurrentInstance().addRenderedArea(clientId+ ":tb");
}
}
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException {
+ super.encodeEnd(context, component);
+ String clientId = component.getClientId(context);
+ Set ajaxRenderedAreas = AjaxContext.getCurrentInstance().getAjaxRenderedAreas();
+ if(ajaxRenderedAreas.contains(clientId+ ":tb")) {
+ ajaxRenderedAreas.remove(clientId);
+ }
+ }
protected void addInplaceInput(FacesContext context, UIComponent column,
String buffer) throws IOException {
UIInput filterValueInput = (UIInput) column
Modified: trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx
===================================================================
--- trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx 2008-03-03 19:28:47 UTC (rev 6506)
+++ trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx 2008-03-03 19:29:43 UTC (rev 6507)
@@ -27,7 +27,7 @@
<f:parameter value="value,name,type,id,class,rows,style" />
</f:call>
<f:call name="encodeTableStructure"/>
- <tbody>
+ <tbody id="#{clientId}:tb">
<vcp:body>
<f:call name="encodeRows"/>
</vcp:body>
16 years, 9 months
JBoss Rich Faces SVN: r6506 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-03-03 14:28:47 -0500 (Mon, 03 Mar 2008)
New Revision: 6506
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/sarissa.js
Log:
RF-1742
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/sarissa.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/sarissa.js 2008-03-03 19:26:51 UTC (rev 6505)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/sarissa.js 2008-03-03 19:28:47 UTC (rev 6506)
@@ -494,8 +494,13 @@
return document.createTextNode(oNode.data);
}
else {
- if(oNode.nodeName == "tbody" || oNode.nodeName == "tr"){
- tmp = document.createElement("table");
+ var tagName = "*";
+ if(oNode.nodeName == "tbody" && oNode.parentNode){
+ oNode = oNode.parentNode;
+ tagName = "tbody";
+ }
+ else if(oNode.nodeName == "tbody" || oNode.nodeName == "tr"){
+ tmp = document.createElement("tr");
}
else if(oNode.nodeName == "td"){
tmp = document.createElement("tr");
@@ -503,7 +508,7 @@
else if(oNode.nodeName == "option"){
tmp = document.createElement("select");
}
- else{
+ if(!tmp){
tmp = document.createElement("div");
}
if(bChildren){
@@ -511,7 +516,7 @@
}else{
tmp.innerHTML = oNode.xml ? oNode.cloneNode(false).xml : oNode.cloneNode(false).outerHTML;
}
- return tmp.getElementsByTagName("*")[0];
+ return tmp.getElementsByTagName(tagName)[0];
}
};
}catch(e){ }
16 years, 9 months
JBoss Rich Faces SVN: r6505 - in trunk/ui: pickList/src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vsukhov
Date: 2008-03-03 14:26:51 -0500 (Mon, 03 Mar 2008)
New Revision: 6505
Modified:
trunk/ui/combobox/src/main/config/component/combobox.xml
trunk/ui/pickList/src/main/config/component/picklist.xml
Log:
http://jira.jboss.com/jira/browse/RF-1216
http://jira.jboss.com/jira/browse/RF-2174
I've filled the attribute table for comboBox and pickList
Modified: trunk/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/ui/combobox/src/main/config/component/combobox.xml 2008-03-03 18:30:05 UTC (rev 6504)
+++ trunk/ui/combobox/src/main/config/component/combobox.xml 2008-03-03 19:26:51 UTC (rev 6505)
@@ -31,6 +31,7 @@
<property>
<name>suggestionValues</name>
<classname>java.lang.Object</classname>
+ <description>Defines the suggestion collection</description>
</property>
<property>
<name>enableManualInput</name>
@@ -41,77 +42,57 @@
<property>
<name>filterNewValues</name>
<classname>java.lang.Boolean</classname>
- <description></description>
+ <description>defines the appearance of values in the list</description>
<defaultvalue>true</defaultvalue>
</property>
- <property>
+ <property >
<name>directInputSuggestions</name>
<classname>java.lang.Boolean</classname>
- <description>not implemented</description>
+ <description>Defines the first value from the suggested in input field</description>
<defaultvalue>false</defaultvalue>
</property>
<property>
<name>selectFirstOnUpdate</name>
<classname>java.lang.Boolean</classname>
- <description></description>
+ <description>Defines of the first value from suggested is selected in popup list</description>
<defaultvalue>true</defaultvalue>
</property>
<property>
<name>showDelay</name>
<classname>java.lang.Integer</classname>
- <description></description>
+ <description>Delay between event and popup list showing</description>
<defaultvalue><![CDATA[0]]></defaultvalue>
</property>
<property>
<name>hideDelay</name>
<classname>java.lang.Integer</classname>
- <description></description>
+ <description>Delay between losing focus and popup list closing</description>
<defaultvalue><![CDATA[0]]></defaultvalue>
</property>
<property>
<name>width</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Width of the popup list</description>
<defaultvalue><![CDATA["150"]]></defaultvalue>
</property>
+
+
<property>
- <name>width</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue><![CDATA["150"]]></defaultvalue>
- </property>
- <property>
- <name>listWidth</name>
- <classname>java.lang.String</classname>
- <description></description>
- </property>
- <property>
- <name>listHeight</name>
- <classname>java.lang.String</classname>
- <description></description>
- <defaultvalue>"200px"</defaultvalue>
- </property>
- <property>
- <name>inputSize</name>
- <classname>java.lang.String</classname>
- <description></description>
- </property>
- <property>
<name>onchange</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>HTML: a script expression; an item is selected</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>onlistcall</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>HTML: a script expression; a list is called</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>onitemselected</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>HTML: a script expression; an item is selected</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -123,113 +104,114 @@
<property>
<name>buttonIcon</name>
<classname>java.lang.String</classname>
- <description>URI</description>
+ <description>Defines icon for the button element</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>buttonIconDisabled</name>
<classname>java.lang.String</classname>
- <description>URI</description>
+ <description>Defines disabled icon for the button element</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>buttonIconInactive</name>
<classname>java.lang.String</classname>
- <description>URI</description>
+ <description>Defines inactive icon for the button element</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>defaultLabel</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Defines default label for the input field element</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>listStyle</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style rules to be applied to popup list</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>listClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the popup list</description>
</property>
+
<property>
<name>inputStyle</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style rules to be applied to input field</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>inputClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the input field</description>
</property>
<property>
<name>inputDisabledStyle</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style rules to be applied to disabled input</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>inputDisabledClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the disabled input</description>
</property>
<property>
<name>inputInactiveStyle</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style rules to be applied to inactive input</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>inputInactiveClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the inactive input</description>
</property>
<property>
<name>itemClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the items</description>
</property>
<property>
<name>buttonStyle</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style rules to be applied to button</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>buttonClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the button</description>
</property>
<property>
<name>buttonDisabledStyle</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style rules to be applied to disabled button</description>
</property>
<property>
<name>buttonDisabledClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the disabled button</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>buttonInactiveStyle</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style rules to be applied to inactive button</description>
</property>
<property>
<name>buttonInactiveClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Style Class attribute for the inactive button</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>style</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>CSS style(s) is/are to be applied when this component is rendered</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property hidden="true">
@@ -239,9 +221,36 @@
<property>
<name>styleClass</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>Corresponds to the HTML class attribute</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
+ </property>
+ <property>
+ <name>converterMessage</name>
+ <classname>java.lang.String</classname>
+ <description>A ValueExpression enabled attribute that, if present,
+ will be used as the text of the converter message, replacing any message that comes from the converter</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>localValueSet</name>
+ <classname>boolean</classname>
+ <description>A ValueExpression enabled attribute that, if present,
+ will be used as the text of the converter message, replacing any message that comes from the converter</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>validatorMessage</name>
+ <classname>java.lang.String</classname>
+ <description>A ValueExpression enabled attribute that,
+ if present, will be used as the text of the validator message, replacing any message that comes from the validator</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>requiredMessage</name>
+ <classname>java.lang.String</classname>
+ <description>A ValueExpression enabled attribute that, if present,
+ will be used as the text of the validation message for the "required" facility, if the "required" facility is used</description>
+ </property>
&html_input_attributes;
&html_input_events;
Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml 2008-03-03 18:30:05 UTC (rev 6504)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml 2008-03-03 19:26:51 UTC (rev 6505)
@@ -39,41 +39,52 @@
<name>valueChangeListener</name>
<classname>javax.el.MethodExpression</classname>
<methodargs> javax.faces.event.ValueChangeEvent</methodargs>
- </property>
+ <description>Listener for value changes</description>
+ </property>
<property>
<name>validator</name>
<classname>javax.el.MethodExpression</classname>
<methodargs>javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object</methodargs>
+ <description>
+ MethodBinding pointing at a method that is called during
+ Process Validations phase of the request processing lifecycle,
+ to validate the current value of this component
+ </description>
</property>
<property>
<name>showButtonsLabel</name>
<classname>java.lang.String</classname>
<defaultvalue>"true"</defaultvalue>
+ <description>Shows a label for a button</description>
</property>
<property>
<name>copyAllControlLabel</name>
<classname>java.lang.String</classname>
+ <description>Defines a label for a copyAll control</description>
<defaultvalue>""</defaultvalue>
</property>
<property>
<name>copyControlLabel</name>
<classname>java.lang.String</classname>
+ <description>Defines a label for a copy control</description>
<defaultvalue>""</defaultvalue>
</property>
<property>
<name>removeControlLabel</name>
<classname>java.lang.String</classname>
+ <description>Defines a label for a remove control</description>
<defaultvalue>""</defaultvalue>
</property>
<property>
<name>removeAllControlLabel</name>
<classname>java.lang.String</classname>
+ <description>Defines a label for a removeAll control</description>
<defaultvalue>""</defaultvalue>
</property>
@@ -116,6 +127,121 @@
&html_control_events;
<property>
+ <name>converter</name><classname>java.lang.String</classname><description>Id of Converter to be used or reference to a Converter</description>
+ </property>
+ <property>
+ <name>converterMessage</name>
+ <classname>java.lang.String</classname>
+ <description>A ValueExpression enabled attribute that, if present, will be used as the text of the converter message, replacing any message that comes from the converter</description>
+
+ </property>
+
+
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If "true", controls is disabled. "false" is default</description>
+
+ </property>
+
+ <property>
+ <name>disabledStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to disabled controls</description>
+
+ </property>
+
+ <property>
+ <name>disabledStyleClass</name>
+ <classname>java.lang.String</classname>
+ <description>The disabledStyleClass for disabled controls</description>
+
+ </property>
+ <property>
+ <name>enabledStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style rules to be applied to enabled controls</description>
+
+ </property>
+
+ <property>
+ <name>enabledStyleClass</name>
+ <classname>java.lang.String</classname>
+ <description>The enabledStyleClass for enabled controls</description>
+ </property>
+
+ <property>
+ <name>immediate</name>
+ <classname>boolean</classname>
+ <description>
+ A flag indicating that this component value must be converted
+ and validated immediately (that is, during Apply Request Values
+ phase), rather than waiting until a Process Validations phase
+ </description>
+ </property>
+
+ <property>
+ <name>localValueSet</name>
+ <classname>java.lang.String</classname>
+ <description>Id of Converter to be used or reference to a Converter</description>
+
+ </property>
+
+ <property>
+ <name>moveControlsVerticalAlign</name>
+ <classname>java.lang.String</classname>
+ <description>Customizes vertically a position of move/copy controls relatively to lists</description>
+
+ </property>
+
+
+
+
+ <property>
+ <name>required</name>
+ <classname>boolean</classname>
+ <description>
+ If "true", this component is checked for non-empty input
+ </description>
+ </property>
+
+ <property>
+ <name>requiredMessage</name>
+ <classname>java.lang.String</classname>
+ <description>A ValueExpression enabled attribute that, if present, will be used as the text of the validation message for the "required" facility, if the "required" facility is used</description>
+
+ </property>
+
+
+ <property>
+ <name>size</name>
+ <classname>int</classname>
+ <description>This attribute tells the user agent the initial width of the control. The width is given in pixels except when type attribute has the value "text" or "password". In that case, its value refers to the (integer) number of characters</description>
+ </property>
+ <property>
+ <name>valid</name>
+ <classname>java.lang.String</classname>
+ <description>Id of Converter to be used or reference to a Converter</description>
+
+ </property>
+
+ <property>
+ <name>validatorMessage</name>
+ <classname>java.lang.String</classname>
+ <description>A ValueExpression enabled attribute that, if present, will be used as the text of the validator message, replacing any message that comes from the validator</description>
+
+ </property>
+ <property>
+ <name>value</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ The initial value to set when rendered for the first time
+ </description>
+ </property>
+
+
+
+ <property>
<name>listClass</name>
<classname>java.lang.String</classname>
<description>CSS class for a list</description>
16 years, 9 months
JBoss Rich Faces SVN: r6504 - trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-03 13:30:05 -0500 (Mon, 03 Mar 2008)
New Revision: 6504
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
shift+tab support
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-03 18:17:58 UTC (rev 6503)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-03 18:30:05 UTC (rev 6504)
@@ -170,6 +170,7 @@
if (this.bar) {
this.bar.hide();
}
+ this.tabber.show();
this.tempValueKeeper.hide();
},
@@ -181,6 +182,8 @@
this.changeState(Richfaces.InplaceInput.STATES[1]);
var inputSize = this.setInputWidth(textSize);
+ this.tabber.hide();
+
this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
this.setStrutWidth();
this.tempValueKeeper.show();
16 years, 9 months
JBoss Rich Faces SVN: r6503 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-03-03 13:17:58 -0500 (Mon, 03 Mar 2008)
New Revision: 6503
Modified:
trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml
trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
http://jira.jboss.com/jira/browse/RF-926 - updated code for tree, changeExpandListener,nodeSelectListener,recursiveTreeNodesAdaptor; corrected code for toolTip(example of using "div" attributes)
Modified: trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml 2008-03-03 18:17:33 UTC (rev 6502)
+++ trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml 2008-03-03 18:17:58 UTC (rev 6503)
@@ -47,8 +47,7 @@
<title>Creating the Component Dynamically Using Java</title>
<para>
<emphasis role="bold">Example:</emphasis></para>
- <programlisting role="JAVA"><![CDATA[package demo;
-
+ <programlisting role="JAVA"><![CDATA[package demo;
public class ImplBean implements org.richfaces.event.NodeSelectListener{
...
}
@@ -94,9 +93,7 @@
</para>
<programlisting role="JAVA"><![CDATA[package demo;
-
import org.richfaces.event.NodeSelectedEvent;
-
public class ListenerBean implements org.richfaces.event.NodeSelectedListener{
...
public void processSelection(NodeSelectedEvent arg0){
Modified: trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml 2008-03-03 18:17:33 UTC (rev 6502)
+++ trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml 2008-03-03 18:17:58 UTC (rev 6503)
@@ -57,8 +57,7 @@
...
<rich:treeNode>
<!-- node content -->
- </rich:treeNode>
-
+ </rich:treeNode>
<!-- Others nodes -->
...
</rich:recursiveTreeNodesAdaptor>
@@ -86,41 +85,32 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
- <rich:treeNodesAdaptor id="project" nodes="#{loaderBean.projects}" var="project">
-
+ <rich:treeNodesAdaptor id="project" nodes="#{loaderBean.projects}" var="project">
<rich:treeNode>
<h:commandLink action="#{project.click}" value="Project: #{project.name}" />
</rich:treeNode>
-
<rich:recursiveTreeNodesAdaptor id="dir" var="dir" root="#{project.dirs}" nodes="#{dir.directories}">
-
<rich:treeNode>
<h:commandLink action="#{dir.click}" value="Directory: #{dir.name}" />
- </rich:treeNode>
-
+ </rich:treeNode>
<rich:treeNodesAdaptor id="file" var="file" nodes="#{dir.files}">
<rich:treeNode>
<h:commandLink action="#{file.click}" value="File: #{file.name}" />
</rich:treeNode>
</rich:treeNodesAdaptor>
-
<rich:treeNodesAdaptor id="file1" var="file" nodes="#{dir.files}">
<rich:treeNode>
<h:commandLink action="#{file.click}" value="File1: #{file.name}" />
</rich:treeNode>
</rich:treeNodesAdaptor>
-
<rich:recursiveTreeNodesAdaptor id="archiveEntry" var="archiveEntry"
roots="#{dir.files}" nodes="#{archiveEntry.archiveEntries}"
includedRoot="#{archiveEntry.class.simpleName == 'ArchiveFile'}"
- includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">
-
+ includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">
<rich:treeNode id="archiveEntryNode">
<h:commandLink action="#{archiveEntry.click}" value="Archive entry: #{archiveEntry.name}" />
</rich:treeNode>
-
</rich:recursiveTreeNodesAdaptor>
-
</rich:recursiveTreeNodesAdaptor>
</rich:treeNodesAdaptor>
</rich:tree>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-03-03 18:17:33 UTC (rev 6502)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-03-03 18:17:58 UTC (rev 6503)
@@ -274,7 +274,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[...
+ <programlisting role="XML"><![CDATA[...
<rich:tree ....>
...
<f:facet name="icon">
@@ -428,7 +428,9 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[nodeFace="#{data.name != 'param-value' ? 'artist' : 'album'}" ]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[
+nodeFace="#{data.name != 'param-value' ? 'artist' : 'album'}"
+ ]]></programlisting>
<para>There are some essential points in a <emphasis>
<property>"nodeFace"</property>
</emphasis> attribute usage: you need to define notions for <property>typeless</property> and a <property>default</property> nodes.
@@ -449,9 +451,11 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[<h: outputText value="#{varAttributeName}">]]></programlisting>
+ <programlisting role="XML"><![CDATA[...
+<h:outputText value="#{varAttributeName}">
+...]]></programlisting>
<para>
- <property>"varAttributeName"</property> is a value for <emphasis>
+ <emphasis><property>"varAttributeName"</property></emphasis> is a value for <emphasis>
<property>"var"</property>
</emphasis> attribute. </para>
<para><property>Default node</property> is used in the following cases:</para>
@@ -875,8 +879,9 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:tree ... styleClass="myClass"/>
-]]></programlisting>
+ <programlisting role="CSS"><![CDATA[...
+<rich:tree ... styleClass="myClass"/>
+...]]></programlisting>
<para>This is a result:</para>
16 years, 9 months
JBoss Rich Faces SVN: r6502 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-03-03 13:17:33 -0500 (Mon, 03 Mar 2008)
New Revision: 6502
Modified:
trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml
trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
Log:
http://jira.jboss.com/jira/browse/RF-672 - corrected names of attributes and components for toolTip and changeExpandListener
http://jira.jboss.com/jira/browse/RF-926 - updated code for tree, changeExpandListener,nodeSelectListener,recursiveTreeNodesAdaptor; corrected code for toolTip(example of using "div" attributes)
Modified: trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml 2008-03-03 18:08:02 UTC (rev 6501)
+++ trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml 2008-03-03 18:17:33 UTC (rev 6502)
@@ -48,14 +48,12 @@
<para>
<emphasis role="bold">Example:</emphasis></para>
<programlisting role="JAVA"><![CDATA[package demo;
-
public class ImplBean implements org.richfaces.event.NodeExpandedListener{
...
}
]]></programlisting>
- <programlisting role="JAVA"><![CDATA[
-import demo.ImplBean;
+ <programlisting role="JAVA"><![CDATA[import demo.ImplBean;
...
ImplBean myListener = new ImplBean();
...
@@ -94,9 +92,7 @@
</para>
<programlisting role="JAVA"><![CDATA[package demo;
-
import org.richfaces.event.NodeExpandedEvent;
-
public class ListenerBean implements org.richfaces.event.NodeExpandedListener{
...
public void processExpansion(NodeExpandedEvent arg0){
@@ -104,7 +100,7 @@
}
...
}
-]]></programlisting>
+...]]></programlisting>
</section>
<section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-03-03 18:08:02 UTC (rev 6501)
+++ trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-03-03 18:17:33 UTC (rev 6502)
@@ -72,7 +72,7 @@
<title>Details of Usage</title>
<para>
<property>toolTip</property> main area is a simple rectangle area with any information inside. The content may be defined via
-"value" attribute as text or via any nested content. When both are defined, the value is displayed as text and nested content
+<emphasis><property>"value"</property></emphasis> attribute as text or via any nested content. When both are defined, the value is displayed as text and nested content
after the text. <property>toolTip</property> stretches if the content more than the <property>toolTip</property> sizes.
</para>
<para>
@@ -87,7 +87,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<h:commandLink value="Simple Link">
+<h:commandLink value="Simple Link" id="link">
<rich:toolTip followMouse="true" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5"
verticalOffset="5" layout="block">
<f:facet name="defaultContent">
@@ -122,18 +122,18 @@
</figure>
<para>
By default, <property>toolTip</property> appears smart positioned. But as you can see from the previous example, you
-can define an appearance direction via the corresponding attribute "direction". And also it's possible to define vertical and horizontal
+ can define an appearance direction via the corresponding attribute <emphasis><property>"direction"</property></emphasis>. And also it's possible to define vertical and horizontal
offsets relatively to a mouse position.
</para>
<para>
<property>toolTip</property> appears attached to the corner dependent on the <emphasis><property>"direction"</property></emphasis> attribute. By default it is positioned bottom-right.
<property>toolTip</property> activation occurs after a defined event (default=mouseover) on the parent component takes into consideration
-the "delay" attribute (default=0) or after calling JS API function Show(). <property>toolTip</property> deactivation occurs after mouseout event on the parent component (excepting the situation when the mouse is hovered onto the <property>toolTip</property> itself) or after calling JS API function Hide().
+the "delay" attribute (default=0) or after calling JS API function show(). <property>toolTip</property> deactivation occurs after mouseout event on the parent component (excepting the situation when the mouse is hovered onto the <property>toolTip</property> itself) or after calling JS API function hide().
</para>
<note>
<title>Note:</title>
-It is recommended to define parent component "id" for correction of <property>toolTip</property> work.
+ It is recommended to define parent component <emphasis><property>"id"</property></emphasis> for correction of <property>toolTip</property> work.
</note>
<para>The attribute <emphasis><property>"for"</property></emphasis> is used for defining the <emphasis><property>"id"</property></emphasis> of an element a toolTip should be attached to. Look at the example:
@@ -144,14 +144,14 @@
</para>
<programlisting role="XML"><![CDATA[...
<div id="elementId">
- <rich:toolTip for="elementId">Using a toolTip<rich:toolTip>
- <p>The first simple example<p>
+ <rich:toolTip for="elementId">Using a toolTip</rich:toolTip>
+ <p>The first simple example</p>
</div>
...
<div id="elementId">
- <p>The second simple example<p>
+ <p>The second simple example</p>
</div>
-<rich:toolTip for="elementId">Using a toolTip<rich:toolTip>
+<rich:toolTip for="elementId">Using a toolTip</rich:toolTip>
...
]]></programlisting>
16 years, 9 months
JBoss Rich Faces SVN: r6501 - in trunk: ui/contextMenu/src/main/config/component and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-03 13:08:02 -0500 (Mon, 03 Mar 2008)
New Revision: 6501
Modified:
trunk/samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
trunk/ui/contextMenu/src/main/config/component/contextMenu.xml
trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml
trunk/ui/menu-components/src/main/config/component/menucomponents.xml
trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java
trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1650
90% completed.
Modified: trunk/samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2008-03-03 18:08:02 UTC (rev 6501)
@@ -5,7 +5,13 @@
<html>
<head>
- <style type="text/css">
+ <style type="text/css">
+ .disabled_item {
+ border: 1px solid blue;
+ }
+ .select_item {
+ border: 1px dashed red;
+ }
</style>
</head>
@@ -17,8 +23,21 @@
<h:commandLink action="#{skinBean.change}" value="set skin"/>
<h:panelGrid id="grid" columns="2" cellspacing="4">
- <ddm:dropDownMenu event="#{bean.event}" id="MenuItem1" verticalOffset="#{bean.verticalOffset}" horizontalOffset="#{bean.horizontalOffset}" popupWidth="#{bean.width}" value="Item1" jointPoint="#{bean.jointPoint}" direction="#{bean.direction}">
- <mc:menuItem id="menuItem11" value="Active11: ajax" submitMode="ajax" actionListener="#{bean.actionListener}"/>
+ <ddm:dropDownMenu event="#{bean.event}" id="MenuItem1"
+ verticalOffset="#{bean.verticalOffset}"
+ horizontalOffset="#{bean.horizontalOffset}"
+ popupWidth="#{bean.width}"
+ value="Item One"
+ jointPoint="#{bean.jointPoint}"
+ direction="#{bean.direction}"
+
+ disabledItemStyle="color: green;"
+ disabledItemClass="disabled_item"
+ selectItemClass="select_item"
+ itemStyle="font-weight: bold;">
+ <mc:menuItem id="menuItem11" value="Active11: ajax"
+ submitMode="ajax" actionListener="#{bean.actionListener}"
+ disabled="true" />
<mc:menuItem id="menuItem12" value="Active12" actionListener="#{bean.actionListener}" immediate="true"/>
<mc:menuItem id="menuItem13" value="Active13" action="#{bean.action}" icon="/images/ico1.gif"/>
<mc:menuItem id="menuItem14" value="Active14"/>
Modified: trunk/ui/contextMenu/src/main/config/component/contextMenu.xml
===================================================================
--- trunk/ui/contextMenu/src/main/config/component/contextMenu.xml 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/contextMenu/src/main/config/component/contextMenu.xml 2008-03-03 18:08:02 UTC (rev 6501)
@@ -145,7 +145,8 @@
<classname>java.lang.String</classname>
<description>
Space-separated list of CSS style class(es) that are be applied to selected item of this component.
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -153,7 +154,8 @@
<classname>java.lang.String</classname>
<description>
CSS style(s) is/are to be applied to disabled item when this component is rendered.
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -161,7 +163,8 @@
<classname>java.lang.String</classname>
<description>
Space-separated list of CSS style class(es) that are be applied to disabled item of this component
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -169,7 +172,8 @@
<classname>java.lang.String</classname>
<description>
CSS style(s) is/are to be applied to item when this component is rendered.
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -177,7 +181,8 @@
<classname>java.lang.String</classname>
<description>
Space-separated list of CSS style class(es) that are be applied to item of this component
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
Modified: trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml
===================================================================
--- trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/dropdown-menu/src/main/config/component/dropdownmenu.xml 2008-03-03 18:08:02 UTC (rev 6501)
@@ -153,7 +153,8 @@
<classname>java.lang.String</classname>
<description>
Space-separated list of CSS style class(es) that are be applied to selected item of this component.
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -161,7 +162,8 @@
<classname>java.lang.String</classname>
<description>
CSS style(s) is/are to be applied to disabled item when this component is rendered.
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -169,7 +171,8 @@
<classname>java.lang.String</classname>
<description>
Space-separated list of CSS style class(es) that are be applied to disabled item of this component
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -177,7 +180,8 @@
<classname>java.lang.String</classname>
<description>
CSS style(s) is/are to be applied to item when this component is rendered.
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -185,7 +189,8 @@
<classname>java.lang.String</classname>
<description>
Space-separated list of CSS style class(es) that are be applied to item of this component
- </description>
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
Modified: trunk/ui/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2008-03-03 18:08:02 UTC (rev 6501)
@@ -124,24 +124,25 @@
<property>
<name>selectStyle</name>
<classname>java.lang.String</classname>
- <description>CSS style rules to be applied to selected
- items</description>
+ <description>CSS style rules to be applied to selected items</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>selectClass</name>
<classname>java.lang.String</classname>
- <description>Class to be applied to selected items</description>
+ <description>Class to be applied to selected items</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>iconStyle</name>
<classname>java.lang.String</classname>
- <description>CSS style rules to be applied to icon
- element</description>
+ <description>CSS style rules to be applied to icon element</description>
</property>
<property>
<name>iconClass</name>
<classname>java.lang.String</classname>
- <description>Class to be applied to icon element</description>
+ <description>Class to be applied to icon element</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>converter</name>
@@ -260,24 +261,26 @@
<property>
<name>selectClass</name>
<classname>java.lang.String</classname>
- <description>Class to be applied to selected items</description>
+ <description>Class to be applied to selected items</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>selectStyle</name>
<classname>java.lang.String</classname>
- <description>CSS style rules to be applied to selected
- items</description>
+ <description>CSS style rules to be applied to selected items</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>iconClass</name>
<classname>java.lang.String</classname>
- <description>Class to be applied to icon element</description>
+ <description>Class to be applied to icon element</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>iconStyle</name>
<classname>java.lang.String</classname>
- <description>CSS style rules to be applied to icon
- element</description>
+ <description>CSS style rules to be applied to icon element</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
&ajax_component_attributes;
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuGroup.java 2008-03-03 18:08:02 UTC (rev 6501)
@@ -45,4 +45,10 @@
public abstract String getIconFolderDisabled();
public abstract void setIconFolderDisabled(String icon);
+
+ public abstract String getStyleClass();
+ public abstract void setStyleClass(String styleClass);
+
+ public abstract String getStyle();
+ public abstract void setStyle(String style);
}
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java 2008-03-03 18:08:02 UTC (rev 6501)
@@ -51,5 +51,10 @@
public abstract boolean isDisabled();
public abstract void setDisabled(boolean disabled);
+
+ public abstract String getStyleClass();
+ public abstract void setStyleClass(String styleClass);
+ public abstract String getStyle();
+ public abstract void setStyle(String style);
}
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2008-03-03 18:08:02 UTC (rev 6501)
@@ -23,6 +23,8 @@
import java.io.IOException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import org.ajax4jsf.renderkit.ComponentVariables;
@@ -51,14 +53,39 @@
public void initializeStyleClasses(FacesContext context, UIMenuGroup menuGroup) {
ComponentVariables variables =
ComponentsVariableResolver.getVariables(this, menuGroup);
+ UIComponent parentMenu = getParentMenu(context, menuGroup);
+ Object itemClass = parentMenu.getAttributes().get("itemClass");
+ Object itemStyle = parentMenu.getAttributes().get("itemStyle");
+ Object disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
+ Object disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
+
+ if (null == itemClass) {
+ itemClass = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+ if (null == disabledItemClass) {
+ disabledItemClass = "";
+ }
+ if (null == disabledItemStyle) {
+ disabledItemStyle = "";
+ }
+
if (menuGroup.isDisabled()) {
- variables.setVariable("menuGroupClass", "dr-menu-item-disabled rich-menu-group-disabled");
+ variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-disabled rich-menu-group rich-menu-group-disabled " +
+ itemClass + " " + disabledItemClass + " " + menuGroup.getStyleClass());
+ variables.setVariable("menuGroupStyle",
+ itemStyle + "; " + disabledItemStyle + "; " + menuGroup.getStyle());
variables.setVariable("menuGroupMouseMove", "");
variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-disabled");
variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label-disabled");
variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder-disabled");
} else {
- variables.setVariable("menuGroupClass", "dr-menu-item-enabled");
+ variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-enabled rich-menu-group " +
+ itemClass + " " + menuGroup.getStyleClass());
+ variables.setVariable("menuGroupStyle",
+ itemStyle + "; " + menuGroup.getStyle());
variables.setVariable("menuGroupMouseMove", menuGroup.getAttributes().get("onmousemove"));
variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-enabled");
variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label");
@@ -105,4 +132,16 @@
String actualIconFolder = menuGroup.isDisabled() ? iconFolderDisabled : iconFolder;
variables.setVariable("actualIconFolder", actualIconFolder);
}
+
+ protected UIComponent getParentMenu(FacesContext context, UIMenuGroup menuGroup) {
+ UIComponent parent = menuGroup.getParent();
+ while (null != parent) {
+ if (parent instanceof org.richfaces.component.MenuComponent) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ throw new FacesException( "Parent menu for menu group (id="
+ + menuGroup.getClientId(context) + ") has not been found.");
+ }
}
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2008-03-03 18:08:02 UTC (rev 6501)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIParameter;
import javax.faces.context.ExternalContext;
@@ -34,7 +35,6 @@
import javax.faces.event.ActionEvent;
import javax.faces.event.PhaseId;
-import org.ajax4jsf.Messages;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
@@ -246,10 +246,22 @@
Object style = menuItem.getAttributes().get("style");
Object selectStyle = menuItem.getAttributes().get("selectStyle");
+ UIComponent parentMenu = getParentMenu(context, menuItem);
+ Object selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
+ Object itemStyle = parentMenu.getAttributes().get("itemStyle");
+
if (null == selectStyle) {
- return "";
+ selectStyle = "";
}
+ if (null == selectItemStyle) {
+ selectItemStyle = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+ selectStyle = itemStyle + "; " + selectItemStyle + "; " + selectStyle;
+
buffer.append("$('" + menuItem.getClientId(context) + "').style.cssText='");
if (null != style) {
@@ -259,9 +271,75 @@
if (isOnmouseover) {
buffer.append(selectStyle.toString() + ";';");
} else {
- buffer.append("';");
+ buffer.append(itemStyle.toString() + ";';");
}
return buffer.toString();
}
+
+ protected UIComponent getParentMenu(FacesContext context, UIMenuItem menuItem) {
+ UIComponent parent = menuItem.getParent();
+ while (null != parent) {
+ if (parent instanceof org.richfaces.component.MenuComponent) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ throw new FacesException( "Parent menu for menu item (id="
+ + menuItem.getClientId(context) + ") has not been found.");
+ }
+
+ public void initializeStyles(FacesContext context, UIMenuItem menuItem) {
+ ComponentVariables variables =
+ ComponentsVariableResolver.getVariables(this, menuItem);
+ UIComponent parentMenu = getParentMenu(context, menuItem);
+ Object itemClass = parentMenu.getAttributes().get("itemClass");
+ Object itemStyle = parentMenu.getAttributes().get("itemStyle");
+ Object disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
+ Object disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
+ Object selectItemClass = parentMenu.getAttributes().get("selectItemClass");
+ Object selectClass = menuItem.getAttributes().get("selectClass");
+ Object styleClass = menuItem.getStyleClass();
+
+ if (null == itemClass) {
+ itemClass = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+ if (null == disabledItemClass) {
+ disabledItemClass = "";
+ }
+ if (null == disabledItemStyle) {
+ disabledItemStyle = "";
+ }
+ if (null == selectItemClass) {
+ selectItemClass = "";
+ }
+ if (null == styleClass) {
+ styleClass = "";
+ }
+ if (null == selectClass) {
+ selectClass = "";
+ }
+
+ if (menuItem.isDisabled()) {
+ variables.setVariable("menuItemClass",
+ "dr-menu-item dr-menu-item-disabled rich-menu-item rich-menu-item-disabled " +
+ menuItem.getStyleClass() + " " +
+ itemClass + " " + disabledItemClass);
+ variables.setVariable("menuItemStyle",
+ itemStyle + "; " + disabledItemStyle + "; " + menuItem.getStyle());
+ } else {
+ variables.setVariable("menuItemClass",
+ "dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled " +
+ styleClass + " " + itemClass);
+ variables.setVariable("menuItemStyle",
+ itemStyle + "; " + menuItem.getStyle());
+ variables.setVariable("menuItemHoverClass",
+ "this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover " +
+ styleClass + " " + selectClass +
+ selectItemClass + "';");
+ }
+ }
}
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-03-03 18:08:02 UTC (rev 6501)
@@ -24,7 +24,7 @@
<div id="ref#{clientId}"
- class="dr-menu-item #{menuGroupClass} rich-menu-group #{component.attributes['styleClass']}"
+ class="#{menuGroupClass}"
style="#{component.attributes['style']}"
onmousemove="#{menuGroupMouseMove}">
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-03 17:07:08 UTC (rev 6500)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-03 18:08:02 UTC (rev 6501)
@@ -26,18 +26,21 @@
]]>
</jsp:scriptlet>
- <f:call name="initializeResources" />
+ <f:call name="initializeResources" />
+
+ <f:call name="initializeStyles" />
<f:clientid var="clientId"/>
<jsp:scriptlet><![CDATA[
- if (((org.richfaces.component.UIMenuItem) component).isDisabled()) {
+ if (((org.richfaces.component.UIMenuItem) component).isDisabled()) {
+
]]></jsp:scriptlet>
<div id="#{clientId}"
- class="dr-menu-item dr-menu-item-disabled rich-menu-item rich-menu-item-disabled #{component.attributes['styleClass']}"
- style="#{component.attributes['style']}"
+ class="#{menuItemClass}"
+ style="#{menuItemStyle}"
onclick="Event.stop(event || window.event);">
<jsp:scriptlet><![CDATA[
@@ -52,16 +55,16 @@
]]></jsp:scriptlet>
<div id="#{clientId}"
- class="dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled #{component.attributes['styleClass']}"
- onmouseout="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled #{component.attributes['styleClass']}';
+ class="#{menuItemClass}"
+ onmouseout="this.className='#{menuItemClass}';
#{onmouseoutInlineStyles}
$('#{clientId}:icon').className='dr-menu-icon rich-menu-item-icon #{component.attributes['iconClass']}';
$('#{clientId}:anchor').className='rich-menu-item-label';"
- onmouseover="this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover #{component.attributes['styleClass']} #{component.attributes['selectClass']}';
+ onmouseover="#{menuItemHoverClass};
#{onmouseoverInlineStyles}
$('#{clientId}:icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected #{component.attributes['iconClass']}';
$('#{clientId}:anchor').className='rich-menu-item-label rich-menu-item-label-selected';"
- style="#{component.attributes['style']}"
+ style="#{menuItemStyle}"
onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled #{component.attributes['styleClass']}'; #{onselect} #{onclick}; Event.stop(event);"
onmouseup="Event.stop(event); #{component.attributes['onmouseup']}">
<f:call name="utils.encodeAttributes">
16 years, 9 months
JBoss Rich Faces SVN: r6500 - management/design/userComponentCSS/markup.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-03-03 12:07:08 -0500 (Mon, 03 Mar 2008)
New Revision: 6500
Added:
management/design/userComponentCSS/markup/btn_bg.gif
management/design/userComponentCSS/markup/btn_press_bg.gif
management/design/userComponentCSS/markup/input_bg.gif
management/design/userComponentCSS/markup/input_error.gif
management/design/userComponentCSS/markup/rich-styles-example.html
Modified:
management/design/userComponentCSS/markup/rich-styles.css
Log:
Added: management/design/userComponentCSS/markup/btn_bg.gif
===================================================================
(Binary files differ)
Property changes on: management/design/userComponentCSS/markup/btn_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/userComponentCSS/markup/btn_press_bg.gif
===================================================================
(Binary files differ)
Property changes on: management/design/userComponentCSS/markup/btn_press_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/userComponentCSS/markup/input_bg.gif
===================================================================
(Binary files differ)
Property changes on: management/design/userComponentCSS/markup/input_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/userComponentCSS/markup/input_error.gif
===================================================================
(Binary files differ)
Property changes on: management/design/userComponentCSS/markup/input_error.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/userComponentCSS/markup/rich-styles-example.html
===================================================================
--- management/design/userComponentCSS/markup/rich-styles-example.html (rev 0)
+++ management/design/userComponentCSS/markup/rich-styles-example.html 2008-03-03 17:07:08 UTC (rev 6500)
@@ -0,0 +1,26 @@
+
+
+<html>
+<head>
+ <title></title>
+ <link rel="STYLESHEET" type="text/css" href="rich-styles.css">
+</head>
+
+<body style="margin : 20px" class="rich-box-background-2">
+
+<fieldset class="rich-fieldset">
+<legend class="rich-legend">Field modes</legend>
+<Input type="Text" value="View mode" class="rich-field"><br><br>
+<Input type="Text" value="Edit mode" class="rich-field-edit"><br><br>
+<Input type="Text" value="Error mode" class="rich-field-error">
+</fieldset>
+<br>
+<fieldset class="rich-fieldset">
+<legend class="rich-legend">Button modes</legend>
+<div style="width : 100px" class="rich-button" onmouseover="this.className='rich-button-over'" onmouseout="this.className='rich-button'" onmousedown="this.className='rich-button-press'" onmouseup="this.className='rich-button-over'">Button</div>
+<br>
+<div style="width : 100px" class="rich-button-disabled">Button</div>
+</fieldset>
+
+</body>
+</html>
Modified: management/design/userComponentCSS/markup/rich-styles.css
===================================================================
--- management/design/userComponentCSS/markup/rich-styles.css 2008-03-03 16:37:36 UTC (rev 6499)
+++ management/design/userComponentCSS/markup/rich-styles.css 2008-03-03 17:07:08 UTC (rev 6500)
@@ -105,7 +105,7 @@
.rich-field{
border-width: 1px;
border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
+ border-color : #C0C0C0 /*panelBorderColor*/;
font-size: 11px /*generalSizeFont*/;
font-family: verdana /*generalFamilyFont*/;
color : #000000 /*controlTextColor*/;
@@ -117,16 +117,16 @@
.rich-field-edit{
border-width: 1px;
border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
+ border-color : #C0C0C0 /*panelBorderColor*/;
font-size: 11px /*generalSizeFont*/;
font-family: verdana /*generalFamilyFont*/;
color : #000000 /*controlTextColor*/;
- background-color : #FFF2D0 /*editBackgroundColor*/;
+ background-color : #FEFFDA /*editBackgroundColor*/;
}
.rich-field-error{
border-width: 1px;
border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
+ border-color : #C0C0C0 /*panelBorderColor*/;
font-size: 11px /*generalSizeFont*/;
font-family: verdana /*generalFamilyFont*/;
color : #000000 /*controlTextColor*/;
@@ -134,13 +134,13 @@
background-image : url(input_error.gif); /*warningColor*/
background-repeat : no-repeat;
background-position : center left;
- padding-left : 12px;
+ padding-left : 7px;
}
.rich-button{
border-width: 1px;
border-style : solid;
- border-color : #BED6F8 /*panelBorderColor*/;
+ border-color : #C0C0C0 /*panelBorderColor*/;
font-size: 11px /*buttonSizeFont*/;
font-family: verdana /*buttonFamilyFont*/;
color : #000000 /*generalTextColor*/;
@@ -149,12 +149,14 @@
background-repeat : repeat-x;
background-position : top left;
padding : 2px 10px 2px 10px;
+ text-align: center;
+ cursor:pointer;
}
.rich-button-disabled{
border-width: 1px;
border-style : solid;
- border-color : #BED6F8 /*panelBorderColor*/;
+ border-color : #C0C0C0 /*panelBorderColor*/;
font-size: 11px /*buttonSizeFont*/;
font-family: verdana /*buttonFamilyFont*/;
color : #6A92CF /*tabDisabledTextColor*/;
@@ -163,6 +165,8 @@
background-repeat : repeat-x;
background-position : top left;
padding : 2px 10px 2px 10px;
+ text-align: center;
+ cursor:default;
}
.rich-button-over{
@@ -177,26 +181,30 @@
background-repeat : repeat-x;
background-position : top left;
padding : 2px 10px 2px 10px;
+ text-align: center;
+ cursor:pointer;
}
-.rich-button_press{
+.rich-button-press{
border-width: 1px;
border-style : solid;
- border-color : #BED6F8 /*panelBorderColor*/;
+ border-color : #C0C0C0 /*panelBorderColor*/;
font-size: 11px /*buttonSizeFont*/;
font-family: verdana /*buttonFamilyFont*/;
color : #000000 /*generalTextColor*/;
background-color : #C6D6EA /*trimColor*/;
- background-image : url(btn_bg.gif)/*from trimColor to additionalBackgroundColor, width 1.7 buttonSizeFont*/;
+ background-image : url(btn_press_bg.gif)/*from trimColor to additionalBackgroundColor, width 1.7 buttonSizeFont*/;
background-repeat : repeat-x;
background-position : bottom left;
padding : 2px 10px 2px 10px;
+ text-align: center;
+ cursor:pointer;
}
.rich-fieldset{
border-width: 1px;
border-style : solid;
- border-color : #BED6F8 /*panelBorderColor*/;
+ border-color : #C0C0C0 /*panelBorderColor*/;
font-size: 11px /*generalSizeFont*/;
font-family: verdana /*generalFamilyFont*/;
color : #000000 /*controlTextColor*/;
@@ -216,7 +224,7 @@
}
.rich-hr{
- color : #BED6F8 /*panelBorderColor*/;
+ color : #C0C0C0 /*panelBorderColor*/;
}
.rich-listitem{
16 years, 9 months
JBoss Rich Faces SVN: r6499 - in trunk/samples/richfaces-demo/src/main: webapp/richfaces/progressBar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-03 11:37:36 -0500 (Mon, 03 Mar 2008)
New Revision: 6499
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/client.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/polling.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/usage.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java 2008-03-03 16:37:36 UTC (rev 6499)
@@ -0,0 +1,55 @@
+/**
+ *
+ */
+package org.richfaces.demo.progressBar;
+
+import java.util.Date;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class ProgressBarBean {
+
+ private boolean enabled=false;
+ private Long startTime;
+
+ public ProgressBarBean() {
+ }
+
+ public String startProcess() {
+ setEnabled(true);
+ setStartTime(new Date().getTime());
+ return null;
+ }
+
+ public Long getCurrentValue(){
+ if (isEnabled()){
+ Long current = (new Date().getTime() - startTime)/1000;
+ if (current>100){
+ setEnabled(false);
+ }else if (current.equals(0)){
+ System.out.println("called");
+ return new Long(1);
+ }
+ return (new Date().getTime() - startTime)/1000;
+ }else
+ return Long.valueOf(-1);
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public Long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Long startTime) {
+ this.startTime = startTime;
+ }
+}
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/client.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/client.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/client.xhtml 2008-03-03 16:37:36 UTC (rev 6499)
@@ -0,0 +1,37 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <script>
+//<![CDATA[
+ var counter = 1;
+ var intervalID;
+ function updateProgress(i) {
+ $('form:progressBar').component.setValue(counter*5);
+ if ((counter++)>20)
+ clearInterval(intervalID);
+ }
+
+ function startProgress(){
+ counter=1;
+ $('form:progressBar').component.enable();
+ $('form:progressBar').component.setValue(1);
+ intervalID = setInterval(updateProgress,5000);
+ }
+//]]>
+ </script>
+ <h:form id="form">
+ <rich:progressBar mode="client" id="progressBar">
+ <f:facet name="initial">
+ <h:outputText value="Process doesn't started yet"/>
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process Done"/>
+ </f:facet>
+ </rich:progressBar>
+ <button type="button" onclick="startProgress();">Start Progress</button>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/polling.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/polling.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/examples/polling.xhtml 2008-03-03 16:37:36 UTC (rev 6499)
@@ -0,0 +1,24 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form>
+ <h:outputText value="http://jira.jboss.com/jira/browse/RF-2364"/>
+ <a4j:outputPanel id="progressPanel">
+ <a4j:commandButton action="#{progressBarBean.startProcess}" value="startProcess" reRender="progressPanel" rendered="#{not progressBarBean.enabled}"/>
+
+ <rich:progressBar value="#{progressBarBean.currentValue}" interval="2000"
+ label="#{progressBarBean.currentValue} %" enabled="#{progressBarBean.enabled}">
+ <f:facet name="initial">
+ <h:outputText value="Process doesn't started yet"/>
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process Done"/>
+ </f:facet>
+ </rich:progressBar>
+ </a4j:outputPanel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/progressBar/usage.xhtml 2008-03-03 16:37:36 UTC (rev 6499)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+
+ <p>
+ Server Side
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/progressBar/examples/polling.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/progressBar/examples/polling.xhtml"/>
+ </ui:include>
+ </div>
+
+ <p>
+ Client Side
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/progressBar/examples/client.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/progressBar/examples/client.xhtml"/>
+ </ui:include>
+ </div>
+
+
+ </ui:define>
+
+
+ </ui:composition>
+</html>
16 years, 9 months