Author: abelevich
Date: 2010-10-11 10:13:05 -0400 (Mon, 11 Oct 2010)
New Revision: 19519
Modified:
trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
add license headers, add events for the inplaceSelect component
Modified: trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
===================================================================
---
trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-10-11
13:16:22 UTC (rev 19518)
+++
trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-10-11
14:13:05 UTC (rev 19519)
@@ -1,6 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
package org.richfaces.component;
+/**
+ * @author Anton Belevich
+ *
+ */
public interface InplaceComponent {
public String getDefaultLabel();
Modified: trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-10-11
13:16:22 UTC (rev 19518)
+++ trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-10-11
14:13:05 UTC (rev 19519)
@@ -19,8 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
+
package org.richfaces.component;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+
public enum InplaceState {
ready,
edit,
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-10-11
13:16:22 UTC (rev 19518)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-11
14:13:05 UTC (rev 19519)
@@ -1,3 +1,25 @@
+/*
+ * 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;
@@ -3,4 +25,5 @@
import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
@@ -46,4 +69,47 @@
@Attribute(defaultValue="click")
public abstract String getEditEvent();
+
+ @Attribute(events=@EventName("blur"))
+ public abstract String getOnblur();
+
+ @Attribute(events=@EventName("click"))
+ public abstract String getOnclick();
+
+ @Attribute(events=@EventName("ondblclick"))
+ 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 getOnkeypup();
+
+ @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("select"))
+ public abstract String getOnselect();
+
+ @Attribute(events=@EventName("change"))
+ public abstract String getOnchange();
+
}
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-11
13:16:22 UTC (rev 19518)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-11
14:13:05 UTC (rev 19519)
@@ -1,3 +1,25 @@
+/*
+ * 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;
@@ -2,2 +24,3 @@
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
@@ -95,7 +118,16 @@
+ "}";
}
}
+
+ private static final Map<String, ComponentAttribute>
INPLACESELECT_HANDLER_ATTRIBUTES = Collections
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new
ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE).setEventNames("change").
+ setComponentAttributeName("onchange"),
+ new
ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE).setEventNames("select").
+ setComponentAttributeName("onselect")
+ ));
+
@Override
protected String getScriptName() {
return "new RichFaces.ui.InplaceSelect";
@@ -116,8 +148,13 @@
}
return clientSelectItems;
}
-
+
@Override
+ protected void renderInputHandlers(FacesContext facesContext, UIComponent component)
throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component,
INPLACESELECT_HANDLER_ATTRIBUTES);
+ }
+
+ @Override
public void addToOptions(FacesContext facesContext, UIComponent component,
Map<String, Object> options, Object additional) {
options.put(OPTIONS_ITEM_CLASS, "rf-is-opt");