JBoss Rich Faces SVN: r18732 - in branches: RF-9096/src/main/java/org/richfaces/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-17 15:00:11 -0400 (Tue, 17 Aug 2010)
New Revision: 18732
Added:
branches/RF-9096/
branches/RF-9096/src/main/java/org/richfaces/component/AbstractAuto_complete.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeEncodeStrategy.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeRendererBase.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeBaseGradient.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeButtonGradient.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeFieldGradient.java
branches/RF-9096/src/main/java/org/richfaces/view/facelets/Auto_completeHandler.java
branches/RF-9096/src/main/templates/auto_complete.template.xml
Removed:
branches/RF-9096/src/main/java/org/richfaces/component/AbstractAutoComplete.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/AutoCompleteEncodeStrategy.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteBaseGradient.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteButtonGradient.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteFieldGradient.java
branches/RF-9096/src/main/java/org/richfaces/view/facelets/AutoCompleteHandler.java
branches/RF-9096/src/main/templates/autoComplete.template.xml
Modified:
branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteGridLayoutStrategy.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java
branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java
Log:
RF-9096
Copied: branches/RF-9096 (from rev 18730, trunk/ui/input/ui)
Deleted: branches/RF-9096/src/main/java/org/richfaces/component/AbstractAutoComplete.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutoComplete.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/component/AbstractAutoComplete.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,259 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.component;
-
-import java.io.IOException;
-
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-import javax.faces.application.Application;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
-import javax.faces.component.visit.VisitCallback;
-import javax.faces.component.visit.VisitContext;
-import javax.faces.component.visit.VisitResult;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.util.ELUtils;
-import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.EventName;
-import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.Signature;
-import org.richfaces.cdk.annotations.Tag;
-import org.richfaces.cdk.annotations.TagType;
-import org.richfaces.context.ExtendedVisitContext;
-import org.richfaces.context.ExtendedVisitContextMode;
-import org.richfaces.renderkit.MetaComponentRenderer;
-
-/**
- * @author Nick Belaevski
- *
- */
-@JsfComponent(tag = @Tag(type = TagType.Facelets, handler = "org.richfaces.view.facelets.AutoCompleteHandler"), renderer = @JsfRenderer(type = "org.richfaces.AutoCompleteRenderer"))
-public abstract class AbstractAutoComplete extends UIInput implements MetaComponentResolver, MetaComponentEncoder {
-
- public static final String ITEMS_META_COMPONENT_ID = "items";
-
- public static final String COMPONENT_TYPE = "org.richfaces.AutoComplete";
-
- public static final String COMPONENT_FAMILY = UIInput.COMPONENT_FAMILY;
-
- // TODO nick - change to Object - https://jira.jboss.org/browse/RF-8897
- public abstract Object getAutocompleteList();
-
- @Attribute(signature = @Signature(returnType = Object.class, parameters = {FacesContext.class, UIComponent.class, String.class}))
- public abstract MethodExpression getAutocompleteMethod();
-
- public abstract void setAutocompleteMethod(MethodExpression expression);
-
- public abstract void setItemConverter(Converter converter);
-
- @Attribute(literal = true)
- public abstract String getVar();
-
- // TODO nick - el-only?
- @Attribute(literal = false)
- public abstract Object getFetchValue();
-
- @Attribute(defaultValue = "1")
- public abstract int getMinChars();
-
- @Attribute
- public abstract String getFilterFunction();
-
- @Attribute(defaultValue = "rf-au-c")
- public abstract String getSelectedItemClass();
-
- @Attribute
- public abstract String getMode();
-
- @Attribute
- public abstract String getLayout();
-
- @Attribute
- public abstract Converter getItemConverter();
-
- @Attribute(defaultValue = "false")
- public abstract boolean isAutoFill();
-
- @Attribute(defaultValue = "false")
- public abstract boolean isDisabled();
-
- @Attribute(defaultValue = "false")
- public abstract boolean isShowButton();
-
- @Attribute(defaultValue = "false")
- public abstract boolean isSelectFirst();
-
- @Attribute(events = @EventName("click"))
- public abstract String getOnclick();
-
- @Attribute(events = @EventName("dblclick"))
- public abstract String getOndblclick();
-
- @Attribute(events = @EventName("mousedown"))
- public abstract String getOnmousedown();
-
- @Attribute(events = @EventName("mouseup"))
- public abstract String getOnmouseup();
-
- @Attribute(events = @EventName("mouseover"))
- public abstract String getOnmouseover();
-
- @Attribute(events = @EventName("mousemove"))
- public abstract String getOnmousemove();
-
- @Attribute(events = @EventName("mouseout"))
- public abstract String getOnmouseout();
-
- @Attribute(events = @EventName("keypress"))
- public abstract String getOnkeypress();
-
- @Attribute(events = @EventName("keydown"))
- public abstract String getOnkeydown();
-
- @Attribute(events = @EventName("keyup"))
- public abstract String getOnkeyup();
-
- @Attribute(events = @EventName("listclick"))
- public abstract String getOnlistclick();
-
- @Attribute(events = @EventName("listdblclick"))
- public abstract String getOnlistdblclick();
-
- @Attribute(events = @EventName("listmousedown"))
- public abstract String getOnlistmousedown();
-
- @Attribute(events = @EventName("listmouseup"))
- public abstract String getOnlistmouseup();
-
- @Attribute(events = @EventName("listmouseover"))
- public abstract String getOnlistmouseover();
-
- @Attribute(events = @EventName("listmousemove"))
- public abstract String getOnlistmousemove();
-
- @Attribute(events = @EventName("listmouseout"))
- public abstract String getOnlistmouseout();
-
- @Attribute(events = @EventName("listkeypress"))
- public abstract String getOnlistkeypress();
-
- @Attribute(events = @EventName("listkeydown"))
- public abstract String getOnlistkeydown();
-
- @Attribute(events = @EventName("listkeyup"))
- public abstract String getOnlistkeyup();
-
- @Attribute(events = @EventName("change"))
- public abstract String getOnchange();
-
- @Attribute(events = @EventName("blur"))
- public abstract String getOnblur();
-
- @Attribute(events = @EventName("focus"))
- public abstract String getOnfocus();
-
- @Attribute(events = @EventName("listblur"))
- public abstract String getOnlistblur();
-
- @Attribute(events = @EventName("listfocus"))
- public abstract String getOnlistfocus();
-
- @Attribute(events = @EventName("begin"))
- public abstract String getOnbegin();
-
- @Attribute(events = @EventName("error"))
- public abstract String getOnerror();
-
- @Attribute(events = @EventName("complete"))
- public abstract String getOncomplete();
-
- @Attribute(events = @EventName("beforedomupdate"))
- public abstract String getOnbeforedomupdate();
-
- @Override
- public Converter getConverter() {
- Converter converter = super.getConverter();
- if (converter == null) {
- converter = getConverterForValue(FacesContext.getCurrentInstance());
- }
-
- return converter;
- }
-
- private Converter getConverterForType(FacesContext context, Class<?> type) {
-
- if (!Object.class.equals(type) && type != null) {
- Application application = context.getApplication();
- return application.createConverter(type);
- }
-
- return null;
- }
-
- public Converter getConverterForValue(FacesContext context) {
- Converter converter = null;
- ValueExpression expression = this.getValueExpression("value");
-
- if (expression != null) {
- Class<?> containerClass = ELUtils.getContainerClass(context, expression);
-
- converter = getConverterForType(context, containerClass);
- }
-
- return converter;
- }
-
- public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
- if (ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
- return getClientId(facesContext) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + metaComponentId;
- }
-
- return null;
- }
-
- @Override
- public boolean visitTree(VisitContext context, VisitCallback callback) {
- if (context instanceof ExtendedVisitContext) {
- ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) context;
- if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER) {
-
- VisitResult result = extendedVisitContext.invokeMetaComponentVisitCallback(this, callback,
- ITEMS_META_COMPONENT_ID);
- if (result == VisitResult.COMPLETE) {
- return true;
- } else if (result == VisitResult.REJECT) {
- return false;
- }
- }
- }
-
- return super.visitTree(context, callback);
- }
-
- public void encodeMetaComponent(FacesContext context, String metaComponentId) throws IOException {
- ((MetaComponentRenderer) getRenderer(context)).encodeMetaComponent(context, this, metaComponentId);
- }
-}
Copied: branches/RF-9096/src/main/java/org/richfaces/component/AbstractAuto_complete.java (from rev 18730, trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutoComplete.java)
===================================================================
--- branches/RF-9096/src/main/java/org/richfaces/component/AbstractAuto_complete.java (rev 0)
+++ branches/RF-9096/src/main/java/org/richfaces/component/AbstractAuto_complete.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,259 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import java.io.IOException;
+
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitResult;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.util.ELUtils;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Signature;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.context.ExtendedVisitContext;
+import org.richfaces.context.ExtendedVisitContextMode;
+import org.richfaces.renderkit.MetaComponentRenderer;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@JsfComponent(tag = @Tag(type = TagType.Facelets, handler = "org.richfaces.view.facelets.AutocompleteHandler"), renderer = @JsfRenderer(type = "org.richfaces.AutocompleteRenderer"))
+public abstract class AbstractAuto_complete extends UIInput implements MetaComponentResolver, MetaComponentEncoder {
+
+ public static final String ITEMS_META_COMPONENT_ID = "items";
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Autocomplete";
+
+ public static final String COMPONENT_FAMILY = UIInput.COMPONENT_FAMILY;
+
+ // TODO nick - change to Object - https://jira.jboss.org/browse/RF-8897
+ public abstract Object getAutocompleteList();
+
+ @Attribute(signature = @Signature(returnType = Object.class, parameters = {FacesContext.class, UIComponent.class, String.class}))
+ public abstract MethodExpression getAutocompleteMethod();
+
+ public abstract void setAutocompleteMethod(MethodExpression expression);
+
+ public abstract void setItemConverter(Converter converter);
+
+ @Attribute(literal = true)
+ public abstract String getVar();
+
+ // TODO nick - el-only?
+ @Attribute(literal = false)
+ public abstract Object getFetchValue();
+
+ @Attribute(defaultValue = "1")
+ public abstract int getMinChars();
+
+ @Attribute
+ public abstract String getFilterFunction();
+
+ @Attribute(defaultValue = "rf-au-c")
+ public abstract String getSelectedItemClass();
+
+ @Attribute
+ public abstract String getMode();
+
+ @Attribute
+ public abstract String getLayout();
+
+ @Attribute
+ public abstract Converter getItemConverter();
+
+ @Attribute(defaultValue = "false")
+ public abstract boolean isAutoFill();
+
+ @Attribute(defaultValue = "false")
+ public abstract boolean isDisabled();
+
+ @Attribute(defaultValue = "false")
+ public abstract boolean isShowButton();
+
+ @Attribute(defaultValue = "false")
+ public abstract boolean isSelectFirst();
+
+ @Attribute(events = @EventName("click"))
+ public abstract String getOnclick();
+
+ @Attribute(events = @EventName("dblclick"))
+ public abstract String getOndblclick();
+
+ @Attribute(events = @EventName("mousedown"))
+ public abstract String getOnmousedown();
+
+ @Attribute(events = @EventName("mouseup"))
+ public abstract String getOnmouseup();
+
+ @Attribute(events = @EventName("mouseover"))
+ public abstract String getOnmouseover();
+
+ @Attribute(events = @EventName("mousemove"))
+ public abstract String getOnmousemove();
+
+ @Attribute(events = @EventName("mouseout"))
+ public abstract String getOnmouseout();
+
+ @Attribute(events = @EventName("keypress"))
+ public abstract String getOnkeypress();
+
+ @Attribute(events = @EventName("keydown"))
+ public abstract String getOnkeydown();
+
+ @Attribute(events = @EventName("keyup"))
+ public abstract String getOnkeyup();
+
+ @Attribute(events = @EventName("listclick"))
+ public abstract String getOnlistclick();
+
+ @Attribute(events = @EventName("listdblclick"))
+ public abstract String getOnlistdblclick();
+
+ @Attribute(events = @EventName("listmousedown"))
+ public abstract String getOnlistmousedown();
+
+ @Attribute(events = @EventName("listmouseup"))
+ public abstract String getOnlistmouseup();
+
+ @Attribute(events = @EventName("listmouseover"))
+ public abstract String getOnlistmouseover();
+
+ @Attribute(events = @EventName("listmousemove"))
+ public abstract String getOnlistmousemove();
+
+ @Attribute(events = @EventName("listmouseout"))
+ public abstract String getOnlistmouseout();
+
+ @Attribute(events = @EventName("listkeypress"))
+ public abstract String getOnlistkeypress();
+
+ @Attribute(events = @EventName("listkeydown"))
+ public abstract String getOnlistkeydown();
+
+ @Attribute(events = @EventName("listkeyup"))
+ public abstract String getOnlistkeyup();
+
+ @Attribute(events = @EventName("change"))
+ public abstract String getOnchange();
+
+ @Attribute(events = @EventName("blur"))
+ public abstract String getOnblur();
+
+ @Attribute(events = @EventName("focus"))
+ public abstract String getOnfocus();
+
+ @Attribute(events = @EventName("listblur"))
+ public abstract String getOnlistblur();
+
+ @Attribute(events = @EventName("listfocus"))
+ public abstract String getOnlistfocus();
+
+ @Attribute(events = @EventName("begin"))
+ public abstract String getOnbegin();
+
+ @Attribute(events = @EventName("error"))
+ public abstract String getOnerror();
+
+ @Attribute(events = @EventName("complete"))
+ public abstract String getOncomplete();
+
+ @Attribute(events = @EventName("beforedomupdate"))
+ public abstract String getOnbeforedomupdate();
+
+ @Override
+ public Converter getConverter() {
+ Converter converter = super.getConverter();
+ if (converter == null) {
+ converter = getConverterForValue(FacesContext.getCurrentInstance());
+ }
+
+ return converter;
+ }
+
+ private Converter getConverterForType(FacesContext context, Class<?> type) {
+
+ if (!Object.class.equals(type) && type != null) {
+ Application application = context.getApplication();
+ return application.createConverter(type);
+ }
+
+ return null;
+ }
+
+ public Converter getConverterForValue(FacesContext context) {
+ Converter converter = null;
+ ValueExpression expression = this.getValueExpression("value");
+
+ if (expression != null) {
+ Class<?> containerClass = ELUtils.getContainerClass(context, expression);
+
+ converter = getConverterForType(context, containerClass);
+ }
+
+ return converter;
+ }
+
+ public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
+ if (ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
+ return getClientId(facesContext) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + metaComponentId;
+ }
+
+ return null;
+ }
+
+ @Override
+ public boolean visitTree(VisitContext context, VisitCallback callback) {
+ if (context instanceof ExtendedVisitContext) {
+ ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) context;
+ if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER) {
+
+ VisitResult result = extendedVisitContext.invokeMetaComponentVisitCallback(this, callback,
+ ITEMS_META_COMPONENT_ID);
+ if (result == VisitResult.COMPLETE) {
+ return true;
+ } else if (result == VisitResult.REJECT) {
+ return false;
+ }
+ }
+ }
+
+ return super.visitTree(context, callback);
+ }
+
+ public void encodeMetaComponent(FacesContext context, String metaComponentId) throws IOException {
+ ((MetaComponentRenderer) getRenderer(context)).encodeMetaComponent(context, this, metaComponentId);
+ }
+}
Deleted: branches/RF-9096/src/main/java/org/richfaces/renderkit/AutoCompleteEncodeStrategy.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteEncodeStrategy.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/AutoCompleteEncodeStrategy.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,22 +0,0 @@
-package org.richfaces.renderkit;
-
-import java.io.IOException;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.component.AbstractAutoComplete;
-
-
-public interface AutoCompleteEncodeStrategy {
- void encodeItemsContainerBegin(FacesContext facesContext, UIComponent component) throws IOException ;
-
- void encodeItemsContainerEnd(FacesContext facesContext, UIComponent component) throws IOException ;
-
- void encodeFakeItem(FacesContext facesContext, UIComponent component) throws IOException ;
-
- void encodeItem(FacesContext facesContext, AbstractAutoComplete comboBox,
- Object nextItem) throws IOException;
-
- public String getContainerElementId(FacesContext facesContext, UIComponent component);
-}
Deleted: branches/RF-9096/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,261 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.renderkit;
-
-import java.io.IOException;
-import java.sql.ResultSet;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.PartialResponseWriter;
-import javax.faces.context.PartialViewContext;
-import javax.faces.model.ArrayDataModel;
-import javax.faces.model.DataModel;
-import javax.faces.model.ListDataModel;
-import javax.faces.model.ResultDataModel;
-import javax.faces.model.ResultSetDataModel;
-import javax.servlet.jsp.jstl.sql.Result;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.javascript.ScriptUtils;
-import org.ajax4jsf.renderkit.RendererUtils;
-import org.ajax4jsf.util.InputUtils;
-import org.richfaces.component.AbstractAutoComplete;
-import org.richfaces.component.AutocompleteLayout;
-import org.richfaces.component.MetaComponentResolver;
-
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterators;
-
-/**
- * @author Nick Belaevski
- *
- */
-@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
- @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "jquery.position.js"),
- @ResourceDependency(name = "richfaces.js"), @ResourceDependency(name = "richfaces-event.js"),
- @ResourceDependency(name = "richfaces-base-component.js"), @ResourceDependency(name = "richfaces-selection.js"),
- @ResourceDependency(library = "org.richfaces", name = "AutoCompleteBase.js"),
- @ResourceDependency(library = "org.richfaces", name = "AutoComplete.js"),
- @ResourceDependency(library = "org.richfaces", name = "AutoComplete.ecss")
-
-})
-public abstract class AutoCompleteRendererBase extends InputRendererBase implements MetaComponentRenderer {
-
- public String getScriptOptions(UIComponent component) {
- Map<String, Object> attributes = component.getAttributes();
- Map<String, Object> options = new HashMap<String, Object>();
- RendererUtils utils = getUtils();
- utils.addToScriptHash(options, "buttonId", component.getClientId() + "Button");
- utils.addToScriptHash(options, "selectedItemClass", attributes.get("selectedItemClass"));
- utils.addToScriptHash(options, "minChars", attributes.get("minChars"), "1");
- utils.addToScriptHash(options, "mode", attributes.get("mode"), "ajax");
- utils.addToScriptHash(options, "filterFunction", attributes.get("filterFunction"));
- utils.addToScriptHash(options, "autoFill", attributes.get("autoFill"), "false");
- utils.addToScriptHash(options, "disabled", attributes.get("disabled"), "false");
- utils.addToScriptHash(options, "selectFirst", attributes.get("selectFirst"), "false");
- utils.addToScriptHash(options, "onbegin", attributes.get("onbegin"));
- utils.addToScriptHash(options, "oncomplete", attributes.get("oncomplete"));
- utils.addToScriptHash(options, "onerror", attributes.get("onerror"));
- utils.addToScriptHash(options, "onbeforedomupdate", attributes.get("onbeforedomupdate"));
- utils.addToScriptHash(options, "onchange", attributes.get("onchange"));
- StringBuilder builder = new StringBuilder();
- builder.append(ScriptUtils.toScript(options));
- return builder.toString();
- }
-
- // TODO nick - handle parameter
- @SuppressWarnings("unchecked")
- private DataModel<Object> getItems(FacesContext facesContext, AbstractAutoComplete component) {
- Object itemsObject = null;
-
- MethodExpression autocompleteMethod = component.getAutocompleteMethod();
- if (autocompleteMethod != null) {
- Map<String, String> requestParameters = facesContext.getExternalContext().getRequestParameterMap();
- String value = requestParameters.get(component.getClientId(facesContext) + "Value");
- try {
- // String value = getInputValue(facesContext, component);
-
- itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[] { facesContext,
- component, value });
- } catch (ELException e) {
- try {
- autocompleteMethod = facesContext
- .getApplication()
- .getExpressionFactory()
- .createMethodExpression(facesContext.getELContext(), autocompleteMethod.getExpressionString(),
- Void.class, new Class[] { String.class });
- itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[] { value });
- } catch (ELException ee) {
- ee.printStackTrace();
- }
-
- }
- } else {
- itemsObject = component.getAutocompleteList();
- }
-
- DataModel result;
-
- if (itemsObject instanceof Object[]) {
- result = new ArrayDataModel((Object[]) itemsObject);
- } else if (itemsObject instanceof List) {
- result = new ListDataModel((List<Object>) itemsObject);
- } else if (itemsObject instanceof Result) {
- result = new ResultDataModel((Result) itemsObject);
- } else if (itemsObject instanceof ResultSet) {
- result = new ResultSetDataModel((ResultSet) itemsObject);
- } else if (itemsObject != null) {
- List<Object> temp = new ArrayList<Object>();
- Iterator<Object> iterator = ((Iterable<Object>) itemsObject).iterator();
- while (iterator.hasNext()) {
- temp.add(iterator.next());
- }
- result = new ListDataModel(temp);
- } else {
- result = new ListDataModel(null);
- }
-
- return result;
- }
-
- private Object saveVar(FacesContext context, String var) {
- if (var != null) {
- Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
- return requestMap.get(var);
- }
-
- return null;
- }
-
- private void setVar(FacesContext context, String var, Object varObject) {
- if (var != null) {
- Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
- requestMap.put(var, varObject);
- }
- }
-
- protected void encodeItems(FacesContext facesContext, UIComponent component, List<Object> fetchValues)
- throws IOException {
- AbstractAutoComplete comboBox = (AbstractAutoComplete) component;
- AutoCompleteEncodeStrategy strategy = getStrategy(component);
- strategy.encodeItemsContainerBegin(facesContext, component);
-
- boolean hasEncodedElements = false;
-
- Object savedVar = saveVar(facesContext, comboBox.getVar());
- DataModel<Object> model = getItems(facesContext, comboBox);
- for (Iterator<Object> items = model.iterator(); items.hasNext();) {
- hasEncodedElements = true;
-
- Object nextItem = items.next();
- setVar(facesContext, comboBox.getVar(), nextItem);
-
- strategy.encodeItem(facesContext, comboBox, nextItem);
- if (comboBox.getFetchValue() != null) {
- fetchValues.add(comboBox.getFetchValue());
- } else {
- // TODO use converter
- fetchValues.add(nextItem);
- }
- }
-
- setVar(facesContext, comboBox.getVar(), savedVar);
-
- if (!hasEncodedElements) {
- strategy.encodeFakeItem(facesContext, component);
- }
-
- strategy.encodeItemsContainerEnd(facesContext, component);
- }
-
- protected void encodeItemsContainer(FacesContext facesContext, UIComponent component) throws IOException {
- AutoCompleteEncodeStrategy strategy = getStrategy(component);
- strategy.encodeItemsContainerBegin(facesContext, component);
- strategy.encodeFakeItem(facesContext, component);
- strategy.encodeItemsContainerEnd(facesContext, component);
- }
-
- private AutoCompleteEncodeStrategy getStrategy(UIComponent component) {
- AbstractAutoComplete comboBox = (AbstractAutoComplete) component;
- if (comboBox.getLayout() != null) {
- if (comboBox.getLayout().equals(AutocompleteLayout.div)) {
- return new AutocompleteDivLayoutStrategy();
- }
- if (comboBox.getLayout().equals(AutocompleteLayout.grid)) {
- return new AutocompleteGridLayoutStrategy();
- }
- if (comboBox.getLayout().equals(AutocompleteLayout.list)) {
- return new AutocompleteListLayoutStrategy();
- }
- if (comboBox.getLayout().equals(AutocompleteLayout.table)) {
- return new AutocompleteTableLayoutStrategy();
- }
- }
- return new AutocompleteDivLayoutStrategy();
- }
-
- @Override
- protected void doDecode(FacesContext context, UIComponent component) {
- if (InputUtils.isDisabled(component)) {
- return;
- }
- super.doDecode(context, component);
-
- Map<String, String> requestParameters = context.getExternalContext().getRequestParameterMap();
- if (requestParameters.get(component.getClientId(context) + ".ajax") != null) {
- PartialViewContext pvc = context.getPartialViewContext();
- pvc.getRenderIds().add(
- component.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR
- + AbstractAutoComplete.ITEMS_META_COMPONENT_ID);
- }
- }
-
- public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId)
- throws IOException {
- if (AbstractAutoComplete.ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
-
- List<Object> fetchValues = new ArrayList<Object>();
-
- PartialResponseWriter partialWriter = context.getPartialViewContext().getPartialResponseWriter();
- partialWriter.startUpdate(getStrategy(component).getContainerElementId(context, component));
- encodeItems(context, component, fetchValues);
- partialWriter.endUpdate();
-
- if (!fetchValues.isEmpty() && Iterators.find(fetchValues.iterator(), Predicates.notNull()) != null) {
- Map<String, Object> dataMap = AjaxContext.getCurrentInstance(context).getResponseComponentDataMap();
- dataMap.put(component.getClientId(context), fetchValues);
- }
- } else {
- throw new IllegalArgumentException(metaComponentId);
- }
- }
-}
Copied: branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeEncodeStrategy.java (from rev 18730, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteEncodeStrategy.java)
===================================================================
--- branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeEncodeStrategy.java (rev 0)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeEncodeStrategy.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,22 @@
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.AbstractAuto_complete;
+
+
+public interface Auto_completeEncodeStrategy {
+ void encodeItemsContainerBegin(FacesContext facesContext, UIComponent component) throws IOException ;
+
+ void encodeItemsContainerEnd(FacesContext facesContext, UIComponent component) throws IOException ;
+
+ void encodeFakeItem(FacesContext facesContext, UIComponent component) throws IOException ;
+
+ void encodeItem(FacesContext facesContext, AbstractAuto_complete comboBox,
+ Object nextItem) throws IOException;
+
+ public String getContainerElementId(FacesContext facesContext, UIComponent component);
+}
Copied: branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeRendererBase.java (from rev 18730, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java)
===================================================================
--- branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeRendererBase.java (rev 0)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/Auto_completeRendererBase.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,261 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialResponseWriter;
+import javax.faces.context.PartialViewContext;
+import javax.faces.model.ArrayDataModel;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+import javax.faces.model.ResultDataModel;
+import javax.faces.model.ResultSetDataModel;
+import javax.servlet.jsp.jstl.sql.Result;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.util.InputUtils;
+import org.richfaces.component.AbstractAuto_complete;
+import org.richfaces.component.AutocompleteLayout;
+import org.richfaces.component.MetaComponentResolver;
+
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterators;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "jquery.position.js"),
+ @ResourceDependency(name = "richfaces.js"), @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"), @ResourceDependency(name = "richfaces-selection.js"),
+ @ResourceDependency(library = "org.richfaces", name = "AutoCompleteBase.js"),
+ @ResourceDependency(library = "org.richfaces", name = "AutoComplete.js"),
+ @ResourceDependency(library = "org.richfaces", name = "AutoComplete.ecss")
+
+})
+public abstract class Auto_completeRendererBase extends InputRendererBase implements MetaComponentRenderer {
+
+ public String getScriptOptions(UIComponent component) {
+ Map<String, Object> attributes = component.getAttributes();
+ Map<String, Object> options = new HashMap<String, Object>();
+ RendererUtils utils = getUtils();
+ utils.addToScriptHash(options, "buttonId", component.getClientId() + "Button");
+ utils.addToScriptHash(options, "selectedItemClass", attributes.get("selectedItemClass"));
+ utils.addToScriptHash(options, "minChars", attributes.get("minChars"), "1");
+ utils.addToScriptHash(options, "mode", attributes.get("mode"), "ajax");
+ utils.addToScriptHash(options, "filterFunction", attributes.get("filterFunction"));
+ utils.addToScriptHash(options, "autoFill", attributes.get("autoFill"), "false");
+ utils.addToScriptHash(options, "disabled", attributes.get("disabled"), "false");
+ utils.addToScriptHash(options, "selectFirst", attributes.get("selectFirst"), "false");
+ utils.addToScriptHash(options, "onbegin", attributes.get("onbegin"));
+ utils.addToScriptHash(options, "oncomplete", attributes.get("oncomplete"));
+ utils.addToScriptHash(options, "onerror", attributes.get("onerror"));
+ utils.addToScriptHash(options, "onbeforedomupdate", attributes.get("onbeforedomupdate"));
+ utils.addToScriptHash(options, "onchange", attributes.get("onchange"));
+ StringBuilder builder = new StringBuilder();
+ builder.append(ScriptUtils.toScript(options));
+ return builder.toString();
+ }
+
+ // TODO nick - handle parameter
+ @SuppressWarnings("unchecked")
+ private DataModel<Object> getItems(FacesContext facesContext, AbstractAuto_complete component) {
+ Object itemsObject = null;
+
+ MethodExpression autocompleteMethod = component.getAutocompleteMethod();
+ if (autocompleteMethod != null) {
+ Map<String, String> requestParameters = facesContext.getExternalContext().getRequestParameterMap();
+ String value = requestParameters.get(component.getClientId(facesContext) + "Value");
+ try {
+ // String value = getInputValue(facesContext, component);
+
+ itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[] { facesContext,
+ component, value });
+ } catch (ELException e) {
+ try {
+ autocompleteMethod = facesContext
+ .getApplication()
+ .getExpressionFactory()
+ .createMethodExpression(facesContext.getELContext(), autocompleteMethod.getExpressionString(),
+ Void.class, new Class[] { String.class });
+ itemsObject = autocompleteMethod.invoke(facesContext.getELContext(), new Object[] { value });
+ } catch (ELException ee) {
+ ee.printStackTrace();
+ }
+
+ }
+ } else {
+ itemsObject = component.getAutocompleteList();
+ }
+
+ DataModel result;
+
+ if (itemsObject instanceof Object[]) {
+ result = new ArrayDataModel((Object[]) itemsObject);
+ } else if (itemsObject instanceof List) {
+ result = new ListDataModel((List<Object>) itemsObject);
+ } else if (itemsObject instanceof Result) {
+ result = new ResultDataModel((Result) itemsObject);
+ } else if (itemsObject instanceof ResultSet) {
+ result = new ResultSetDataModel((ResultSet) itemsObject);
+ } else if (itemsObject != null) {
+ List<Object> temp = new ArrayList<Object>();
+ Iterator<Object> iterator = ((Iterable<Object>) itemsObject).iterator();
+ while (iterator.hasNext()) {
+ temp.add(iterator.next());
+ }
+ result = new ListDataModel(temp);
+ } else {
+ result = new ListDataModel(null);
+ }
+
+ return result;
+ }
+
+ private Object saveVar(FacesContext context, String var) {
+ if (var != null) {
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
+ return requestMap.get(var);
+ }
+
+ return null;
+ }
+
+ private void setVar(FacesContext context, String var, Object varObject) {
+ if (var != null) {
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
+ requestMap.put(var, varObject);
+ }
+ }
+
+ protected void encodeItems(FacesContext facesContext, UIComponent component, List<Object> fetchValues)
+ throws IOException {
+ AbstractAuto_complete comboBox = (AbstractAuto_complete) component;
+ Auto_completeEncodeStrategy strategy = getStrategy(component);
+ strategy.encodeItemsContainerBegin(facesContext, component);
+
+ boolean hasEncodedElements = false;
+
+ Object savedVar = saveVar(facesContext, comboBox.getVar());
+ DataModel<Object> model = getItems(facesContext, comboBox);
+ for (Iterator<Object> items = model.iterator(); items.hasNext();) {
+ hasEncodedElements = true;
+
+ Object nextItem = items.next();
+ setVar(facesContext, comboBox.getVar(), nextItem);
+
+ strategy.encodeItem(facesContext, comboBox, nextItem);
+ if (comboBox.getFetchValue() != null) {
+ fetchValues.add(comboBox.getFetchValue());
+ } else {
+ // TODO use converter
+ fetchValues.add(nextItem);
+ }
+ }
+
+ setVar(facesContext, comboBox.getVar(), savedVar);
+
+ if (!hasEncodedElements) {
+ strategy.encodeFakeItem(facesContext, component);
+ }
+
+ strategy.encodeItemsContainerEnd(facesContext, component);
+ }
+
+ protected void encodeItemsContainer(FacesContext facesContext, UIComponent component) throws IOException {
+ Auto_completeEncodeStrategy strategy = getStrategy(component);
+ strategy.encodeItemsContainerBegin(facesContext, component);
+ strategy.encodeFakeItem(facesContext, component);
+ strategy.encodeItemsContainerEnd(facesContext, component);
+ }
+
+ private Auto_completeEncodeStrategy getStrategy(UIComponent component) {
+ AbstractAuto_complete comboBox = (AbstractAuto_complete) component;
+ if (comboBox.getLayout() != null) {
+ if (comboBox.getLayout().equals(AutocompleteLayout.div)) {
+ return new AutocompleteDivLayoutStrategy();
+ }
+ if (comboBox.getLayout().equals(AutocompleteLayout.grid)) {
+ return new AutocompleteGridLayoutStrategy();
+ }
+ if (comboBox.getLayout().equals(AutocompleteLayout.list)) {
+ return new AutocompleteListLayoutStrategy();
+ }
+ if (comboBox.getLayout().equals(AutocompleteLayout.table)) {
+ return new AutocompleteTableLayoutStrategy();
+ }
+ }
+ return new AutocompleteDivLayoutStrategy();
+ }
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ if (InputUtils.isDisabled(component)) {
+ return;
+ }
+ super.doDecode(context, component);
+
+ Map<String, String> requestParameters = context.getExternalContext().getRequestParameterMap();
+ if (requestParameters.get(component.getClientId(context) + ".ajax") != null) {
+ PartialViewContext pvc = context.getPartialViewContext();
+ pvc.getRenderIds().add(
+ component.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR
+ + AbstractAuto_complete.ITEMS_META_COMPONENT_ID);
+ }
+ }
+
+ public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId)
+ throws IOException {
+ if (AbstractAuto_complete.ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
+
+ List<Object> fetchValues = new ArrayList<Object>();
+
+ PartialResponseWriter partialWriter = context.getPartialViewContext().getPartialResponseWriter();
+ partialWriter.startUpdate(getStrategy(component).getContainerElementId(context, component));
+ encodeItems(context, component, fetchValues);
+ partialWriter.endUpdate();
+
+ if (!fetchValues.isEmpty() && Iterators.find(fetchValues.iterator(), Predicates.notNull()) != null) {
+ Map<String, Object> dataMap = AjaxContext.getCurrentInstance(context).getResponseComponentDataMap();
+ dataMap.put(component.getClientId(context), fetchValues);
+ }
+ } else {
+ throw new IllegalArgumentException(metaComponentId);
+ }
+ }
+}
Modified: branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteDivLayoutStrategy.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -29,10 +29,10 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.richfaces.component.AbstractAutoComplete;
+import org.richfaces.component.AbstractAuto_complete;
public class AutocompleteDivLayoutStrategy extends AbstractAutocompleteLayoutStrategy implements
- AutoCompleteEncodeStrategy {
+ Auto_completeEncodeStrategy {
public void encodeFakeItem(FacesContext facesContext, UIComponent component) throws IOException {
ResponseWriter responseWriter = facesContext.getResponseWriter();
@@ -54,7 +54,7 @@
responseWriter.endElement(HTML.DIV_ELEM);
}
- public void encodeItem(FacesContext facesContext, AbstractAutoComplete comboBox, Object item) throws IOException {
+ public void encodeItem(FacesContext facesContext, AbstractAuto_complete comboBox, Object item) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HTML.DIV_ELEM, comboBox);
Modified: branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteGridLayoutStrategy.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteGridLayoutStrategy.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteGridLayoutStrategy.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -5,10 +5,10 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.component.AbstractAutoComplete;
+import org.richfaces.component.AbstractAuto_complete;
public class AutocompleteGridLayoutStrategy extends AbstractAutocompleteLayoutStrategy implements
- AutoCompleteEncodeStrategy {
+ Auto_completeEncodeStrategy {
public void encodeFakeItem(FacesContext facesContext, UIComponent component) throws IOException {
// TODO Auto-generated method stub
@@ -25,7 +25,7 @@
}
- public void encodeItem(FacesContext facesContext, AbstractAutoComplete comboBox, Object nextItem)
+ public void encodeItem(FacesContext facesContext, AbstractAuto_complete comboBox, Object nextItem)
throws IOException {
// TODO Auto-generated method stub
Modified: branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteListLayoutStrategy.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -7,10 +7,10 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.richfaces.component.AbstractAutoComplete;
+import org.richfaces.component.AbstractAuto_complete;
public class AutocompleteListLayoutStrategy extends AbstractAutocompleteLayoutStrategy implements
- AutoCompleteEncodeStrategy {
+ Auto_completeEncodeStrategy {
public void encodeFakeItem(FacesContext facesContext, UIComponent component) throws IOException {
ResponseWriter responseWriter = facesContext.getResponseWriter();
@@ -32,7 +32,7 @@
responseWriter.endElement(HTML.UL_ELEMENT);
}
- public void encodeItem(FacesContext facesContext, AbstractAutoComplete comboBox, Object item) throws IOException {
+ public void encodeItem(FacesContext facesContext, AbstractAuto_complete comboBox, Object item) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HTML.LI_ELEMENT, comboBox);
Modified: branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/AutocompleteTableLayoutStrategy.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -5,10 +5,10 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.component.AbstractAutoComplete;
+import org.richfaces.component.AbstractAuto_complete;
public class AutocompleteTableLayoutStrategy extends AbstractAutocompleteLayoutStrategy implements
- AutoCompleteEncodeStrategy {
+ Auto_completeEncodeStrategy {
public void encodeFakeItem(FacesContext facesContext, UIComponent component) throws IOException {
// TODO Auto-generated method stub
@@ -25,7 +25,7 @@
}
- public void encodeItem(FacesContext facesContext, AbstractAutoComplete comboBox, Object nextItem)
+ public void encodeItem(FacesContext facesContext, AbstractAuto_complete comboBox, Object nextItem)
throws IOException {
// TODO Auto-generated method stub
Deleted: branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteBaseGradient.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteBaseGradient.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteBaseGradient.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.renderkit.html.images;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-import org.richfaces.resource.CacheableResource;
-import org.richfaces.resource.DynamicResource;
-import org.richfaces.resource.ImageType;
-import org.richfaces.resource.Java2DUserResource;
-import org.richfaces.resource.StateHolderResource;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
-/**
- * @author Nick Belaevski
- *
- */
-@DynamicResource
-public abstract class AutoCompleteBaseGradient implements Java2DUserResource, CacheableResource, StateHolderResource {
-
- private static final Dimension DIMENSION = new Dimension(18, 8);
-
- private String topColorSkinParameter;
-
- private String bottomColorSkinParameter;
-
- private Color topColor;
-
- private Color bottomColor;
-
- public Map<String, String> getResponseHeaders() {
- return null;
- }
-
- public Date getLastModified() {
- return null;
- }
-
- public ImageType getImageType() {
- return ImageType.PNG;
- }
-
- public Dimension getDimension() {
- return DIMENSION;
- }
-
- public void paint(Graphics2D graphics2d, Dimension dimension) {
- GradientPaint paint = new GradientPaint(0, 0, topColor, 0, dimension.height, bottomColor);
- graphics2d.setPaint(paint);
- graphics2d.fill(new Rectangle(dimension));
- }
-
- public boolean isCacheable(FacesContext context) {
- return true;
- }
-
- public Date getExpires(FacesContext context) {
- return null;
- }
-
- public int getTimeToLive(FacesContext context) {
- return 0;
- }
-
- public String getEntityTag(FacesContext context) {
- return null;
- }
-
- public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
- Skin skin = SkinFactory.getInstance().getSkin(context);
-
- Integer topColor = skin.getColorParameter(context, topColorSkinParameter);
- Integer bottomColor = skin.getColorParameter(context, bottomColorSkinParameter);
-
- dataOutput.writeInt(topColor);
- dataOutput.writeInt(bottomColor);
- }
-
- public void readState(FacesContext context, DataInput dataInput) throws IOException {
- topColor = new Color(dataInput.readInt());
- bottomColor = new Color(dataInput.readInt());
- }
-
- public boolean isTransient() {
- return false;
- }
-
- protected void setTopColorSkinParameter(String topColorSkinParameter) {
- this.topColorSkinParameter = topColorSkinParameter;
- }
-
- protected void setBottomColorSkinParameter(String bottomColorSkinParameter) {
- this.bottomColorSkinParameter = bottomColorSkinParameter;
- }
-}
Deleted: branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteButtonGradient.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteButtonGradient.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteButtonGradient.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.renderkit.html.images;
-
-import org.richfaces.resource.DynamicResource;
-import org.richfaces.skin.Skin;
-
-/**
- * @author Nick Belaevski
- *
- */
-@DynamicResource
-public class AutoCompleteButtonGradient extends AutoCompleteBaseGradient {
-
- public AutoCompleteButtonGradient() {
- setTopColorSkinParameter(Skin.HEADER_GRADIENT_COLOR);
- setBottomColorSkinParameter(Skin.HEADER_BACKGROUND_COLOR);
- }
-
-}
Deleted: branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteFieldGradient.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteFieldGradient.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteFieldGradient.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.renderkit.html.images;
-
-import org.richfaces.resource.DynamicResource;
-import org.richfaces.skin.Skin;
-
-/**
- * @author Nick Belaevski
- *
- */
-@DynamicResource
-public class AutoCompleteFieldGradient extends AutoCompleteBaseGradient {
-
- public AutoCompleteFieldGradient() {
- setTopColorSkinParameter(Skin.ADDITIONAL_BACKGROUND_COLOR);
- setBottomColorSkinParameter(Skin.CONTROL_BACKGROUND_COLOR);
- }
-}
Copied: branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeBaseGradient.java (from rev 18730, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteBaseGradient.java)
===================================================================
--- branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeBaseGradient.java (rev 0)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeBaseGradient.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.CacheableResource;
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DUserResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@DynamicResource
+public abstract class Auto_completeBaseGradient implements Java2DUserResource, CacheableResource, StateHolderResource {
+
+ private static final Dimension DIMENSION = new Dimension(18, 8);
+
+ private String topColorSkinParameter;
+
+ private String bottomColorSkinParameter;
+
+ private Color topColor;
+
+ private Color bottomColor;
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.PNG;
+ }
+
+ public Dimension getDimension() {
+ return DIMENSION;
+ }
+
+ public void paint(Graphics2D graphics2d, Dimension dimension) {
+ GradientPaint paint = new GradientPaint(0, 0, topColor, 0, dimension.height, bottomColor);
+ graphics2d.setPaint(paint);
+ graphics2d.fill(new Rectangle(dimension));
+ }
+
+ public boolean isCacheable(FacesContext context) {
+ return true;
+ }
+
+ public Date getExpires(FacesContext context) {
+ return null;
+ }
+
+ public int getTimeToLive(FacesContext context) {
+ return 0;
+ }
+
+ public String getEntityTag(FacesContext context) {
+ return null;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+
+ Integer topColor = skin.getColorParameter(context, topColorSkinParameter);
+ Integer bottomColor = skin.getColorParameter(context, bottomColorSkinParameter);
+
+ dataOutput.writeInt(topColor);
+ dataOutput.writeInt(bottomColor);
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException {
+ topColor = new Color(dataInput.readInt());
+ bottomColor = new Color(dataInput.readInt());
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ protected void setTopColorSkinParameter(String topColorSkinParameter) {
+ this.topColorSkinParameter = topColorSkinParameter;
+ }
+
+ protected void setBottomColorSkinParameter(String bottomColorSkinParameter) {
+ this.bottomColorSkinParameter = bottomColorSkinParameter;
+ }
+}
Copied: branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeButtonGradient.java (from rev 18730, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteButtonGradient.java)
===================================================================
--- branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeButtonGradient.java (rev 0)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeButtonGradient.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@DynamicResource
+public class Auto_completeButtonGradient extends Auto_completeBaseGradient {
+
+ public Auto_completeButtonGradient() {
+ setTopColorSkinParameter(Skin.HEADER_GRADIENT_COLOR);
+ setBottomColorSkinParameter(Skin.HEADER_BACKGROUND_COLOR);
+ }
+
+}
Copied: branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeFieldGradient.java (from rev 18730, trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/html/images/AutoCompleteFieldGradient.java)
===================================================================
--- branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeFieldGradient.java (rev 0)
+++ branches/RF-9096/src/main/java/org/richfaces/renderkit/html/images/Auto_completeFieldGradient.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@DynamicResource
+public class Auto_completeFieldGradient extends Auto_completeBaseGradient {
+
+ public Auto_completeFieldGradient() {
+ setTopColorSkinParameter(Skin.ADDITIONAL_BACKGROUND_COLOR);
+ setBottomColorSkinParameter(Skin.CONTROL_BACKGROUND_COLOR);
+ }
+}
Deleted: branches/RF-9096/src/main/java/org/richfaces/view/facelets/AutoCompleteHandler.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/AutoCompleteHandler.java 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/java/org/richfaces/view/facelets/AutoCompleteHandler.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,97 +0,0 @@
-/*
- * 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.view.facelets;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRule;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
-
-import org.richfaces.MethodMetadata;
-import org.richfaces.component.AbstractAutoComplete;
-
-/**
- * @author Nick Belaevski
- *
- */
-// TODO nick - this should be generated by CDK
-public class AutoCompleteHandler extends ComponentHandler {
-
- private static final MetaRule AUTOCOMPLETE_METHOD_META_RULE = new MetaRule() {
-
- @Override
- public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
- if (meta.isTargetInstanceOf(AbstractAutoComplete.class)) {
- if ("autocompleteMethod".equals(name)) {
- return new MethodMetadata(attribute, FacesContext.class, UIComponent.class, String.class) {
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractAutoComplete) instance).setAutocompleteMethod(getMethodExpression(ctx));
- }
- };
- }
- /*
- * if ("converter".equals(name)) { return new ConverterMetadata(attribute) { public void
- * applyMetadata(FaceletContext ctx, Object instance) { ((AbstractComboBox)
- * instance).setConverter((Converter) this.getAttr() .getObject(ctx, Converter.class)); } }; }
- */
- /*
- * if ("itemConverter".equals(name)) { return new ConverterMetadata(attribute) { public void
- * applyMetadata(FaceletContext ctx, Object instance) { ((AbstractComboBox)
- * instance).setItemConverter((Converter) this.getAttr() .getObject(ctx, Converter.class)); } }; }
- */
- }
-
- return null;
- }
- };
-
- public AutoCompleteHandler(ComponentConfig config) {
- super(config);
- }
-
- @Override
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRuleset = super.createMetaRuleset(type);
- metaRuleset.addRule(AUTOCOMPLETE_METHOD_META_RULE);
- return metaRuleset;
- }
-
- abstract static class ConverterMetadata extends Metadata {
-
- private final TagAttribute attr;
-
- public ConverterMetadata(TagAttribute attr) {
- this.attr = attr;
- }
-
- public TagAttribute getAttr() {
- return attr;
- }
-
- }
-}
Copied: branches/RF-9096/src/main/java/org/richfaces/view/facelets/Auto_completeHandler.java (from rev 18730, trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/AutoCompleteHandler.java)
===================================================================
--- branches/RF-9096/src/main/java/org/richfaces/view/facelets/Auto_completeHandler.java (rev 0)
+++ branches/RF-9096/src/main/java/org/richfaces/view/facelets/Auto_completeHandler.java 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,97 @@
+/*
+ * 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.view.facelets;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+import org.richfaces.MethodMetadata;
+import org.richfaces.component.AbstractAuto_complete;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+// TODO nick - this should be generated by CDK
+public class Auto_completeHandler extends ComponentHandler {
+
+ private static final MetaRule AUTOCOMPLETE_METHOD_META_RULE = new MetaRule() {
+
+ @Override
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(AbstractAuto_complete.class)) {
+ if ("autocompleteMethod".equals(name)) {
+ return new MethodMetadata(attribute, FacesContext.class, UIComponent.class, String.class) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractAuto_complete) instance).setAutocompleteMethod(getMethodExpression(ctx));
+ }
+ };
+ }
+ /*
+ * if ("converter".equals(name)) { return new ConverterMetadata(attribute) { public void
+ * applyMetadata(FaceletContext ctx, Object instance) { ((AbstractComboBox)
+ * instance).setConverter((Converter) this.getAttr() .getObject(ctx, Converter.class)); } }; }
+ */
+ /*
+ * if ("itemConverter".equals(name)) { return new ConverterMetadata(attribute) { public void
+ * applyMetadata(FaceletContext ctx, Object instance) { ((AbstractComboBox)
+ * instance).setItemConverter((Converter) this.getAttr() .getObject(ctx, Converter.class)); } }; }
+ */
+ }
+
+ return null;
+ }
+ };
+
+ public Auto_completeHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRuleset = super.createMetaRuleset(type);
+ metaRuleset.addRule(AUTOCOMPLETE_METHOD_META_RULE);
+ return metaRuleset;
+ }
+
+ abstract static class ConverterMetadata extends Metadata {
+
+ private final TagAttribute attr;
+
+ public ConverterMetadata(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public TagAttribute getAttr() {
+ return attr;
+ }
+
+ }
+}
Deleted: branches/RF-9096/src/main/templates/autoComplete.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/autoComplete.template.xml 2010-08-17 18:16:23 UTC (rev 18730)
+++ branches/RF-9096/src/main/templates/autoComplete.template.xml 2010-08-17 19:00:11 UTC (rev 18732)
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el" xmlns:cdk="http://richfaces.org/cdk/core"
- xmlns:c="http://richfaces.org/cdk/jstl/core" xmlns:cc="http://richfaces.org/cdk/jsf/composite"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee">
-
- <cc:interface>
- <cdk:class>org.richfaces.renderkit.html.AutoCompleteRenderer</cdk:class>
- <cdk:superclass>org.richfaces.renderkit.AutoCompleteRendererBase</cdk:superclass>
- <cdk:component-family>javax.faces.Input</cdk:component-family>
- <cdk:renderer-type>org.richfaces.AutoCompleteRenderer
- </cdk:renderer-type>
- <cdk:renders-children>true</cdk:renders-children>
- </cc:interface>
-
- <cc:implementation>
- <cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
- <div id="#{clientId}" class="rf-au-f-w rf-au-f">
- <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-ft rf-au-i" />
- <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
- <input onclick="#{component.attributes['onclick']}"
- ondblclick="#{component.attributes['ondblclick']}"
- onmouseup="#{component.attributes['onmouseup']}"
- onmousedown="#{component.attributes['onmousedown']}"
- onmousemove="#{component.attributes['onmousemove']}"
- onblur="#{component.attributes['onblur']}"
- onfocus="#{component.attributes['onfocus']}"
- onmouseover="#{component.attributes['onmouseover']}"
- onmouseout="#{component.attributes['onmouseout']}"
- onkeyup="#{component.attributes['onkeyup']}"
- onkeydown="#{component.attributes['onkeydown']}"
- onkeypress="#{component.attributes['onkeypress']}" id="#{clientId}Input" disabled="#{disabled}" name="#{clientId}" type="text" class="rf-au-ft rf-au-i" />
- <c:if test="#{component.attributes['showButton']}">
- <c:if test="#{component.attributes['disabled']}">
- <div id="#{clientId}Button" class="rf-au-b">
- <div class="rf-au-b-a"></div>
- </div>
- </c:if>
- <c:if test="#{!component.attributes['disabled']}">
- <div id="#{clientId}Button" class="rf-au-b">
- <div class="rf-au-b-a"></div>
- </div>
- </c:if>
- </c:if>
- </div>
-
- <div onclick="#{component.attributes['onlistclick']}"
- ondblclick="#{component.attributes['onlistdblclick']}"
- onmouseup="#{component.attributes['onlistmouseup']}"
- onmousedown="#{component.attributes['onlistmousedown']}"
- onmousemove="#{component.attributes['onlistmousemove']}"
- onmouseover="#{component.attributes['onlistmouseover']}"
- onmouseout="#{component.attributes['onlistmouseout']}"
- onblur="#{component.attributes['onlistblur']}"
- onfocus="#{component.attributes['onlistfocus']}"
- onkeyup="#{component.attributes['onlistkeyup']}"
- onkeydown="#{component.attributes['onlistkeydown']}"
- onkeypress="#{component.attributes['onlistkeypress']}"
- id="#{clientId}List" class="rf-au-l-c">
-
- <div class="rf-au-shw">
- <div class="rf-au-shw-t"></div>
- <div class="rf-au-shw-l"></div>
- <div class="rf-au-shw-r"></div>
- <div class="rf-au-shw-b"></div>
-
- <div class="rf-au-l-d">
- <div class="rf-au-l-s rf-au-l-w rf-au-l-h">
- <cdk:body>
- <cdk:call expression="encodeItemsContainer(facesContext, component)"/>
- </cdk:body>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- new RichFaces.ui.AutoComplete("#{clientId}",
- "#{clientId}Input", #{getScriptOptions(component)}
- );
- </script>
- </div>
- </cc:implementation>
-
-</cdk:root>
Copied: branches/RF-9096/src/main/templates/auto_complete.template.xml (from rev 18730, trunk/ui/input/ui/src/main/templates/autoComplete.template.xml)
===================================================================
--- branches/RF-9096/src/main/templates/auto_complete.template.xml (rev 0)
+++ branches/RF-9096/src/main/templates/auto_complete.template.xml 2010-08-17 19:00:11 UTC (rev 18732)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el" xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:c="http://richfaces.org/cdk/jstl/core" xmlns:cc="http://richfaces.org/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.AutocompleteRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.AutocompleteRendererBase</cdk:superclass>
+ <cdk:component-family>javax.faces.Input</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.AutocompleteRenderer
+ </cdk:renderer-type>
+ <cdk:renders-children>true</cdk:renders-children>
+ </cc:interface>
+
+ <cc:implementation>
+ <cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
+ <div id="#{clientId}" class="rf-au-f-w rf-au-f">
+ <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-ft rf-au-i" />
+ <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
+ <input onclick="#{component.attributes['onclick']}"
+ ondblclick="#{component.attributes['ondblclick']}"
+ onmouseup="#{component.attributes['onmouseup']}"
+ onmousedown="#{component.attributes['onmousedown']}"
+ onmousemove="#{component.attributes['onmousemove']}"
+ onblur="#{component.attributes['onblur']}"
+ onfocus="#{component.attributes['onfocus']}"
+ onmouseover="#{component.attributes['onmouseover']}"
+ onmouseout="#{component.attributes['onmouseout']}"
+ onkeyup="#{component.attributes['onkeyup']}"
+ onkeydown="#{component.attributes['onkeydown']}"
+ onkeypress="#{component.attributes['onkeypress']}" id="#{clientId}Input" disabled="#{disabled}" name="#{clientId}" type="text" class="rf-au-ft rf-au-i" />
+ <c:if test="#{component.attributes['showButton']}">
+ <c:if test="#{component.attributes['disabled']}">
+ <div id="#{clientId}Button" class="rf-au-b">
+ <div class="rf-au-b-a"></div>
+ </div>
+ </c:if>
+ <c:if test="#{!component.attributes['disabled']}">
+ <div id="#{clientId}Button" class="rf-au-b">
+ <div class="rf-au-b-a"></div>
+ </div>
+ </c:if>
+ </c:if>
+ </div>
+
+ <div onclick="#{component.attributes['onlistclick']}"
+ ondblclick="#{component.attributes['onlistdblclick']}"
+ onmouseup="#{component.attributes['onlistmouseup']}"
+ onmousedown="#{component.attributes['onlistmousedown']}"
+ onmousemove="#{component.attributes['onlistmousemove']}"
+ onmouseover="#{component.attributes['onlistmouseover']}"
+ onmouseout="#{component.attributes['onlistmouseout']}"
+ onblur="#{component.attributes['onlistblur']}"
+ onfocus="#{component.attributes['onlistfocus']}"
+ onkeyup="#{component.attributes['onlistkeyup']}"
+ onkeydown="#{component.attributes['onlistkeydown']}"
+ onkeypress="#{component.attributes['onlistkeypress']}"
+ id="#{clientId}List" class="rf-au-l-c">
+
+ <div class="rf-au-shw">
+ <div class="rf-au-shw-t"></div>
+ <div class="rf-au-shw-l"></div>
+ <div class="rf-au-shw-r"></div>
+ <div class="rf-au-shw-b"></div>
+
+ <div class="rf-au-l-d">
+ <div class="rf-au-l-s rf-au-l-w rf-au-l-h">
+ <cdk:body>
+ <cdk:call expression="encodeItemsContainer(facesContext, component)"/>
+ </cdk:body>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+ new RichFaces.ui.Autocomplete("#{clientId}",
+ "#{clientId}Input", #{getScriptOptions(component)}
+ );
+ </script>
+ </div>
+ </cc:implementation>
+
+</cdk:root>
15 years, 9 months
JBoss Rich Faces SVN: r18731 - in trunk: dist and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-17 14:54:59 -0400 (Tue, 17 Aug 2010)
New Revision: 18731
Modified:
trunk/core/parent/pom.xml
trunk/dist/pom.xml
trunk/ui/parent/pom.xml
Log:
Updated relative path for modules to the richfaces-bom
Modified: trunk/core/parent/pom.xml
===================================================================
--- trunk/core/parent/pom.xml 2010-08-17 18:16:23 UTC (rev 18730)
+++ trunk/core/parent/pom.xml 2010-08-17 18:54:59 UTC (rev 18731)
@@ -30,6 +30,7 @@
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../bom/pom.xml</relativePath>
</parent>
<description>
Modified: trunk/dist/pom.xml
===================================================================
--- trunk/dist/pom.xml 2010-08-17 18:16:23 UTC (rev 18730)
+++ trunk/dist/pom.xml 2010-08-17 18:54:59 UTC (rev 18731)
@@ -25,6 +25,7 @@
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../bom/pom.xml</relativePath>
</parent>
<groupId>org.richfaces</groupId>
Modified: trunk/ui/parent/pom.xml
===================================================================
--- trunk/ui/parent/pom.xml 2010-08-17 18:16:23 UTC (rev 18730)
+++ trunk/ui/parent/pom.xml 2010-08-17 18:54:59 UTC (rev 18731)
@@ -28,6 +28,7 @@
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../bom/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui</groupId>
15 years, 9 months
JBoss Rich Faces SVN: r18730 - sandbox/trunk/cdk.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-17 14:16:23 -0400 (Tue, 17 Aug 2010)
New Revision: 18730
Removed:
sandbox/trunk/cdk/maven-resources-plugin/
Log:
Moving maven-resources-plugin into main build
15 years, 9 months
JBoss Rich Faces SVN: r18729 - in trunk/cdk: plugins and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-17 14:15:50 -0400 (Tue, 17 Aug 2010)
New Revision: 18729
Added:
trunk/cdk/plugins/maven-resources-plugin/
Modified:
trunk/cdk/bom/pom.xml
trunk/cdk/plugins/maven-resources-plugin/pom.xml
trunk/cdk/plugins/pom.xml
Log:
Moving maven-resources-plugin into main build
Modified: trunk/cdk/bom/pom.xml
===================================================================
--- trunk/cdk/bom/pom.xml 2010-08-17 17:33:54 UTC (rev 18728)
+++ trunk/cdk/bom/pom.xml 2010-08-17 18:15:50 UTC (rev 18729)
@@ -151,6 +151,37 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections</artifactId>
+ <version>0.9.5-RC2_jboss-SP1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.collections</groupId>
+ <artifactId>google-collections</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.8</version>
+ </dependency>
+ <dependency>
+ <groupId>com.yahoo.platform.yui</groupId>
+ <artifactId>yuicompressor</artifactId>
+ <version>2.3.6</version>
+ </dependency>
<!-- Tests -->
<dependency>
Copied: trunk/cdk/plugins/maven-resources-plugin (from rev 18655, sandbox/trunk/cdk/maven-resources-plugin)
Modified: trunk/cdk/plugins/maven-resources-plugin/pom.xml
===================================================================
--- sandbox/trunk/cdk/maven-resources-plugin/pom.xml 2010-08-16 11:52:42 UTC (rev 18655)
+++ trunk/cdk/plugins/maven-resources-plugin/pom.xml 2010-08-17 18:15:50 UTC (rev 18729)
@@ -3,23 +3,19 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-plugins</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-plugins</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
+ <name>maven-resources-plugin</name>
+ <description>Maven plugin for packaging resources with web application</description>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <repositories>
- </repositories>
-
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -53,56 +49,44 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
- <version>0.9.5-RC2_jboss-SP1</version>
- <exclusions>
- <exclusion>
- <artifactId>google-collections</artifactId>
- <groupId>com.google.collections</groupId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>r06</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
- <version>2.2</version>
</dependency>
<dependency>
<groupId>com.sun.el</groupId>
<artifactId>el-ri</artifactId>
- <version>1.0</version>
</dependency>
+
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>2.0.3-b03</version>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
- <version>4.0.0-SNAPSHOT</version>
</dependency>
-
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
</dependency>
+
<dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
- <version>2.3.6</version>
</dependency>
</dependencies>
Modified: trunk/cdk/plugins/pom.xml
===================================================================
--- trunk/cdk/plugins/pom.xml 2010-08-17 17:33:54 UTC (rev 18728)
+++ trunk/cdk/plugins/pom.xml 2010-08-17 18:15:50 UTC (rev 18729)
@@ -34,6 +34,7 @@
<module>xinclude</module>
<module>generator</module>
<module>maven-cdk-plugin</module>
+ <module>maven-resources-plugin</module>
</modules>
</project>
15 years, 9 months
JBoss Rich Faces SVN: r18728 - trunk.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-08-17 13:33:54 -0400 (Tue, 17 Aug 2010)
New Revision: 18728
Modified:
trunk/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-18521" from
https://svn.jboss.org/repos/richfaces/branches/cdk-8570
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
+ /branches/cdk-8570:1-18521 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
15 years, 9 months
JBoss Rich Faces SVN: r18727 - in trunk/ui: core and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-17 13:27:56 -0400 (Tue, 17 Aug 2010)
New Revision: 18727
Modified:
trunk/ui/common/pom.xml
trunk/ui/core/pom.xml
trunk/ui/input/pom.xml
trunk/ui/iteration/pom.xml
trunk/ui/misc/pom.xml
trunk/ui/output/pom.xml
Log:
Updated richfaces-parent refernces in /ui sub-modules
Modified: trunk/ui/common/pom.xml
===================================================================
--- trunk/ui/common/pom.xml 2010-08-17 17:16:43 UTC (rev 18726)
+++ trunk/ui/common/pom.xml 2010-08-17 17:27:56 UTC (rev 18727)
@@ -23,9 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.common</groupId>
Modified: trunk/ui/core/pom.xml
===================================================================
--- trunk/ui/core/pom.xml 2010-08-17 17:16:43 UTC (rev 18726)
+++ trunk/ui/core/pom.xml 2010-08-17 17:27:56 UTC (rev 18727)
@@ -23,9 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.core</groupId>
Modified: trunk/ui/input/pom.xml
===================================================================
--- trunk/ui/input/pom.xml 2010-08-17 17:16:43 UTC (rev 18726)
+++ trunk/ui/input/pom.xml 2010-08-17 17:27:56 UTC (rev 18727)
@@ -23,9 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.input</groupId>
Modified: trunk/ui/iteration/pom.xml
===================================================================
--- trunk/ui/iteration/pom.xml 2010-08-17 17:16:43 UTC (rev 18726)
+++ trunk/ui/iteration/pom.xml 2010-08-17 17:27:56 UTC (rev 18727)
@@ -23,9 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.iteration</groupId>
Modified: trunk/ui/misc/pom.xml
===================================================================
--- trunk/ui/misc/pom.xml 2010-08-17 17:16:43 UTC (rev 18726)
+++ trunk/ui/misc/pom.xml 2010-08-17 17:27:56 UTC (rev 18727)
@@ -25,9 +25,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.misc</groupId>
Modified: trunk/ui/output/pom.xml
===================================================================
--- trunk/ui/output/pom.xml 2010-08-17 17:16:43 UTC (rev 18726)
+++ trunk/ui/output/pom.xml 2010-08-17 17:27:56 UTC (rev 18727)
@@ -23,9 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.output</groupId>
15 years, 9 months
JBoss Rich Faces SVN: r18726 - modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-08-17 13:16:43 -0400 (Tue, 17 Aug 2010)
New Revision: 18726
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml
Log:
* added mime-mapping for ecss to limit warnings
Modified: modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml 2010-08-17 17:16:37 UTC (rev 18725)
+++ modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml 2010-08-17 17:16:43 UTC (rev 18726)
@@ -37,4 +37,13 @@
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
+ <!--
+ remove as soon as the issue in Mojarra is resolved
+ https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1646
+ https://jira.jboss.org/browse/RF-8984
+ -->
+ <mime-mapping>
+ <extension>ecss</extension>
+ <mime-type>text/css</mime-type>
+ </mime-mapping>
</web-app>
15 years, 9 months
JBoss Rich Faces SVN: r18725 - in branches/cdk-8570: ui/iteration/ui/src/main/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-08-17 13:16:37 -0400 (Tue, 17 Aug 2010)
New Revision: 18725
Modified:
branches/cdk-8570/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java
Log:
build passed after merging
Modified: branches/cdk-8570/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
===================================================================
--- branches/cdk-8570/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-08-17 17:08:54 UTC (rev 18724)
+++ branches/cdk-8570/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-08-17 17:16:37 UTC (rev 18725)
@@ -275,6 +275,15 @@
taglib.setShortName(shortName);
// log.error("No short defined for taglib");
}
+ // Verify tags. If we have renderer-specific component, it should have a tag ?
+ for (ComponentModel component : library.getComponents()) {
+ if(null != component.getRendererType() && component.getTags().isEmpty()){
+ TagModel tag = new TagModel();
+ verifyTag(tag, component.getId(), DEFAULT_COMPONENT_HANDLER);
+ component.getTags().add(tag);
+ }
+ }
+
}
/**
Modified: branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java
===================================================================
--- branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java 2010-08-17 17:08:54 UTC (rev 18724)
+++ branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java 2010-08-17 17:16:37 UTC (rev 18725)
@@ -30,6 +30,7 @@
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
@@ -40,7 +41,7 @@
* JSF component class
*
*/
-@JsfComponent(type = "org.richfaces.List", family = "org.richfaces.List", facets = @Facet(name = AbstractList.TERM),
+@JsfComponent(type = "org.richfaces.List", family = "org.richfaces.List", facets = @Facet(name = AbstractList.TERM),tag=@Tag(name="list"),
renderer = @JsfRenderer(type = "org.richfaces.ListRenderer"))
public abstract class AbstractList extends UISequence {
15 years, 9 months
JBoss Rich Faces SVN: r18724 - in trunk/ui/iteration/ui/src/main: java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-08-17 13:08:54 -0400 (Tue, 17 Aug 2010)
New Revision: 18724
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable-toggler.js
Log:
fix event names, fix subtable toggler script
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-08-17 16:51:49 UTC (rev 18723)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java 2010-08-17 17:08:54 UTC (rev 18724)
@@ -78,10 +78,10 @@
public abstract int getFrozenColumns();
@Attribute(events=@EventName(value="selectionchange", defaultEvent=true))
- public abstract String getOnselectionchange();
+ public abstract String getSelectionchange();
@Attribute(events=@EventName("beforeselectionchange"))
- public abstract String getOnbeforeselectionchange();
+ public abstract String getBeforeselectionchange();
public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
if (SCROLL.equals(metaComponentId)) {
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java 2010-08-17 16:51:49 UTC (rev 18723)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java 2010-08-17 17:08:54 UTC (rev 18724)
@@ -48,15 +48,16 @@
@ResourceDependencies(
{@ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "richfaces.js"),
- @ResourceDependency(name = "subtable-toggler.js")
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(library="org.richfaces", name = "subtable-toggler.js")
})
public class SubTableToggleControlRendererBase extends RendererBase {
private static final String DISPLAY_NONE = "display: none;";
- private static final String UP_ICON_URL = "org.richfaces:up_icon.gif";
+ private static final String UP_ICON_URL = "org.richfaces/up_icon.gif";
- private static final String DOWN_ICON_URL = "org.richfaces:down_icon.gif";
+ private static final String DOWN_ICON_URL = "org.richfaces/down_icon.gif";
private static final String EXPAND_STATE = "expand";
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable-toggler.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable-toggler.js 2010-08-17 16:51:49 UTC (rev 18723)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable-toggler.js 2010-08-17 17:08:54 UTC (rev 18724)
@@ -8,8 +8,11 @@
this.expandControl = options.expandControl;
this.collapseControl = options.collapseControl;
this.forId = options.forId;
+ this.element = $(document.getElementById(this.id));
- richfaces.Event.bindById(this.id, this.eventName, this.toggle, this);
+ if(this.element && this.eventName) {
+ this.element.bind(this.eventName, $.proxy(this.toggle, this));
+ }
};
$.extend(richfaces.ui.SubTableToggler.prototype, (function () {
15 years, 9 months
JBoss Rich Faces SVN: r18723 - in branches/cdk-8570: ui/iteration/ui/src/main/java/org/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-08-17 12:51:49 -0400 (Tue, 17 Aug 2010)
New Revision: 18723
Added:
branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTableToggleControl.java
Removed:
branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstarctSubTableToggleControl.java
Modified:
branches/cdk-8570/
branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/DataScrollerUtils.java
branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java
Log:
Merged revisions 18722 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r18722 | abelevich | 2010-08-17 09:26:26 -0700 (Tue, 17 Aug 2010) | 1 line
https://jira.jboss.org/browse/RF-8920, https://jira.jboss.org/browse/RF-9093
.......
Property changes on: branches/cdk-8570
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-18715
+ /trunk:1-18722
Modified: branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/DataScrollerUtils.java
===================================================================
--- branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/DataScrollerUtils.java 2010-08-17 16:26:26 UTC (rev 18722)
+++ branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/DataScrollerUtils.java 2010-08-17 16:51:49 UTC (rev 18723)
@@ -26,13 +26,17 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
-import java.util.Map.Entry;
+import javax.faces.FacesException;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
+import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.AbstractDataScroller;
+import org.richfaces.component.UIDataAdaptor;
public final class DataScrollerUtils {
@@ -87,7 +91,35 @@
}
return parent;
}
+
+ public static UIComponent findDataTable(AbstractDataScroller dataScroller) {
+ String forAttribute = dataScroller.getForComponent();
+ UIComponent forComp;
+ if (forAttribute == null) {
+ forComp = dataScroller;
+ while ((forComp = forComp.getParent()) != null) {
+ if (forComp instanceof UIData || forComp instanceof UIDataAdaptor) {
+ return forComp;
+ }
+ }
+
+ throw new FacesException("could not find dataTable for datascroller " + dataScroller.getId());
+
+ } else {
+ forComp = RendererUtils.getInstance().findComponentFor(dataScroller, forAttribute);
+ }
+
+ if (forComp == null) {
+ throw new IllegalArgumentException("could not find dataTable with id '" + forAttribute + "'");
+ } else if (!((forComp instanceof UIData) || (forComp instanceof UIDataAdaptor))) {
+ throw new IllegalArgumentException("component with id '" + forAttribute + "' must be of type "
+ + UIData.class.getName() + " or " + UIDataAdaptor.class + ", not type " + forComp.getClass().getName());
+ }
+
+ return forComp;
+ }
+
public static List<AbstractDataScroller> findDataScrollers(UIComponent dataTable) {
List<AbstractDataScroller> datascrollers = new ArrayList<AbstractDataScroller>();
Map<String, UIComponent> facets = dataTable.getFacets();
Deleted: branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstarctSubTableToggleControl.java
===================================================================
--- branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstarctSubTableToggleControl.java 2010-08-17 16:26:26 UTC (rev 18722)
+++ branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstarctSubTableToggleControl.java 2010-08-17 16:51:49 UTC (rev 18723)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.component;
-
-import javax.faces.component.UIComponentBase;
-
-import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.Tag;
-
-/**
- * @author Anton Belevich
- *
- */
-
-@JsfComponent(
- type = AbstarctSubTableToggleControl.COMPONENT_TYPE,
- family = AbstarctSubTableToggleControl.COMPONENT_FAMILY,
- generate = "org.richfaces.component.UISubTableToggleControl",
- renderer = @JsfRenderer(type = "org.richfaces.SubTableRenderer"),
- tag = @Tag( name = "subTableToggleControl")
- )
-public abstract class AbstarctSubTableToggleControl extends UIComponentBase {
-
- public static final String COMPONENT_TYPE = "org.richfaces.SubTableToggleControl";
-
- public static final String COMPONENT_FAMILY = "org.richfaces.SubTableToggleControl";
-
- public static final String DEFAULT_EVENT = "onclick";
-
- enum PropertyKeys {
- forId
- }
-
- @Attribute
- public abstract String getExpandLabel();
-
- @Attribute
- public abstract String getCollapseLabel();
-
- @Attribute
- public abstract String getExpandIcon();
-
- @Attribute
- public abstract String getCollapseIcon();
-
- @Attribute(defaultValue = DEFAULT_EVENT)
- public abstract String getEvent();
-
- public String getFor() {
- return (String)getStateHelper().eval(PropertyKeys.forId);
- }
-
- public void setFor(String forId) {
- getStateHelper().put(PropertyKeys.forId, forId);
- }
-}
Modified: branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
===================================================================
--- branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2010-08-17 16:26:26 UTC (rev 18722)
+++ branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2010-08-17 16:51:49 UTC (rev 18723)
@@ -31,14 +31,12 @@
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
-import javax.faces.component.UIData;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import org.ajax4jsf.component.IterationStateHolder;
-import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.DataScrollerUtils;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
@@ -162,33 +160,7 @@
*/
public UIComponent getDataTable() {
- String forAttribute = (String) getAttributes().get(PropertyKeys.forComponent.toString());
- UIComponent forComp;
-
- if (forAttribute == null) {
- forComp = this;
-
- while ((forComp = forComp.getParent()) != null) {
- if (forComp instanceof UIData || forComp instanceof UIDataAdaptor) {
- getStateHelper().put(PropertyKeys.forComponent, forComp.getId());
- return forComp;
- }
- }
- throw new FacesException("could not find dataTable for datascroller " + this.getId());
-
- } else {
- forComp = RendererUtils.getInstance().findComponentFor(this, forAttribute);
- }
-
- if (forComp == null) {
- throw new IllegalArgumentException("could not find dataTable with id '" + forAttribute + "'");
- } else if (!((forComp instanceof UIData) || (forComp instanceof UIDataAdaptor))) {
-
- throw new IllegalArgumentException("component with id '" + forAttribute + "' must be of type "
- + UIData.class.getName() + " or " + UIDataAdaptor.class + ", not type " + forComp.getClass().getName());
- }
-
- return forComp;
+ return DataScrollerUtils.findDataTable(this);
}
private int getFastStepOrDefault() {
Copied: branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTableToggleControl.java (from rev 18722, trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTableToggleControl.java)
===================================================================
--- branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTableToggleControl.java (rev 0)
+++ branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTableToggleControl.java 2010-08-17 16:51:49 UTC (rev 18723)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+
+@JsfComponent(
+ type = AbstractSubTableToggleControl.COMPONENT_TYPE,
+ family = AbstractSubTableToggleControl.COMPONENT_FAMILY,
+ generate = "org.richfaces.component.UISubTableToggleControl",
+ renderer = @JsfRenderer(type = "org.richfaces.SubTableToggleControlRenderer"),
+ tag = @Tag( name = "subTableToggleControl")
+ )
+public abstract class AbstractSubTableToggleControl extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.SubTableToggleControl";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.SubTableToggleControl";
+
+ public static final String DEFAULT_EVENT = "onclick";
+
+ enum PropertyKeys {
+ forId
+ }
+
+ @Attribute
+ public abstract String getExpandLabel();
+
+ @Attribute
+ public abstract String getCollapseLabel();
+
+ @Attribute
+ public abstract String getExpandIcon();
+
+ @Attribute
+ public abstract String getCollapseIcon();
+
+ @Attribute(defaultValue = DEFAULT_EVENT)
+ public abstract String getEvent();
+
+ public String getFor() {
+ return (String)getStateHelper().eval(PropertyKeys.forId);
+ }
+
+ public void setFor(String forId) {
+ getStateHelper().put(PropertyKeys.forId, forId);
+ }
+}
Modified: branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
===================================================================
--- branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2010-08-17 16:26:26 UTC (rev 18722)
+++ branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2010-08-17 16:51:49 UTC (rev 18723)
@@ -49,7 +49,7 @@
private static final Logger LOG = RichfacesLogger.COMPONENTS.getLogger();
public boolean isListenerForSource(Object source) {
- return ((source instanceof UIDataAdaptor) || (source instanceof UIData));
+ return ((source instanceof AbstractDataScroller) ||(source instanceof UIDataAdaptor) || (source instanceof UIData));
}
public AbstractDataScroller processActiveDatascroller(FacesContext facesContext, List<AbstractDataScroller> dataScrollers,
@@ -103,61 +103,70 @@
}
public void processEvent(SystemEvent event) throws AbortProcessingException {
- UIComponent dataTable = (UIComponent) event.getSource();
- List<AbstractDataScroller> dataScrollers = DataScrollerUtils.findDataScrollers(dataTable);
+ AbstractDataScroller activeDataScroller = null;
+ UIComponent dataTable = null;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ UIComponent source = (UIComponent) event.getSource();
- if (!dataScrollers.isEmpty()) {
+ if ((source instanceof UIDataAdaptor) || (source instanceof UIData)) {
+ dataTable = source;
+ List<AbstractDataScroller> dataScrollers = DataScrollerUtils.findDataScrollers(dataTable);
+ if(!dataScrollers.isEmpty()) {
+ activeDataScroller = processActiveDatascroller(facesContext, dataScrollers, dataTable);
+ }
- FacesContext facesContext = FacesContext.getCurrentInstance();
+ } else if (source instanceof AbstractDataScroller) {
+ activeDataScroller = (AbstractDataScroller) source;
+ dataTable = activeDataScroller.getDataTable();
+ }
+
+ String scrollerStateKey = dataTable.getClientId(facesContext) + AbstractDataScroller.SCROLLER_STATE_ATTRIBUTE;
+ boolean processed = dataTable.getAttributes().containsKey(scrollerStateKey);
+ if(!processed) {
+ if ((activeDataScroller != null) && (dataTable != null)) {
+ int rowCount = DataScrollerUtils.getRowCount(dataTable);
+ int rows = DataScrollerUtils.getRows(dataTable);
+ int pageCount = DataScrollerUtils.getPageCount(dataTable, rowCount, rows);
+
+ int page = activeDataScroller.getPage();
+ int newPage = -1;
- AbstractDataScroller activeComponent = processActiveDatascroller(facesContext, dataScrollers, dataTable);
+ if (page < 1) {
+ newPage = 1;
+ } else if (page > pageCount) {
+ newPage = (pageCount != 0 ? pageCount : 1);
+ }
- int rowCount = DataScrollerUtils.getRowCount(dataTable);
- int rows = DataScrollerUtils.getRows(dataTable);
+ if (newPage != -1) {
+ Object label = MessageUtil.getLabel(facesContext, activeDataScroller);
+ String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING, new Object[] { label,
+ page, pageCount, newPage });
- Integer pageCount = DataScrollerUtils.getPageCount(dataTable, rowCount, rows);
+ LOG.warn(formattedMessage);
+ page = newPage;
+ dataTable.getAttributes().put(scrollerStateKey, page);
+ }
- int page = activeComponent.getPage();
- int newPage = -1;
+ int first;
+ String lastPageMode = activeDataScroller.getLastPageMode();
- if (page < 1) {
- newPage = 1;
- } else if (page > pageCount) {
- newPage = (pageCount != 0 ? pageCount : 1);
- }
+ if (lastPageMode == null) {
+ lastPageMode = AbstractDataScroller.PAGEMODE_SHORT;
+ } else if (!AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)
+ && !AbstractDataScroller.PAGEMODE_FULL.equals(lastPageMode)) {
+ throw new IllegalArgumentException("Illegal value of 'lastPageMode' attribute: '" + lastPageMode + "'");
+ }
- if (newPage != -1) {
- Object label = MessageUtil.getLabel(facesContext, activeComponent);
- String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING, new Object[] { label,
- page, pageCount, newPage });
-
- LOG.warn(formattedMessage);
-
- page = newPage;
- dataTable.getAttributes().put(
- dataTable.getClientId(facesContext) + AbstractDataScroller.SCROLLER_STATE_ATTRIBUTE, page);
- }
-
- int first;
-
- String lastPageMode = activeComponent.getLastPageMode();
-
- if (lastPageMode == null) {
- lastPageMode = AbstractDataScroller.PAGEMODE_SHORT;
- } else if (!AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)
- && !AbstractDataScroller.PAGEMODE_FULL.equals(lastPageMode)) {
- throw new IllegalArgumentException("Illegal value of 'lastPageMode' attribute: '" + lastPageMode + "'");
- }
-
- if (page != pageCount || AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)) {
- first = (page - 1) * rows;
- } else {
- first = rowCount - rows;
- if (first < 0) {
- first = 0;
+ if (page != pageCount || AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)) {
+ first = (page - 1) * rows;
+ } else {
+ first = rowCount - rows;
+ if (first < 0) {
+ first = 0;
+ }
}
+ dataTable.getAttributes().put("first", first);
}
- dataTable.getAttributes().put("first", first);
}
}
Modified: branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java
===================================================================
--- branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java 2010-08-17 16:26:26 UTC (rev 18722)
+++ branches/cdk-8570/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java 2010-08-17 16:51:49 UTC (rev 18723)
@@ -35,14 +35,16 @@
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.RendererBase;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.component.AbstractSubTable;
-import org.richfaces.component.AbstarctSubTableToggleControl;
+import org.richfaces.component.AbstractSubTableToggleControl;
/**
* @author Anton Belevich
*/
+@JsfRenderer(type = "org.richfaces.SubTableToggleControlRenderer", family = AbstractSubTableToggleControl.COMPONENT_FAMILY)
@ResourceDependencies(
{@ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "richfaces.js"),
@@ -66,7 +68,7 @@
}
protected void encodeControl(FacesContext context, UIComponent component) throws IOException {
- AbstarctSubTableToggleControl toggleControl = (AbstarctSubTableToggleControl) component;
+ AbstractSubTableToggleControl toggleControl = (AbstractSubTableToggleControl) component;
AbstractSubTable subTable = findComponent(context, toggleControl);
if (subTable != null) {
@@ -89,7 +91,7 @@
}
}
- protected void encodeControl(FacesContext context, ResponseWriter writer, AbstarctSubTableToggleControl control,
+ protected void encodeControl(FacesContext context, ResponseWriter writer, AbstractSubTableToggleControl control,
String switchType, boolean expanded, boolean visible) throws IOException {
String state = getState(expanded);
String styleClass = getStyleClass(context, control);
@@ -160,7 +162,7 @@
writer.endElement(HTML.SPAN_ELEM);
}
- public HashMap<String, Object> encodeOptions(FacesContext context, AbstarctSubTableToggleControl toggleControl, AbstractSubTable subTable) {
+ public HashMap<String, Object> encodeOptions(FacesContext context, AbstractSubTableToggleControl toggleControl, AbstractSubTable subTable) {
String forId = subTable.getClientId(context);
String toggleControlId = toggleControl.getClientId(context);
@@ -175,15 +177,15 @@
return options;
}
- public String getStyleClass(FacesContext context, AbstarctSubTableToggleControl control) {
+ public String getStyleClass(FacesContext context, AbstractSubTableToggleControl control) {
return null;
}
- public String getStyle(FacesContext context, AbstarctSubTableToggleControl control) {
+ public String getStyle(FacesContext context, AbstractSubTableToggleControl control) {
return null;
}
- protected AbstractSubTable findComponent(FacesContext context, AbstarctSubTableToggleControl toggleControl) {
+ protected AbstractSubTable findComponent(FacesContext context, AbstractSubTableToggleControl toggleControl) {
String forId = toggleControl.getFor();
if (forId != null && forId.length() > 0) {
15 years, 9 months