JBoss Rich Faces SVN: r20829 - trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-28 10:03:21 -0500 (Tue, 28 Dec 2010)
New Revision: 20829
Modified:
trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
Log:
added cdk:passThroughWithExclusions to a4j:log component in order to encode 'style' etc. attributes
Modified: trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
===================================================================
--- trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2010-12-28 15:02:33 UTC (rev 20828)
+++ trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2010-12-28 15:03:21 UTC (rev 20829)
@@ -14,7 +14,8 @@
</cc:interface>
<cc:implementation>
- <div id="richfaces.log" class="#{concatClasses('rf-log', isInline(component.attributes['mode']) ? 'rf-log-inline' : 'rf-log-popup rf-log-popup-cnt', component.attributes['styleClass'])}">
+ <div id="richfaces.log" class="#{concatClasses('rf-log', isInline(component.attributes['mode']) ? 'rf-log-inline' : 'rf-log-popup rf-log-popup-cnt', component.attributes['styleClass'])}"
+ cdk:passThroughWithExclusions="">
<cdk:scriptObject name="options">
<cdk:scriptOption attributes="level hotkey" />
<cdk:scriptOption attributes="mode" defaultValue="LogMode.DEFAULT" />
14 years
JBoss Rich Faces SVN: r20828 - in trunk/ui/output/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-12-28 10:02:33 -0500 (Tue, 28 Dec 2010)
New Revision: 20828
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
Log:
RF-9741 Popup panel: attribute onhide doesn't work
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-12-28 14:49:14 UTC (rev 20827)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-12-28 15:02:33 UTC (rev 20828)
@@ -1,6 +1,5 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.RenderKitUtils.addToScriptHash;
import java.io.IOException;
import java.util.HashMap;
@@ -17,7 +16,6 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.javascript.ScriptUtils;
import org.richfaces.component.AbstractPopupPanel;
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONMap;
@@ -164,53 +162,10 @@
public String getStyleIfTrimmed(UIComponent panel){
if (panel.getAttributes().get("trimOverlayedElements").equals(Boolean.TRUE)) {
- return "position: relative; z-index : 0;";
+ return "position: relative; z-index : 0";
}
return "";
}
-
- public String buildScript(FacesContext context, UIComponent component) throws IOException {
- AbstractPopupPanel panel = (AbstractPopupPanel) component;
- StringBuilder result = new StringBuilder();
- result.append("new RichFaces.ui.PopupPanel('");
- result.append(panel.getClientId());
- result.append("',");
- Map<String, Object> attributes = component.getAttributes();
- Map<String, Object> options = new HashMap<String, Object>();
- addToScriptHash(options, "width", panel.getWidth(), "-1");
- addToScriptHash(options, "height", panel.getHeight(), "-1");
- addToScriptHash(options, "minWidth", panel.getMinWidth(), "-1");
- addToScriptHash(options, "minHeight", panel.getMinHeight(), "-1");
- addToScriptHash(options, "maxWidth", panel.getMaxWidth(), "" +Integer.MAX_VALUE);
- addToScriptHash(options, "maxHeight", panel.getMaxHeight(), "" +Integer.MAX_VALUE);
- addToScriptHash(options, "moveable", panel.isMoveable(), "true");
- addToScriptHash(options, "followByScroll", panel.isFollowByScroll(), "true");
- addToScriptHash(options, "left", panel.getLeft(), "auto");
- addToScriptHash(options, "top", panel.getTop(), "auto");
- addToScriptHash(options, "zindex", panel.getZindex(), "100");
- addToScriptHash(options, "shadowDepth", panel.getShadowDepth(), "2");
- addToScriptHash(options, "shadowOpacity", panel.getShadowOpacity(), "0.1");
- addToScriptHash(options, "domElementAttachment", panel.getDomElementAttachment());
-
- addToScriptHash(options, "keepVisualState", panel.isKeepVisualState(), "false");
- addToScriptHash(options, "show", panel.isShow(), "false");
- addToScriptHash(options, "modal", panel.isModal(), "true");
- addToScriptHash(options, "autosized", panel.isAutosized(), "false");
- addToScriptHash(options, "resizeable", panel.isResizeable(), "false");
- addToScriptHash(options, "overlapEmbedObjects", panel.isOverlapEmbedObjects(), "false");
- addToScriptHash(options, "visualOptions", writeVisualOptions(context, panel));
- addToScriptHash(options, "onresize", buildEventFunction(attributes.get("onresize")));
- addToScriptHash(options, "onmove", buildEventFunction(attributes.get("onmove")));
- addToScriptHash(options, "onshow", buildEventFunction(attributes.get("onshow")));
- addToScriptHash(options, "onhide", buildEventFunction(attributes.get("onhide")));
- addToScriptHash(options, "onbeforeshow", buildEventFunction(attributes.get("onbeforeshow")));
- addToScriptHash(options, "onbeforehide", buildEventFunction(attributes.get("onbeforehide")));
-
- ScriptUtils.appendScript(result, options);
- result.append(");");
- return result.toString();
- }
-
private Object buildEventFunction(Object eventFunction) {
if(eventFunction != null && eventFunction.toString().length() > 0) {
return "new Function(\"" + eventFunction.toString() + "\");";
@@ -218,7 +173,8 @@
return null;
}
- public Map<String, Object> getHandledVisualOptions(AbstractPopupPanel panel) {
+ public Map<String, Object> getHandledVisualOptions(UIComponent component) {
+ AbstractPopupPanel panel = (AbstractPopupPanel) component;
String options = panel.getVisualOptions();
Map<String, Object> result;
result = prepareVisualOptions(options, panel);
@@ -229,24 +185,7 @@
return result;
}
- private String writeVisualOptions(FacesContext context, AbstractPopupPanel panel) throws IOException {
- StringBuffer result = new StringBuffer();
-
- Iterator<Map.Entry<String, Object>> it = ((Map<String, Object>) getHandledVisualOptions(panel)).entrySet()
- .iterator();
- if (it.hasNext()) {
- result.append(",\n");
- }
- while (it.hasNext()) {
- Map.Entry<String, Object> entry = it.next();
-
- result.append(entry.getKey() + ": '" + entry.getValue() + "'");
- if (it.hasNext()) {
- result.append(",");
- }
- }
- return result.toString();
- }
+
private Map<String, Object> prepareVisualOptions(Object value, AbstractPopupPanel panel) {
if (null == value) {
Modified: trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-12-28 14:49:14 UTC (rev 20827)
+++ trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-12-28 15:02:33 UTC (rev 20828)
@@ -72,16 +72,17 @@
</c:if>
</div>
- <cdk:object type="java.lang.String" name="script" value="#{buildScript(facesContext, component)}" />
- <cdk:object type="java.lang.String" name="showScript" value="#{buildShowScript(facesContext, component)}" />
+ <cdk:scriptObject name="options">
+ <cdk:scriptOption attributes="width height minWidth minHeight maxWidth maxHeight moveable followByScroll left top zindex shadowDepth shadowOpacity domElementAttachment show keepVisualState autosized resizeable modal overlapEmbedObjects visualOptions " />
+ <cdk:scriptOption attributes="onshow onhide onresize onmove onbeforeshow onbeforehide" wrapper="eventHandler"/>
+ </cdk:scriptObject>
+
<script type="text/javascript">
- #{script}
- </script>
- <c:if test="#{showScript != null}">
- <script type="text/javascript">
- #{showScript}
- </script>
- </c:if>
+ new RichFaces.ui.PopupPanel(#{toScriptArgs(clientId, options)});
+ <c:if test="#{component.attributes['show'] != false}">
+ RichFaces.ui.PopupPanel.showPopupPanel(#{toScriptArgs(clientId, getHandledVisualOptions(component))});
+ </c:if>
+ </script>
</div>
14 years
JBoss Rich Faces SVN: r20827 - in trunk/ui/iteration: ui/src/main/java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-28 09:49:14 -0500 (Tue, 28 Dec 2010)
New Revision: 20827
Added:
trunk/ui/iteration/api/src/main/java/org/richfaces/component/DataScrollerControlsMode.java
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
Log:
https://issues.jboss.org/browse/RF-10098
Added: trunk/ui/iteration/api/src/main/java/org/richfaces/component/DataScrollerControlsMode.java
===================================================================
--- trunk/ui/iteration/api/src/main/java/org/richfaces/component/DataScrollerControlsMode.java (rev 0)
+++ trunk/ui/iteration/api/src/main/java/org/richfaces/component/DataScrollerControlsMode.java 2010-12-28 14:49:14 UTC (rev 20827)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public enum DataScrollerControlsMode {
+
+ show, auto, hide;
+
+ public static final DataScrollerControlsMode DEFAULT = show;
+
+}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2010-12-28 14:27:29 UTC (rev 20826)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2010-12-28 14:49:14 UTC (rev 20827)
@@ -91,21 +91,38 @@
@Attribute
public abstract String getLastPageMode();
- @Attribute(defaultValue="10")
+ @Attribute
public abstract int getMaxPages();
- @Attribute(defaultValue="show")
- public abstract String getBoundaryControls();
+ public int getMaxPagesOrDefault() {
+ int maxPages = getMaxPages();
+ if (maxPages <= 0) {
+ maxPages = 10;
+ }
+
+ return maxPages;
+ }
- @Attribute(defaultValue="show")
- public abstract String getFastControls();
+ @Attribute
+ public abstract DataScrollerControlsMode getBoundaryControls();
+
+ @Attribute
+ public abstract DataScrollerControlsMode getFastControls();
- @Attribute(defaultValue="show")
- public abstract String getStepControls();
+ @Attribute
+ public abstract DataScrollerControlsMode getStepControls();
- @Attribute(defaultValue="1")
+ @Attribute
public abstract int getFastStep();
+ public int getFastStepOrDefault() {
+ int fastStep = getFastStep();
+ if (fastStep <= 0) {
+ fastStep = 1;
+ }
+ return fastStep;
+ }
+
@Attribute
public String getFor() {
return (String)getStateHelper().eval("for");
@@ -191,9 +208,9 @@
} else if (NEXT_FACET_NAME.equals(facetName)) {
newPage = getPage() + 1;
} else if (FAST_FORWARD_FACET_NAME.equals(facetName)) {
- newPage = getPage() + getFastStep();
+ newPage = getPage() + getFastStepOrDefault();
} else if (FAST_REWIND_FACET_NAME.equals(facetName)) {
- newPage = getPage() - getFastStep();
+ newPage = getPage() - getFastStepOrDefault();
} else {
try {
newPage = Integer.parseInt(facetName.toString());
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-12-28 14:27:29 UTC (rev 20826)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-12-28 14:49:14 UTC (rev 20827)
@@ -23,6 +23,9 @@
package org.richfaces.renderkit;
+import static org.richfaces.component.DataScrollerControlsMode.auto;
+import static org.richfaces.component.DataScrollerControlsMode.show;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -38,6 +41,7 @@
import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.javascript.JSReference;
import org.richfaces.component.AbstractDataScroller;
+import org.richfaces.component.DataScrollerControlsMode;
import org.richfaces.event.DataScrollerEvent;
import org.richfaces.renderkit.util.AjaxRendererUtils;
@@ -69,19 +73,23 @@
}
}
+ private DataScrollerControlsMode getModeOrDefault(UIComponent component, String attributeName) {
+ DataScrollerControlsMode mode = (DataScrollerControlsMode) component.getAttributes().get(attributeName);
+ if (mode == null) {
+ mode = DataScrollerControlsMode.DEFAULT;
+ }
+ return mode;
+ }
+
public ControlsState getControlsState(FacesContext context, UIComponent component) {
- int fastStep = (Integer) component.getAttributes().get("fastStep");
+ int fastStep = (Integer) component.getAttributes().get("fastStepOrDefault");
int pageIndex = (Integer) component.getAttributes().get("page");
int pageCount = (Integer) component.getAttributes().get("pageCount");
int minPageIdx = 1;
int maxPageIdx = pageCount;
- if (fastStep <= 1) {
- fastStep = 1;
- }
-
boolean useFirst = true;
boolean useLast = true;
@@ -106,12 +114,12 @@
useForwFast = false;
}
- String boundaryControls = (String) component.getAttributes().get("boundaryControls");
- String stepControls = (String) component.getAttributes().get("stepControls");
- String fastControls = (String) component.getAttributes().get("fastControls");
+ DataScrollerControlsMode boundaryControls = getModeOrDefault(component, "boundaryControls");
+ DataScrollerControlsMode stepControls = getModeOrDefault(component, "stepControls");
+ DataScrollerControlsMode fastControls = getModeOrDefault(component, "fastControls");
- boolean isAuto = "auto".equals(boundaryControls);
- if (isAuto || "show".equals(boundaryControls)) {
+ boolean isAuto = auto.equals(boundaryControls);
+ if (isAuto || show.equals(boundaryControls)) {
if (isAuto) {
controlsState.setFirstRendered(useFirst);
controlsState.setLastRendered(useLast);
@@ -124,8 +132,8 @@
controlsState.setLastRendered(false);
}
- isAuto = "auto".equals(stepControls);
- if (isAuto || "show".equals(stepControls)) {
+ isAuto = auto.equals(stepControls);
+ if (isAuto || show.equals(stepControls)) {
if (isAuto) {
controlsState.setPreviousRendered(useFirst);
controlsState.setNextRendered(useLast);
@@ -138,8 +146,8 @@
controlsState.setNextRendered(false);
}
- isAuto = "auto".equals(fastControls);
- if (isAuto || "show".equals(fastControls)) {
+ isAuto = auto.equals(fastControls);
+ if (isAuto || show.equals(fastControls)) {
if (isAuto) {
controlsState.setFastForwardRendered(useForwFast);
controlsState.setFastRewindRendered(useBackFast);
@@ -164,7 +172,7 @@
throws IOException {
int currentPage = (Integer) component.getAttributes().get("page");
- int maxPages = (Integer) component.getAttributes().get("maxPages");
+ int maxPages = (Integer) component.getAttributes().get("maxPagesOrDefault");
int pageCount = (Integer) component.getAttributes().get("pageCount");
Map<String, String> digital = new HashMap<String, String>();
@@ -173,10 +181,6 @@
return digital;
}
- if (maxPages <= 1) {
- maxPages = 1;
- }
-
int delta = maxPages / 2;
int pages;
14 years
JBoss Rich Faces SVN: r20826 - trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-28 09:27:29 -0500 (Tue, 28 Dec 2010)
New Revision: 20826
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
Log:
https://issues.jboss.org/browse/RF-10098
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-12-28 11:14:21 UTC (rev 20825)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-12-28 14:27:29 UTC (rev 20826)
@@ -110,7 +110,7 @@
protected int getColumnsCount(UIDataTableBase table) {
int columns = table.getColumns();
- return (columns != Integer.MIN_VALUE) ? columns : getColumnsCount(table.columns());
+ return (columns > 0) ? columns : getColumnsCount(table.columns());
}
public void encodeTableStructure(ResponseWriter writer, FacesContext context, UIDataTableBase dataTable) throws IOException {
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-12-28 11:14:21 UTC (rev 20825)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-12-28 14:27:29 UTC (rev 20826)
@@ -70,7 +70,7 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-h-c", null);
int columns = (Integer)component.getAttributes().get("columns");
- if(columns != Integer.MIN_VALUE) {
+ if (columns > 0) {
writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
}
}
@@ -109,7 +109,7 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-f-c", null);
int columns = (Integer)component.getAttributes().get("columns");
- if(columns != Integer.MIN_VALUE) {
+ if (columns > 0) {
writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
}
}
@@ -149,7 +149,7 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-nd-c", null);
int columns = (Integer)component.getAttributes().get("columns");
- if(columns != Integer.MIN_VALUE) {
+ if (columns > 0) {
writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
}
}
14 years
JBoss Rich Faces SVN: r20825 - in trunk/ui/input/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-12-28 06:14:21 -0500 (Tue, 28 Dec 2010)
New Revision: 20825
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss
trunk/ui/input/ui/src/main/templates/autocomplete.template.xml
Log:
http://jira.jboss.com/jira/browse/RF-9074
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss 2010-12-28 09:23:56 UTC (rev 20824)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss 2010-12-28 11:14:21 UTC (rev 20825)
@@ -36,15 +36,20 @@
position: absolute;
top: 0px;
right: 0px;
- height: 200px;
- padding-top: 1px
+ height: 15px;
+ padding-top: 1px;
+ cursor: pointer;
}
+.rf-au-btn-dis{
+ background-color: '#{richSkin.headerBackgroundColor}';
+ cursor: default;
+}
+
.rf-au-btn-arrow{
background-position: center;
background-repeat: no-repeat;
background-image: "url(#{resource['org.richfaces:combo_down_button.gif']})";
- cursor: pointer;
width: 15px;
height: 15px;
}
Modified: trunk/ui/input/ui/src/main/templates/autocomplete.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-12-28 09:23:56 UTC (rev 20824)
+++ trunk/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-12-28 11:14:21 UTC (rev 20825)
@@ -16,7 +16,7 @@
<cc:implementation>
<cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
<div id="#{clientId}" class="rf-au-fld">
- <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-fnt rf-au-inp" />
+ <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-fnt rf-au-inp" />
<div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
<input onclick="#{component.attributes['onclick']}"
ondblclick="#{component.attributes['ondblclick']}"
@@ -30,7 +30,7 @@
onkeypress="#{component.attributes['onkeypress']}" id="#{clientId}Input" value="#{component.attributes['value']}" disabled="#{disabled}" name="#{clientId}" type="text" class="rf-au-fnt rf-au-inp" autocomplete="off"/>
<c:if test="#{component.attributes['showButton']}">
<c:if test="#{component.attributes['disabled']}">
- <div id="#{clientId}Button" class="rf-au-btn">
+ <div id="#{clientId}Button" class="rf-au-btn rf-au-btn-dis">
<div class="rf-au-btn-arrow"></div>
</div>
</c:if>
@@ -69,6 +69,7 @@
</div>
</div>
</div>
+ <c:if test="#{!component.attributes['disabled']}">
<script type="text/javascript">
<cdk:object name="mode" type="Object" value="#{component.attributes['mode']}" />
<cdk:scriptObject name="options">
@@ -84,6 +85,7 @@
"#{clientId}Input", #{toScriptArgs(options)}
);
</script>
+ </c:if>
</div>
</cc:implementation>
14 years
JBoss Rich Faces SVN: r20824 - in trunk/ui: output/api/src/main/java/org/richfaces and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-28 04:23:56 -0500 (Tue, 28 Dec 2010)
New Revision: 20824
Added:
trunk/ui/common/api/src/main/java/org/richfaces/component/Positioning.java
Removed:
trunk/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java
trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
Log:
rename TooltipDirection Positioning
Copied: trunk/ui/common/api/src/main/java/org/richfaces/component/Positioning.java (from rev 20801, trunk/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java)
===================================================================
--- trunk/ui/common/api/src/main/java/org/richfaces/component/Positioning.java (rev 0)
+++ trunk/ui/common/api/src/main/java/org/richfaces/component/Positioning.java 2010-12-28 09:23:56 UTC (rev 20824)
@@ -0,0 +1,29 @@
+package org.richfaces.component;
+
+/**
+ * @author amarkhel
+ */
+public enum Positioning {
+ topRight("RT"),
+ topLeft("LT"),
+ bottomRight("BR"),
+ bottomLeft("BL"),
+
+ auto("AA"),
+ topAuto("AT"),
+ bottomAuto("AB"),
+ autoRight("RA"),
+ autoLeft("LA");
+
+ public static final Positioning DEFAULT = bottomRight;
+
+ String value;
+
+ Positioning(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
Deleted: trunk/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java 2010-12-28 01:13:35 UTC (rev 20823)
+++ trunk/ui/output/api/src/main/java/org/richfaces/TooltipDirection.java 2010-12-28 09:23:56 UTC (rev 20824)
@@ -1,10 +0,0 @@
-package org.richfaces;
-
-/**
- * @author amarkhel
- */
-public enum TooltipDirection {
- topRight, topLeft, bottomRight, bottomLeft, auto;
-
- public static final TooltipDirection DEFAULT = bottomRight;
-}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2010-12-28 01:13:35 UTC (rev 20823)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2010-12-28 09:23:56 UTC (rev 20824)
@@ -65,7 +65,7 @@
public abstract boolean isAttached();
- public abstract TooltipDirection getDirection();
+ public abstract Positioning getDirection();
public abstract boolean isDisabled();
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java 2010-12-28 01:13:35 UTC (rev 20823)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UITooltip.java 2010-12-28 09:23:56 UTC (rev 20824)
@@ -87,11 +87,11 @@
getStateHelper().put(PropertyKeys.attached, attached);
}
- public TooltipDirection getDirection() {
- return (TooltipDirection) getStateHelper().eval(PropertyKeys.direction, TooltipDirection.DEFAULT);
+ public Positioning getDirection() {
+ return (Positioning) getStateHelper().eval(PropertyKeys.direction, Positioning.DEFAULT);
}
- public void setDirection(TooltipDirection direction) {
+ public void setDirection(Positioning direction) {
getStateHelper().put(PropertyKeys.direction, direction);
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-28 01:13:35 UTC (rev 20823)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-28 09:23:56 UTC (rev 20824)
@@ -855,7 +855,7 @@
<property>
<description></description>
<property-name>direction</property-name>
- <property-class>org.richfaces.component.TooltipDirection</property-class>
+ <property-class>org.richfaces.component.Positioning</property-class>
</property>
<property>
<description></description>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-28 01:13:35 UTC (rev 20823)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-28 09:23:56 UTC (rev 20824)
@@ -909,7 +909,7 @@
</attribute>
<attribute>
<name>direction</name>
- <type>org.richfaces.component.TooltipDirection</type>
+ <type>org.richfaces.component.Positioning</type>
</attribute>
<attribute>
<name>disabled</name>
14 years
JBoss Rich Faces SVN: r20823 - in branches/RF-9323/cdk/generator/src: test/resources/org/richfaces/cdk/apt and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-27 20:13:35 -0500 (Mon, 27 Dec 2010)
New Revision: 20823
Modified:
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java
Log:
CODING IN PROGRESS - issue RF-9323: CDK annotation @RendererSpecificComponent.attributes doesn't work
https://issues.jboss.org/browse/RF-9323
Modified: branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
===================================================================
--- branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-12-28 00:01:35 UTC (rev 20822)
+++ branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-12-28 01:13:35 UTC (rev 20823)
@@ -82,7 +82,7 @@
if (ElementKind.METHOD.equals(childElement.getKind())) {
processMethod(properties, childElement, annotated);
} else if (ElementKind.FIELD.equals(childElement.getKind())) {
- processFiled(properties, childElement);
+// processFiled(properties, childElement);
}
// TODO - merge properties with same name ?
@@ -128,7 +128,6 @@
Map<String,BeanProperty> getBeanProperties(TypeElement type){
List<? extends Element> members = this.processingEnv.getElementUtils().getAllMembers(type);
// extract all getters/setters.
- Iterable<? extends ExecutableElement> gettersAndSetters = Iterables.filter(Iterables.filter(members, BEAN_PROPERTY_PREDICATE),ExecutableElement.class);
Map<String,BeanProperty> result = Maps.newHashMap();
for (Element element : members) {
if (ElementKind.METHOD.equals(element.getKind())){
@@ -139,7 +138,7 @@
if(result.containsKey(propertyName)){
// Merge property with existed one.
BeanProperty beanProperty = result.get(propertyName);
- processingEnv.getElementUtils().
+// processingEnv.getElementUtils().
} else {
}
@@ -149,15 +148,6 @@
}
}
}
- // Merge all getter/setter methods.
- for (ExecutableElement accestor : gettersAndSetters) {
- String name = PropertyUtils.methodToName(accestor.getSimpleName().toString());
- if(result.containsKey(name)){
-
- } else {
-
- }
- }
return result;
}
@@ -209,18 +199,6 @@
return builder.toString();
}
- private void processFiled(Set<BeanProperty> properties, Element childElement) {
- AptBeanProperty property = new AptBeanProperty(childElement.getSimpleName().toString());
-
- property.type = asClassDescription(childElement.asType());
- property.getter = childElement;
-
- // TODO - find getter/setter, check them for abstract.
- property.exists = true;
-
- properties.add(property);
- }
-
private void processMethod(Set<BeanProperty> properties, Element childElement, boolean annotated) {
ExecutableElement method = (ExecutableElement) childElement;
boolean exists = !isAbstract(method);
@@ -247,7 +225,7 @@
AptBeanProperty property = new AptBeanProperty(name);
property.type = asClassDescription(propertyType);
- property.getter = childElement;
+ property.getter = (ExecutableElement) childElement;
property.exists = exists;
properties.add(property);
Modified: branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java
===================================================================
--- branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java 2010-12-28 00:01:35 UTC (rev 20822)
+++ branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java 2010-12-28 01:13:35 UTC (rev 20823)
@@ -25,10 +25,21 @@
package org.richfaces.cdk.apt;
+import org.richfaces.cdk.apt.TestMethodAnnotation;
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">Java Bean to test bean properties processor.
+ * that class contains next properties:
+ * <ol>
+ * <li>r/w concreteValue, type String, annotated with {@link TestMethodAnnotation} "setter"</li>
+ * <li> r/w inheritedValue, type String, inherited from {@link PropertyTestInterface}, annotated {@link TestMethodAnnotation} "inherited" </li>
+ * <li> abstract r/w value, inherited from {@link TestInterface},{@link TestMethodAnnotation} "baz"</li>
+ * <li> r readOnly, type Integer, inherited from {@link TestClass}</li>
+ * <li> w writeOnly, type Integer, inherited from {@link TestClass}</li>
+ * <li> wrongValue that should be ignored with warning message.</li>
+ * </ol>
+ * </p>
* @author asmirnov(a)exadel.com
- *
*/
public class PropertyTestClass extends TestClass implements TestInterface, PropertyTestInterface {
private String concreteValue;
Modified: branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java
===================================================================
--- branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java 2010-12-28 00:01:35 UTC (rev 20822)
+++ branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java 2010-12-28 01:13:35 UTC (rev 20823)
@@ -25,6 +25,8 @@
package org.richfaces.cdk.apt;
+import org.richfaces.cdk.apt.TestMethodAnnotation;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -32,6 +34,7 @@
*/
public interface PropertyTestInterface {
+ @TestMethodAnnotation("inherited")
public String getInheritedValue();
public void setInheritedValue(String value);
Modified: branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java
===================================================================
--- branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java 2010-12-28 00:01:35 UTC (rev 20822)
+++ branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java 2010-12-28 01:13:35 UTC (rev 20823)
@@ -37,7 +37,7 @@
return null;
}
- public void setWriteOnly(){
+ public void setWriteOnly(Boolean value){
}
}
14 years
JBoss Rich Faces SVN: r20822 - trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-27 19:01:35 -0500 (Mon, 27 Dec 2010)
New Revision: 20822
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/message.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/messages.xhtml
Log:
https://issues.jboss.org/browse/RF-10092
Modified: trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/message.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/message.xhtml 2010-12-27 23:53:45 UTC (rev 20821)
+++ trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/message.xhtml 2010-12-28 00:01:35 UTC (rev 20822)
@@ -20,7 +20,7 @@
<composite:implementation>
<h:outputStylesheet library="org.richfaces.showcase" name="message.css" />
- <a4j:outputPanel ajaxRendered="true" layout="none">
+ <a4j:outputPanel ajaxRendered="true">
<h:message for="#{cc.attrs.for}" showDetail="#{cc.attrs.showDetails}"
showSummary="#{cc.attrs.showSummary}" style="#{cc.attrs.style}"
styleClass="rich-message #{cc.attrs.styleClass}" />
Modified: trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/messages.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/messages.xhtml 2010-12-27 23:53:45 UTC (rev 20821)
+++ trunk/examples/richfaces-showcase/src/main/webapp/resources/org.richfaces.showcase/messages.xhtml 2010-12-28 00:01:35 UTC (rev 20822)
@@ -19,7 +19,7 @@
<composite:implementation>
<h:outputStylesheet library="org.richfaces.showcase" name="messages.css" />
- <a4j:outputPanel ajaxRendered="true" layout="none">
+ <a4j:outputPanel ajaxRendered="true">
<h:messages layout="#{cc.attrs.layout}"
showSummary="true" style="color:red; #{cc.attrs.style}"
styleClass="rich-message #{cc.attrs.styleClass}" />
14 years
JBoss Rich Faces SVN: r20821 - in trunk/ui/core/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-27 18:53:45 -0500 (Mon, 27 Dec 2010)
New Revision: 20821
Modified:
trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java
trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
Log:
https://issues.jboss.org/browse/RF-10092
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java 2010-12-27 23:37:21 UTC (rev 20820)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/LogRendererBase.java 2010-12-27 23:53:45 UTC (rev 20821)
@@ -31,7 +31,7 @@
protected boolean isInline(Object attributeValue) {
LogMode mode = (LogMode) attributeValue;
- return mode == LogMode.inline;
+ return mode == null || mode == LogMode.inline;
}
}
Modified: trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
===================================================================
--- trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2010-12-27 23:37:21 UTC (rev 20820)
+++ trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2010-12-27 23:53:45 UTC (rev 20821)
@@ -173,6 +173,8 @@
this.attachToDom();
richfaces.setLog(this);
+ options = options || {};
+
this.level = options.level;
this.hotkey = options.hotkey;
this.mode = (options.mode || 'inline');
14 years
JBoss Rich Faces SVN: r20820 - in trunk/ui/iteration/ui/src: main/java/org/richfaces/renderkit and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-27 18:37:21 -0500 (Mon, 27 Dec 2010)
New Revision: 20820
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTable.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTableToggler.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableTogglerRendererBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRenderingContext.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js
trunk/ui/iteration/ui/src/main/templates/tree.template.xml
trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIColumnTest.java
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
Log:
https://issues.jboss.org/browse/RF-10098
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTable.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTable.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTable.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -78,7 +78,7 @@
getStateHelper().put(PropertyKeys.expanded, expanded);
}
- @Attribute(defaultValue = MODE_CLIENT)
+ @Attribute
public abstract String getExpandMode();
public void broadcast(FacesEvent event) throws AbortProcessingException {
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTableToggler.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTableToggler.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractCollapsibleSubTableToggler.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -60,7 +60,7 @@
@Attribute
public abstract String getCollapseIcon();
- @Attribute(defaultValue = DEFAULT_EVENT)
+ @Attribute
public abstract String getEvent();
@Attribute
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -53,7 +53,7 @@
@Attribute
public abstract boolean isBreakRowBefore();
- @Attribute(defaultValue="SortOrder.unsorted")
+ @Attribute
public abstract SortOrder getSortOrder();
@Attribute
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -39,8 +39,8 @@
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.context.ExtendedVisitContextMode;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.richfaces.log.Logger;
/**
@@ -74,7 +74,7 @@
clientFirst, clientRows
}
- @Attribute(defaultValue = "0")
+ @Attribute
public abstract int getFrozenColumns();
@Attribute(events=@EventName(value="selectionchange", defaultEvent=true))
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -195,10 +195,10 @@
@Attribute(events = @EventName("beforeselectionchange"))
public abstract String getOnbeforeselectionchange();
- @Attribute(defaultValue = "SwitchType.DEFAULT")
+ @Attribute
public abstract SwitchType getToggleType();
- @Attribute(defaultValue = "SwitchType.client")
+ @Attribute
public abstract SwitchType getSelectionType();
public abstract String getNodeType();
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -84,7 +84,7 @@
return COMPONENT_FAMILY;
}
- @Attribute(defaultValue = "findTreeComponent().isImmediate()")
+ @Attribute
public abstract boolean isImmediate();
public abstract String getType();
@@ -151,7 +151,7 @@
public void queueEvent(FacesEvent event) {
if (this.equals(event.getComponent())) {
if (event instanceof TreeToggleEvent) {
- PhaseId targetPhase = isImmediate() ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.PROCESS_VALIDATIONS;
+ PhaseId targetPhase = (isImmediate() || findTreeComponent().isImmediate()) ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.PROCESS_VALIDATIONS;
event.setPhaseId(targetPhase);
}
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -104,7 +104,7 @@
return getFacet(NODATA_FACET_NAME);
}
- @Attribute(defaultValue="Integer.MIN_VALUE")
+ @Attribute
public abstract int getColumns();
@Attribute
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableTogglerRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableTogglerRendererBase.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableTogglerRendererBase.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -38,6 +38,8 @@
import org.richfaces.component.AbstractCollapsibleSubTableToggler;
import org.richfaces.renderkit.util.RendererUtils;
+import com.google.common.base.Strings;
+
/**
* @author Anton Belevich
*/
@@ -77,12 +79,11 @@
AbstractCollapsibleSubTable subTable = findComponent(context, toggleControl);
if (subTable != null) {
- String switchType = subTable.getExpandMode();
boolean expanded = subTable.isExpanded();
ResponseWriter writer = context.getResponseWriter();
- encodeControl(context, writer, toggleControl, switchType, expanded, false);
- encodeControl(context, writer, toggleControl, switchType, !expanded, true);
+ encodeControl(context, writer, toggleControl, expanded, false);
+ encodeControl(context, writer, toggleControl, !expanded, true);
JSFunction jsFunction = new JSFunction("new RichFaces.ui.CollapsibleSubTableToggler");
String toggleId = toggleControl.getClientId(context);
@@ -97,7 +98,7 @@
}
protected void encodeControl(FacesContext context, ResponseWriter writer, AbstractCollapsibleSubTableToggler control,
- String switchType, boolean expanded, boolean visible) throws IOException {
+ boolean expanded, boolean visible) throws IOException {
String state = getState(expanded);
String styleClass = getStyleClass(context, control);
String style = getStyle(context, control);
@@ -177,6 +178,11 @@
options.put("collapseControl", toggleControlId + ":collapse");
String eventName = toggleControl.getEvent();
+
+ if (Strings.isNullOrEmpty(eventName)) {
+ eventName = AbstractCollapsibleSubTableToggler.DEFAULT_EVENT;
+ }
+
eventName = eventName.trim().startsWith("on") ? eventName.substring(2) : eventName;
options.put("eventName", eventName);
return options;
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -145,7 +145,13 @@
for (; iterator.hasNext();) {
columns.add(iterator.next());
}
- int count = Math.min(((Integer) table.getAttributes().get("frozenColumns")).intValue(), columns.size());
+
+ int frozenColumnsAttribute = (Integer) table.getAttributes().get("frozenColumns");
+ if (frozenColumnsAttribute < 0) {
+ frozenColumnsAttribute = 0;
+ }
+
+ int count = Math.min(frozenColumnsAttribute, columns.size());
frozenColumns = columns.subList(0, count);
columns = columns.subList(count, columns.size());
parts = new ArrayList<Part>(PartName.values().length);
@@ -808,46 +814,7 @@
}
decodeSortingFiltering(context, component);
-
- /*
- if (map.get(component.getClientId(context)) != null) {
- decodeFiltering(context, component, map.get("rich:filterString"));
- }
- if (map.get(component.getClientId(context)) != null) {
- decodeSorting(context, component, map.get("rich:sortString"));
- } */
}
- /*
- private void updateAttribute(FacesContext context, UIComponent component, String attribute, Object value) {
- Object oldValue = component.getAttributes().get(attribute);
- if ((oldValue != null && !oldValue.equals(value)) || (oldValue == null && value != null)) {
- ELContext elContext = context.getELContext();
- ValueExpression ve = component.getValueExpression(attribute);
- if (ve != null && !ve.isReadOnly(elContext)) {
- component.getAttributes().put(attribute, null);
- try {
- ve.setValue(elContext, value);
- } catch (ELException e) {
- throw new FacesException(e);
- }
- } else {
- component.getAttributes().put(attribute, value);
- }
- }
- }
-
- private void updateSortOrder(FacesContext context, UIComponent component, String value) {
- SortOrder sortOrder = SortOrder.ascending;
- try {
- sortOrder = SortOrder.valueOf(value);
- } catch (IllegalArgumentException e) {
- // If value isn't name of enum constant of SortOrder, toggle sortOrder of column.
- if (SortOrder.ascending.equals(component.getAttributes().get("sortOrder"))) {
- sortOrder = SortOrder.descending;
- }
- }
- updateAttribute(context, component, "sortOrder", sortOrder);
- }*/
private void updateWidthOfColumns(FacesContext context, UIComponent component, String widthString) {
if (widthString != null && widthString.length() > 0) {
@@ -879,57 +846,7 @@
}
}
}
-
- /*
- private void decodeFiltering(FacesContext context, UIComponent component, String value) {
- if (value != null && value.length() > 0) {
- String[] values = value.split(":");
- if (Boolean.parseBoolean(values[2])) {
- UIDataTableBase table = (UIDataTableBase) component;
- for (Iterator<UIComponent> iterator = table.columns(); iterator.hasNext();) {
- UIComponent column = iterator.next();
- if (values[0].equals(column.getId())) {
- updateAttribute(context, column, "filterValue", values[1]);
- } else {
- updateAttribute(context, column, "filterValue", null);
- }
- }
- } else {
- updateAttribute(context, component.findComponent(values[0]), "filterValue", values[1]);
- }
- context.getPartialViewContext().getRenderIds().add(component.getClientId(context)); // TODO Use partial re-rendering here.
- }
- }
- *
- private void decodeSorting(FacesContext context, UIComponent component, String value) {
- if (value != null && value.length() > 0) {
- UIDataTableBase table = (UIDataTableBase) component;
- List<Object> sortPriority = new LinkedList<Object>();
- String[] values = value.split(":");
- if (Boolean.parseBoolean(values[2]) || SortMode.single.equals(table.getSortMode())) {
- for (Iterator<UIComponent> iterator = table.columns(); iterator.hasNext();) {
- UIComponent column = iterator.next();
- if (values[0].equals(column.getId())) {
- updateSortOrder(context, column, values[1]);
- sortPriority.add(values[0]);
- } else {
- updateAttribute(context, column, "sortOrder", SortOrder.UNSORTED);
- }
- }
- } else {
- updateSortOrder(context, component.findComponent(values[0]), values[1]);
- Collection<?> priority = table.getSortPriority();
- if (priority != null) {
- priority.remove(values[0]);
- sortPriority.addAll(priority);
- }
- sortPriority.add(values[0]);
- }
- updateAttribute(context, component, "sortPriority", sortPriority);
- context.getPartialViewContext().getRenderIds().add(component.getClientId(context)); // TODO Use partial re-rendering here.
- }
- } */
-
+
/**
* @deprecated
* TODO Remove this method when width in relative units in columns will be implemented.
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -22,6 +22,7 @@
package org.richfaces.renderkit;
import static org.richfaces.renderkit.RenderKitUtils.getFirstNonEmptyAttribute;
+import static org.richfaces.renderkit.TreeRendererBase.getToggleTypeOrDefault;
import java.io.IOException;
import java.util.Map;
@@ -139,7 +140,7 @@
if (Strings.isNullOrEmpty(iconCollapsed) && Strings.isNullOrEmpty(iconExpanded)) {
encodeIconForNodeState(context, tree, treeNode, nodeState, null);
} else {
- SwitchType toggleType = treeNode.findTreeComponent().getToggleType();
+ SwitchType toggleType = getToggleTypeOrDefault(treeNode.findTreeComponent());
if (toggleType == SwitchType.client || nodeState == TreeNodeState.collapsed) {
encodeIconForNodeState(context, tree, treeNode, TreeNodeState.collapsed, iconCollapsed);
@@ -176,7 +177,7 @@
AbstractTree tree = treeNode.findTreeComponent();
- if (tree.getToggleType() != SwitchType.ajax) {
+ if (getToggleTypeOrDefault(tree) != SwitchType.ajax) {
return null;
}
@@ -191,4 +192,5 @@
return null;
}
+
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -95,7 +95,7 @@
protected String getAjaxSubmitFunction(FacesContext context, UIComponent component) {
AbstractTree tree = (AbstractTree) component;
- if (tree.getToggleType() != SwitchType.ajax && tree.getSelectionType() != SwitchType.ajax) {
+ if (getToggleTypeOrDefault(tree) != SwitchType.ajax && getSelectionTypeOrDefault(tree) != SwitchType.ajax) {
return null;
}
@@ -155,11 +155,11 @@
return component.getClientId(context) + SELECTION_STATE;
}
- protected SwitchType getSelectionMode(FacesContext context, UIComponent component) {
+ protected SwitchType getSelectionType(FacesContext context, UIComponent component) {
AbstractTree tree = (AbstractTree) component;
- SwitchType selectionType = tree.getSelectionType();
- if (selectionType != null && selectionType != SwitchType.ajax && selectionType != SwitchType.client) {
+ SwitchType selectionType = getSelectionTypeOrDefault(tree);
+ if (selectionType != SwitchType.ajax && selectionType != SwitchType.client) {
//TODO - better message
throw new IllegalArgumentException(String.valueOf(selectionType));
}
@@ -246,4 +246,20 @@
protected void deleteTreeRenderingContext(FacesContext context) {
TreeRenderingContext.delete(context);
}
+
+ static SwitchType getSelectionTypeOrDefault(AbstractTree tree) {
+ SwitchType selectionType = tree.getSelectionType();
+ if (selectionType == null) {
+ selectionType = SwitchType.client;
+ }
+ return selectionType;
+ }
+
+ static SwitchType getToggleTypeOrDefault(AbstractTree tree) {
+ SwitchType toggleType = tree.getToggleType();
+ if (toggleType == null) {
+ toggleType = SwitchType.DEFAULT;
+ }
+ return toggleType;
+ }
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRenderingContext.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRenderingContext.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRenderingContext.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -22,6 +22,7 @@
package org.richfaces.renderkit;
import static com.google.common.base.Strings.isNullOrEmpty;
+import static org.richfaces.renderkit.TreeRendererBase.getToggleTypeOrDefault;
import java.io.IOException;
import java.util.HashMap;
@@ -179,7 +180,7 @@
String relativeClientId = clientId.substring(baseClientId.length());
- if (tree.getToggleType() != SwitchType.server) {
+ if (getToggleTypeOrDefault(tree) != SwitchType.server) {
String toggleHandler = (String) RenderKitUtils.getAttributeAndBehaviorsValue(context, treeNode, ONTOGGLE_ATTRIBUTE);
if (!isNullOrEmpty(toggleHandler)) {
getOrCreateHandlers(relativeClientId).setToggleHandler(toggleHandler);
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.js 2010-12-27 23:37:21 UTC (rev 20820)
@@ -6,7 +6,7 @@
this.id = id;
this.stateInput = options.stateInput;
this.optionsInput = options.optionsInput;
- this.expandMode = options.expandMode;
+ this.expandMode = options.expandMode || richfaces.ui.CollapsibleSubTable.MODE_CLNT;
this.eventOptions = options.eventOptions;
this.formId = f;
Modified: trunk/ui/iteration/ui/src/main/templates/tree.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/tree.template.xml 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/main/templates/tree.template.xml 2010-12-27 23:37:21 UTC (rev 20820)
@@ -42,7 +42,7 @@
<script type="text/javascript">
<cdk:scriptObject name="options">
<cdk:scriptOption attributes="toggleType" defaultValue="SwitchType.DEFAULT" />
- <cdk:scriptOption name="selectionType" value="#{getSelectionMode(facesContext, component)}" defaultValue="SwitchType.client" />
+ <cdk:scriptOption name="selectionType" value="#{getSelectionType(facesContext, component)}" defaultValue="SwitchType.client" />
<cdk:scriptOption name="ajaxSubmitFunction" value="#{getAjaxSubmitFunction(facesContext, component)}" />
<cdk:scriptOption attributes="onselectionchange onbeforeselectionchange toggleNodeEvent" />
<cdk:scriptOption variables="clientEventHandlers" />
Modified: trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIColumnTest.java
===================================================================
--- trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIColumnTest.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIColumnTest.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -71,7 +71,7 @@
*/
@Test
public final void testSortOrder() {
- Assert.assertEquals(SortOrder.unsorted, column.getSortOrder());
+ Assert.assertNull(column.getSortOrder());
column.setSortOrder(SortOrder.ascending);
Assert.assertEquals(SortOrder.ascending, column.getSortOrder());
environment.replay();
Modified: trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
===================================================================
--- trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-12-27 23:26:18 UTC (rev 20819)
+++ trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-12-27 23:37:21 UTC (rev 20820)
@@ -287,7 +287,7 @@
Map<String, Object> column1Attributes = component.findComponent("column1").getAttributes();
Map<String, Object> column2Attributes = component.findComponent("column2").getAttributes();
String clientId = component.getClientId(facesContext);
- assertEquals(SortOrder.unsorted, column1Attributes.get("sortOrder"));
+ assertNull(column1Attributes.get("sortOrder"));
assertEquals(SortOrder.ascending, column2Attributes.get("sortOrder"));
facesRequest.withParameter(clientId, clientId);
facesRequest.withParameter(clientId + "rich:sorting", "column1:null:null");
@@ -308,7 +308,7 @@
Map<String, Object> column1Attributes = component.findComponent("column1").getAttributes();
Map<String, Object> column2Attributes = component.findComponent("column2").getAttributes();
String clientId = component.getClientId(facesContext);
- assertEquals(SortOrder.unsorted, column1Attributes.get("sortOrder"));
+ assertNull(column1Attributes.get("sortOrder"));
assertEquals(SortOrder.ascending, column2Attributes.get("sortOrder"));
facesRequest.withParameter(clientId, clientId);
facesRequest.withParameter(clientId + "rich:sorting", "column1:descending:true");
14 years