Author: ayanul
Date: 2008-06-26 11:16:42 -0400 (Thu, 26 Jun 2008)
New Revision: 9251
Added:
trunk/test-applications/facelets/src/main/java/hotKey/
trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java
trunk/test-applications/facelets/src/main/webapp/HotKey/
trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-HotKey.xml
Modified:
trunk/test-applications/facelets/src/main/java/rich/RichBean.java
trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
Log:
add hotKey
Added: trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java
(rev 0)
+++ trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java 2008-06-26 15:16:42
UTC (rev 9251)
@@ -0,0 +1,146 @@
+/**
+ *
+ */
+package hotKey;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.html.HtmlHotKey;
+
+/**
+ * @author AYanul
+ *
+ */
+public class HotKey {
+ private HtmlHotKey binding = null;
+ private String bindingInfo = "";
+ private String handler = "alert('work')";
+ private String key = "alt+a";
+ private String selector = "";
+ private String timing = "onload";
+ private String type = "onkeydown";
+ private boolean rendered = true;
+ private boolean disableInInput = false;
+ private boolean checkParent = false;
+
+ /**
+ * @return the binding
+ */
+ public HtmlHotKey getBinding() {
+ return binding;
+ }
+ /**
+ * @param binding the binding to set
+ */
+ public void setBinding(HtmlHotKey binding) {
+ this.binding = binding;
+ }
+ /**
+ * @return the handler
+ */
+ public String getHandler() {
+ return handler;
+ }
+ /**
+ * @param handler the handler to set
+ */
+ public void setHandler(String handler) {
+ this.handler = handler;
+ }
+ /**
+ * @return the key
+ */
+ public String getKey() {
+ return key;
+ }
+ /**
+ * @param key the key to set
+ */
+ public void setKey(String key) {
+ this.key = key;
+ }
+ /**
+ * @return the selector
+ */
+ public String getSelector() {
+ return selector;
+ }
+ /**
+ * @param selector the selector to set
+ */
+ public void setSelector(String selector) {
+ this.selector = selector;
+ }
+ /**
+ * @return the timing
+ */
+ public String getTiming() {
+ return timing;
+ }
+ /**
+ * @param timing the timing to set
+ */
+ public void setTiming(String timing) {
+ this.timing = timing;
+ }
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+ /**
+ * @param type the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+ /**
+ * @return the rendered
+ */
+ public boolean isRendered() {
+ return rendered;
+ }
+ /**
+ * @param rendered the rendered to set
+ */
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+ /**
+ * @return the disableInInput
+ */
+ public boolean isDisableInInput() {
+ return disableInInput;
+ }
+ /**
+ * @param disableInInput the disableInInput to set
+ */
+ public void setDisableInInput(boolean disableInInput) {
+ this.disableInInput = disableInInput;
+ }
+ /**
+ * @return the checkParent
+ */
+ public boolean isCheckParent() {
+ return checkParent;
+ }
+ /**
+ * @param checkParent the checkParent to set
+ */
+ public void setCheckParent(boolean checkParent) {
+ this.checkParent = checkParent;
+ }
+ /**
+ * @return the bindingInfo
+ */
+ public String getBindingInfo() {
+ String b = binding.getClientId(FacesContext.getCurrentInstance());
+ if(b != null && b.length() != 0)
+ return "work";
+ return "don't work";
+ }
+}
Modified: trunk/test-applications/facelets/src/main/java/rich/RichBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2008-06-26 15:16:06
UTC (rev 9250)
+++ trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2008-06-26 15:16:42
UTC (rev 9251)
@@ -70,6 +70,7 @@
map.add("InplaceSelect", add("/InplaceSelect/InplaceSelect", new
boolean [] {false, true, false}));
map.add("InplaceInput", add("/InplaceInput/InplaceInput", new
boolean [] {false, true, false}));
map.add("Skinning", add("/Skinning/Skinning", new boolean []
{false, false, false}));
+ map.add("HotKey", add("/HotKey/HotKey", new boolean [] {false,
false, false}));
Iterator<String> iterator = map.getSet().iterator();
while(iterator.hasNext()){
list.add(new SelectItem(iterator.next()));
Added: trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml
(rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml 2008-06-26
15:16:42 UTC (rev 9251)
@@ -0,0 +1,85 @@
+
+<f:subview
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich" id="hotKeySubviewID">
+ <rich:calendar id="hotKeyCalendarID" popup="false"/>
+ <h:commandButton id="commandButtonID" onclick="return false;"
value="test select"></h:commandButton>
+ <rich:hotKey id="hotKeyID" binding="#{hotKey.binding}"
+ disableInInput="#{hotKey.disableInInput}"
handler="#{hotKey.handler}" key="#{hotKey.key}"
+ rendered="#{hotKey.rendered}" selector="#{hotKey.selector}"
timing="#{hotKey.timing}"/>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="type"></h:outputText>
+ <h:selectOneMenu value="#{hotKey.type}">
+ <f:selectItem itemLabel="onkeydown"
itemValue="onkeydown"/>
+ <f:selectItem itemLabel="onkeypress"
itemValue="onkeypress"/>
+ <f:selectItem itemLabel="onkeyup" itemValue="onkeyup"/>
+ <a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
+ </h:selectOneMenu>
+
+ <h:outputText value="key"></h:outputText>
+ <h:inputText value="#{hotKey.key}" onchange="submit();">
+ </h:inputText>
+
+ <h:outputText value="timing"></h:outputText>
+ <h:selectOneMenu value="#{hotKey.timing}"
onchange="submit();">
+ <f:selectItem itemLabel="onload" itemValue="onload"/>
+ <f:selectItem itemLabel="immediate" itemValue="immediate"/>
+ </h:selectOneMenu>
+
+ <h:outputText value="selector"></h:outputText>
+ <h:selectOneMenu value="#{hotKey.selector}">
+ <f:selectItem itemLabel="" itemValue=""/>
+ <f:selectItem itemLabel="Button"
itemValue="#commandButtonID"/>
+ <a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
+ </h:selectOneMenu>
+
+
+ <h:outputText value="handler"></h:outputText>
+ <h:selectOneMenu value="#{hotKey.handler}"
onchange="submit();">
+ <f:selectItem
itemValue="$('formID:hotKeySubviewID:hotKeyCalendarID').component.nextYear();"
itemLabel="nextYear(Calendar)"/>
+ <f:selectItem itemValue="alert('work')"
itemLabel="alert('work')"/>
+ </h:selectOneMenu>
+
+ <h:outputText value="disableInInput"></h:outputText>
+ <h:selectBooleanCheckbox value="#{hotKey.disableInInput}">
+ <a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="checkParent"></h:outputText>
+ <h:selectBooleanCheckbox value="#{hotKey.checkParent}">
+ <a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="rendered"></h:outputText>
+ <h:selectBooleanCheckbox value="#{hotKey.rendered}">
+ <a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="test binding:"></h:outputText>
+ <h:outputText value="#{hotKey.bindingInfo}"></h:outputText>
+
+ <h:commandButton onclick="#{rich:component('hotKeyID')}.enable();
return false;" value="enable"></h:commandButton>
+ <h:commandButton onclick="#{rich:component('hotKeyID')}.disable();
return false;" value="disable"></h:commandButton>
+ </h:panelGrid>
+
+ <rich:hotKey id="jsID" timing="onregistercall"/>
+
+ <h:panelGrid columns="2">
+ <h:commandButton id="jsAddCCID" value="add hotkey:
alt+z"></h:commandButton>
+ <h:commandButton id="jsRemoveCCID" value="remove hotkey:
alt+z"></h:commandButton>
+
+ <h:commandLink id="jsAddJSID"
onclick="document.getElementById('formID:hotKeySubviewID:jsID').component.add({selector:'#formID\\:hotKeySubviewID\\:commandButtonID',
key:'alt+x',handler:function(){alert('alt+x');}}); return false;"
value="add js: alt+x"></h:commandLink>
+ <h:commandLink id="jsRemoveJSID"
onclick="document.getElementById('formID:hotKeySubviewID:jsID').component.remove();
return false;" value="remove js: alt+x"></h:commandLink>
+
+ <h:commandButton onclick="#{rich:component('jsID')}.enable(); return
false;" value="enable"></h:commandButton>
+ <h:commandButton onclick="#{rich:component('jsID')}.disable(); return
false;" value="disable"></h:commandButton>
+
+ <rich:componentControl disableDefault="true"
attachTo="jsAddCCID" for="jsID" event="onclick"
operation="add">
+ <f:param name="selector"
value="#formID\:hotKeySubviewID\:commandButtonID" />
+ <f:param name="key" value="alt+z" />
+ <f:param name="handler" value="alert('alt+z')" />
+ </rich:componentControl>
+
+ <rich:componentControl disableDefault="true"
attachTo="jsRemoveCCID" for="jsID" event="onclick"
operation="remove">
+ </rich:componentControl>
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-HotKey.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-HotKey.xml
(rev 0)
+++
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-HotKey.xml 2008-06-26
15:16:42 UTC (rev 9251)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.0//EN"
+
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>hotKey</managed-bean-name>
+ <managed-bean-class>hotKey.HotKey</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2008-06-26 15:16:06
UTC (rev 9250)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2008-06-26 15:16:42
UTC (rev 9251)
@@ -41,7 +41,7 @@
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
-
<param-value>/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,!
/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml</param-value>
+
<param-value>/WEB-INF/faces-config-HotKey.xml,/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,!
/WEB-INF/faces-config-Effect.xml,/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces!
-config-Custom.xml</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>