Author: abelevich
Date: 2010-12-02 06:59:05 -0500 (Thu, 02 Dec 2010)
New Revision: 20300
Added:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss
Log:
RF-9854, RF-9843
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-12-02
11:57:35 UTC (rev 20299)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-12-02
11:59:05 UTC (rev 20300)
@@ -41,7 +41,7 @@
renderer = @JsfRenderer(type = "org.richfaces.InplaceSelectRenderer"),
tag = @Tag(name="inplaceSelect")
)
-public abstract class AbstractInplaceSelect extends AbstractSelect implements
InplaceComponent {
+public abstract class AbstractInplaceSelect extends AbstractSelectComponent implements
InplaceComponent {
public static final String COMPONENT_TYPE = "org.richfaces.InplaceSelect";
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2010-12-02
11:57:35 UTC (rev 20299)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2010-12-02
11:59:05 UTC (rev 20300)
@@ -1,31 +1,6 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
package org.richfaces.component;
-import javax.faces.component.UISelectOne;
-
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.Tag;
@@ -35,115 +10,27 @@
*
*/
@JsfComponent(
- type = AbstractSelect.COMPONENT_TYPE,
- family = AbstractSelect.COMPONENT_FAMILY,
+ type = AbstractSelectComponent.COMPONENT_TYPE,
+ family = AbstractSelectComponent.COMPONENT_FAMILY,
generate = "org.richfaces.component.UISelect",
renderer = @JsfRenderer(type = "org.richfaces.SelectRenderer"),
tag = @Tag(name="select")
)
-public abstract class AbstractSelect extends UISelectOne {
-
+
+public abstract class AbstractSelect extends AbstractSelectComponent {
+
public static final String COMPONENT_TYPE = "org.richfaces.Select";
public static final String COMPONENT_FAMILY = "org.richfaces.Select";
+
- @Attribute(defaultValue="250px")
- public abstract String getListWidth();
-
- @Attribute(defaultValue="100px")
- public abstract String getListHeight();
-
- @Attribute(defaultValue="true")
- public abstract boolean isShowButton();
-
@Attribute(defaultValue="false")
public abstract boolean isEnableManualInput();
-
+
@Attribute(defaultValue="true")
public abstract boolean isSelectFirst();
- @Attribute
- public abstract String getDefaultLabel();
-
- @Attribute
- public abstract String getItemClass();
-
- @Attribute
- public abstract String getSelectItemClass();
-
- @Attribute
- public abstract String getListClass();
+ @Attribute(defaultValue="true")
+ public abstract boolean isShowButton();
- @Attribute(events=@EventName("blur"))
- public abstract String getOnblur();
-
- @Attribute(events=@EventName("click"))
- public abstract String getOnclick();
-
- @Attribute(events=@EventName("dblclick"))
- public abstract String getOndblclick();
-
- @Attribute(events=@EventName("focus"))
- public abstract String getOnfocus();
-
- @Attribute(events=@EventName("keydown"))
- public abstract String getOnkeydown();
-
- @Attribute(events=@EventName("keypress"))
- public abstract String getOnkeypress();
-
- @Attribute(events=@EventName("keyup"))
- public abstract String getOnkeyup();
-
- @Attribute(events=@EventName("mousedown"))
- public abstract String getOnmousedown();
-
- @Attribute(events=@EventName("mousemove"))
- public abstract String getOnmousemove();
-
- @Attribute(events=@EventName("mouseout"))
- public abstract String getOnmouseout();
-
- @Attribute(events=@EventName("mouseover"))
- public abstract String getOnmouseover();
-
- @Attribute(events=@EventName("mouseup"))
- public abstract String getOnmouseup();
-
- @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("select"))
- public abstract String getOnselect();
-
- @Attribute(events=@EventName("change"))
- public abstract String getOnchange();
-
}
Added:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
(rev 0)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2010-12-02
11:59:05 UTC (rev 20300)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UISelectOne;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+
+/**
+ * @author abelevich
+ *
+ */
+
+public abstract class AbstractSelectComponent extends UISelectOne {
+
+ @Attribute(defaultValue="250px")
+ public abstract String getListWidth();
+
+ @Attribute(defaultValue="100px")
+ public abstract String getListHeight();
+
+ @Attribute
+ public abstract String getDefaultLabel();
+
+ @Attribute
+ public abstract String getItemClass();
+
+ @Attribute
+ public abstract String getSelectItemClass();
+
+ @Attribute
+ public abstract String getListClass();
+
+ @Attribute(events=@EventName("blur"))
+ public abstract String getOnblur();
+
+ @Attribute(events=@EventName("click"))
+ public abstract String getOnclick();
+
+ @Attribute(events=@EventName("dblclick"))
+ public abstract String getOndblclick();
+
+ @Attribute(events=@EventName("focus"))
+ public abstract String getOnfocus();
+
+ @Attribute(events=@EventName("keydown"))
+ public abstract String getOnkeydown();
+
+ @Attribute(events=@EventName("keypress"))
+ public abstract String getOnkeypress();
+
+ @Attribute(events=@EventName("keyup"))
+ public abstract String getOnkeyup();
+
+ @Attribute(events=@EventName("mousedown"))
+ public abstract String getOnmousedown();
+
+ @Attribute(events=@EventName("mousemove"))
+ public abstract String getOnmousemove();
+
+ @Attribute(events=@EventName("mouseout"))
+ public abstract String getOnmouseout();
+
+ @Attribute(events=@EventName("mouseover"))
+ public abstract String getOnmouseover();
+
+ @Attribute(events=@EventName("mouseup"))
+ public abstract String getOnmouseup();
+
+ @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("select"))
+ public abstract String getOnselect();
+
+ @Attribute(events=@EventName("change"))
+ public abstract String getOnchange();
+
+}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java 2010-12-02
11:57:35 UTC (rev 20299)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java 2010-12-02
11:59:05 UTC (rev 20300)
@@ -33,7 +33,7 @@
import javax.faces.context.ResponseWriter;
import javax.faces.model.SelectItem;
-import org.richfaces.component.AbstractSelect;
+import org.richfaces.component.AbstractSelectComponent;
import org.richfaces.component.util.HtmlUtil;
import org.richfaces.component.util.InputUtils;
import org.richfaces.component.util.SelectUtils;
@@ -92,7 +92,7 @@
}
public static List<ClientSelectItem> getConvertedSelectItems(FacesContext
facesContext, UIComponent component) {
- AbstractSelect select = (AbstractSelect) component;
+ AbstractSelectComponent select = (AbstractSelectComponent) component;
List<SelectItem> selectItems = SelectUtils.getSelectItems(facesContext,
select);
List<ClientSelectItem> clientSelectItems = new
ArrayList<ClientSelectItem>();
@@ -106,7 +106,7 @@
public static void encodeItems(FacesContext facesContext, UIComponent component,
List<ClientSelectItem> clientSelectItems, String itemHtmlElement,
String defaultItemCss) throws IOException {
- AbstractSelect select = (AbstractSelect) component;
+ AbstractSelectComponent select = (AbstractSelectComponent) component;
if (clientSelectItems != null && !clientSelectItems.isEmpty()) {
ResponseWriter writer = facesContext.getResponseWriter();
String clientId = component.getClientId(facesContext);
@@ -133,7 +133,7 @@
}
public static String getSelectInputLabel(FacesContext facesContext, UIComponent
component) {
- AbstractSelect select = (AbstractSelect) component;
+ AbstractSelectComponent select = (AbstractSelectComponent) component;
Object value = select.getSubmittedValue();
String label = null;
if (value == null) {
@@ -152,7 +152,7 @@
return label;
}
- public static void addSelectCssToOptions(AbstractSelect abstractSelect,
Map<String, Object> options, String [] defaultCss) {
+ public static void addSelectCssToOptions(AbstractSelectComponent abstractSelect,
Map<String, Object> options, String [] defaultCss) {
String itemCss = abstractSelect.getItemClass();
if(itemCss != null && itemCss.trim().length() > 0) {
options.put(PopupConstants.OPTIONS_ITEM_CLASS,
HtmlUtil.concatClasses(defaultCss[0], itemCss));
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2010-12-02
11:57:35 UTC (rev 20299)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2010-12-02
11:59:05 UTC (rev 20300)
@@ -30,7 +30,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.component.AbstractSelect;
+import org.richfaces.component.AbstractSelectComponent;
/**
* @author abelevich
@@ -63,7 +63,7 @@
}
public String getSelectLabel(FacesContext facesContext, UIComponent component) {
- AbstractSelect select = (AbstractSelect) component;
+ AbstractSelectComponent select = (AbstractSelectComponent) component;
String label = getSelectInputLabel(facesContext, select);
if (label == null || "".equals(label.trim())) {
label = select.getDefaultLabel();
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-12-02
11:57:35 UTC (rev 20299)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-12-02
11:59:05 UTC (rev 20300)
@@ -112,7 +112,7 @@
position : absolute;
bottom : 0px;
right : 0px;
- wigth : 1px;
+ width : 1px;
height : 1px;
}
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss 2010-12-02
11:57:35 UTC (rev 20299)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss 2010-12-02
11:59:05 UTC (rev 20300)
@@ -158,7 +158,7 @@
position : absolute;
top : -4px;
right : 0px;
- wigth : 1px;
+ width : 1px;
height : 1px;
}