Author: nbelaevski
Date: 2008-08-05 14:00:31 -0400 (Tue, 05 Aug 2008)
New Revision: 9927
Added:
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2.java
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2State.java
Log:
AjaxChildrenEncoder2 & state added
Added: trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2.java
(rev 0)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2.java 2008-08-05
18:00:31 UTC (rev 9927)
@@ -0,0 +1,58 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Marker interface for components, have ability to manipulate rendering in case of Ajax
responses.
+ * Such as ajax-enabled iterator, menus etc
+ * @author shura
+ *
+ */
+public interface AjaxChildrenEncoder2 {
+
+ public AjaxChildrenEncoder2State getEncodeAjaxChildState(FacesContext context,
+ String path,Set<String> ids,Set<String> renderedAreas);
+
+ /**
+ * Iterate over all childs of components. If component id contains in list ,
+ * or, if list is empty, compotents is submitted form - render it.
+ * TODO - Instead of calculate full path for every component, build current Path
+ * for componet and send as parameter.
+ *
+ * @param context -
+ * current context
+ * @param component -
+ * curent faces component.
+ * @param ids -
+ * list of Id to render.
+ * @throws IOException
+ */
+ public void encodeAjaxChild(FacesContext context,
+ String path,Set<String> ids,Set<String> renderedAreas,
AjaxChildrenEncoder2State state) throws IOException ;
+
+
+}
Added:
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2State.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2State.java
(rev 0)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder2State.java 2008-08-05
18:00:31 UTC (rev 9927)
@@ -0,0 +1,49 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+/**
+ * Created 05.08.2008
+ * @author Nick Belaevski
+ * @since 3.2.2
+ */
+
+public interface AjaxChildrenEncoder2State {
+
+ public boolean shouldEncode();
+
+ public static final AjaxChildrenEncoder2State SHOULD_ENCODE = new
AjaxChildrenEncoder2State() {
+
+ public boolean shouldEncode() {
+ return true;
+ }
+
+ };
+
+ public static final AjaxChildrenEncoder2State SHOULD_NOT_ENCODE = new
AjaxChildrenEncoder2State() {
+
+ public boolean shouldEncode() {
+ return false;
+ }
+
+ };
+}
Show replies by date