You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2006/01/23 09:16:16 UTC

svn commit: r371486 - in /myfaces/commons/trunk/src/main/java/org/apache/myfaces/component: DisplayValueOnlyCapable.java ExecuteOnCallback.java ExecuteOnCapable.java

Author: mmarinschek
Date: Mon Jan 23 00:16:10 2006
New Revision: 371486

URL: http://svn.apache.org/viewcvs?rev=371486&view=rev
Log:
Started architecture for callbacks, added some testing for getClientId and findComponent, moved the stuff I implemented in UIComponent for partial validation out to the new SubForm

Added:
    myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCallback.java
    myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCapable.java
Modified:
    myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/DisplayValueOnlyCapable.java

Modified: myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/DisplayValueOnlyCapable.java
URL: http://svn.apache.org/viewcvs/myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/DisplayValueOnlyCapable.java?rev=371486&r1=371485&r2=371486&view=diff
==============================================================================
--- myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/DisplayValueOnlyCapable.java (original)
+++ myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/DisplayValueOnlyCapable.java Mon Jan 23 00:16:10 2006
@@ -21,7 +21,9 @@
  * When displayValueOnly is true, the renderer should not render any input widget.
  * Only the text corresponding to the component's value should be rendered instead.
  * 
- * @author Sylvain Vieujot & Martin Marinschek (latest modification by $Author: svieujot $)
+ * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
+ * @author Martin Marinschek
+ *
  * @version $Revision: 169739 $ $Date: 2005-05-12 02:45:14 +0200 (Thu, 12 May 2005) $
  */
 public interface DisplayValueOnlyCapable

Added: myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCallback.java
URL: http://svn.apache.org/viewcvs/myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCallback.java?rev=371486&view=auto
==============================================================================
--- myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCallback.java (added)
+++ myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCallback.java Mon Jan 23 00:16:10 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * ExecuteOnCallback complementing the ExecuteOnCapable
+ * interface for extended components
+ *
+ * With findComponent - you get a component, but this component might
+ * not be prepared to actually have the correct context information. This
+ * is important for e.g. DataTables. They'll need to prepare the component
+ * with the current row-state to make sure that the method is executed
+ * correctly.
+ *
+ * @author Martin Marinschek (latest modification by $Author: grantsmith $)
+ */
+public interface ExecuteOnCallback
+{
+    public Object execute(FacesContext context, UIComponent component);
+}

Added: myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCapable.java
URL: http://svn.apache.org/viewcvs/myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCapable.java?rev=371486&view=auto
==============================================================================
--- myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCapable.java (added)
+++ myfaces/commons/trunk/src/main/java/org/apache/myfaces/component/ExecuteOnCapable.java Mon Jan 23 00:16:10 2006
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.component;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * ExecuteOnCapable interface for extended components
+ * This is a modification to the findComponent principle found
+ * in the JSF spec. With executeOn, we want to make sure that a component
+ * can itself prepare its childComponent to be in the correct state
+ * before executing a method on it.
+ *
+ * With findComponent - you get a component, but this component might
+ * not be prepared to actually have the correct context information. This
+ * is important for e.g. DataTables. They'll need to prepare the component
+ * with the current row-state to make sure that the method is executed
+ * correctly.
+ *
+ *
+ * @author Martin Marinschek (latest modification by $Author: grantsmith $)
+ */
+
+public interface ExecuteOnCapable
+{
+    /**Call this method instead of find on a component,
+     * and you will be able to execute some instructions on it
+     * by providing an ExecuteOnCallback handler.
+     *
+     * @param facesContext
+     * @param clientId
+     * @param executeOnCallback
+     * @return Object the return value of your ExecuteOnCallback-handler.
+     */
+    Object executeOn(FacesContext facesContext,
+                     String clientId, ExecuteOnCallback executeOnCallback);
+}