You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-commits@incubator.apache.org by ma...@apache.org on 2006/07/25 03:54:52 UTC
svn commit: r425268 [2/7] - in
/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src:
main/java-templates/org/apache/myfaces/adf/component/
main/java/org/apache/myfaces/adf/change/
main/java/org/apache/myfaces/adf/component...
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ComponentChange.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ComponentChange.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ComponentChange.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ComponentChange.java Mon Jul 24 20:54:50 2006
@@ -1,39 +1,39 @@
-/*
- * Copyright 2005,2006 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.adf.change;
-
-import java.io.Serializable;
-
-import javax.faces.component.UIComponent;
-
-/**
- * Base class for all ComponentChanges. ComponentChanges are
- * changes that act on the JSF Component Hierarchy.
- * ComponentChanges are automatically applied during subsequent
- * creation of the view, in the
- * same order in which they were added.
- * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/ComponentChange.java#0 $) $Date: 10-nov-2005.19:09:59 $
- * @author The Oracle ADF Faces Team
- */
-abstract public class ComponentChange implements Serializable
-{
- /**
- * Apply this change to the specied component
- * @param uiComponent the UIComponent to apply the change to
- */
- public abstract void changeComponent(UIComponent uiComponent);
+/*
+ * Copyright 2005,2006 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.adf.change;
+
+import java.io.Serializable;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Base class for all ComponentChanges. ComponentChanges are
+ * changes that act on the JSF Component Hierarchy.
+ * ComponentChanges are automatically applied during subsequent
+ * creation of the view, in the
+ * same order in which they were added.
+ * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/ComponentChange.java#0 $) $Date: 10-nov-2005.19:09:59 $
+ * @author The Oracle ADF Faces Team
+ */
+abstract public class ComponentChange implements Serializable
+{
+ /**
+ * Apply this change to the specied component
+ * @param uiComponent the UIComponent to apply the change to
+ */
+ public abstract void changeComponent(UIComponent uiComponent);
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ComponentChange.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChange.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChange.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChange.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChange.java Mon Jul 24 20:54:50 2006
@@ -1,41 +1,41 @@
-/*
- * Copyright 2005,2006 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.adf.change;
-
-import org.w3c.dom.Node;
-
-/**
- * Document-aware Changes inrfaces. Changes that can apply their changes
- * to the underlying JSP DOM document, implement this interface to avoid requiring
- * a converter class be registered with the ChangeMananger
- *
- * @author The Oracle ADF Faces Team
- */
-public interface DocumentChange
-{
- /**
- * Apply this change to the specied root DOM Node of the component
- * @param Root DOM node of the component to apply the change to
- */
- public void changeDocument(Node componentNode);
-
- /**
- * Returns true if adding the DocumentChange should force the JSP Document
- * to reload
- */
- public boolean getForcesDocumentReload();
+/*
+ * Copyright 2005,2006 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.adf.change;
+
+import org.w3c.dom.Node;
+
+/**
+ * Document-aware Changes inrfaces. Changes that can apply their changes
+ * to the underlying JSP DOM document, implement this interface to avoid requiring
+ * a converter class be registered with the ChangeMananger
+ *
+ * @author The Oracle ADF Faces Team
+ */
+public interface DocumentChange
+{
+ /**
+ * Apply this change to the specied root DOM Node of the component
+ * @param Root DOM node of the component to apply the change to
+ */
+ public void changeDocument(Node componentNode);
+
+ /**
+ * Returns true if adding the DocumentChange should force the JSP Document
+ * to reload
+ */
+ public boolean getForcesDocumentReload();
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChange.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChangeFactory.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChangeFactory.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChangeFactory.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChangeFactory.java Mon Jul 24 20:54:50 2006
@@ -1,35 +1,35 @@
-/*
- * Copyright 2005,2006 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.adf.change;
-
-/**
- * Strategy Object for converting converting ComponentChanges to
- * DocumentChanges.
- *
- * @author The Oracle ADF Faces Team
- */
-public abstract class DocumentChangeFactory
-{
- /**
- * Converts a ComponentChange to a DocumentChange, returning
- * <code>null</code> if no such conversion is possible.
- * @param compChange ComponentChange to convert.
- * @return equivalent DocumetnChange or <code>null</code> if no
- * conversion is possible.
- */
- public abstract DocumentChange convert(ComponentChange compChange);
+/*
+ * Copyright 2005,2006 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.adf.change;
+
+/**
+ * Strategy Object for converting converting ComponentChanges to
+ * DocumentChanges.
+ *
+ * @author The Oracle ADF Faces Team
+ */
+public abstract class DocumentChangeFactory
+{
+ /**
+ * Converts a ComponentChange to a DocumentChange, returning
+ * <code>null</code> if no such conversion is possible.
+ * @param compChange ComponentChange to convert.
+ * @return equivalent DocumetnChange or <code>null</code> if no
+ * conversion is possible.
+ */
+ public abstract DocumentChange convert(ComponentChange compChange);
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/DocumentChangeFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/RemoveFacetComponentChange.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/RemoveFacetComponentChange.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/RemoveFacetComponentChange.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/RemoveFacetComponentChange.java Mon Jul 24 20:54:50 2006
@@ -1,90 +1,90 @@
-/*
- * Copyright 2005,2006 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.adf.change;
-
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Change specialization for removal of a facet.
- * While applying this Change, if there were to be a facet with the specified
- * name, it will be removed.
- * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/RemoveFacetComponentChange.java#0 $) $Date: 10-nov-2005.19:10:01 $
- * @author The Oracle ADF Faces Team
- */
-public class RemoveFacetComponentChange extends ComponentChange
- implements DocumentChange
-{
- /**
- * Constructs a RemoveFacetChange with the specified name of the facet.
- * @param facetName The name of facet that needs to be removed.
- * @throws IllegalArgumentException if specified facetName is
- * <code>null</code>.
- */
- public RemoveFacetComponentChange(String facetName)
- {
- if ((facetName == null) || (facetName.length() == 0))
- throw new IllegalArgumentException(
- "Cannot construct a RemoveFacetChange with null facetName.");
- _facetName = facetName;
- }
-
- /**
- * Returns the name of facet that needs to be removed.
- */
- public String getFacetName()
- {
- return _facetName;
- }
-
- /**
- * {@inheritDoc}
- */
- public void changeComponent(UIComponent uiComponent)
- {
- Map facets = uiComponent.getFacets();
- facets.remove(_facetName);
- }
-
- /**
- * {@inheritDoc}
- */
- public void changeDocument(Node componentNode)
- {
- Element facetElement = ChangeUtils.__getFacetElement(componentNode, _facetName);
-
- if (facetElement != null)
- {
- componentNode.removeChild(facetElement);
- }
- }
-
- /**
- * Returns true if adding the DocumentChange should force the JSP Document
- * to reload
- */
- public boolean getForcesDocumentReload()
- {
- return false;
- }
-
- private final String _facetName;
+/*
+ * Copyright 2005,2006 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.adf.change;
+
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Change specialization for removal of a facet.
+ * While applying this Change, if there were to be a facet with the specified
+ * name, it will be removed.
+ * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/RemoveFacetComponentChange.java#0 $) $Date: 10-nov-2005.19:10:01 $
+ * @author The Oracle ADF Faces Team
+ */
+public class RemoveFacetComponentChange extends ComponentChange
+ implements DocumentChange
+{
+ /**
+ * Constructs a RemoveFacetChange with the specified name of the facet.
+ * @param facetName The name of facet that needs to be removed.
+ * @throws IllegalArgumentException if specified facetName is
+ * <code>null</code>.
+ */
+ public RemoveFacetComponentChange(String facetName)
+ {
+ if ((facetName == null) || (facetName.length() == 0))
+ throw new IllegalArgumentException(
+ "Cannot construct a RemoveFacetChange with null facetName.");
+ _facetName = facetName;
+ }
+
+ /**
+ * Returns the name of facet that needs to be removed.
+ */
+ public String getFacetName()
+ {
+ return _facetName;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void changeComponent(UIComponent uiComponent)
+ {
+ Map facets = uiComponent.getFacets();
+ facets.remove(_facetName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void changeDocument(Node componentNode)
+ {
+ Element facetElement = ChangeUtils.__getFacetElement(componentNode, _facetName);
+
+ if (facetElement != null)
+ {
+ componentNode.removeChild(facetElement);
+ }
+ }
+
+ /**
+ * Returns true if adding the DocumentChange should force the JSP Document
+ * to reload
+ */
+ public boolean getForcesDocumentReload()
+ {
+ return false;
+ }
+
+ private final String _facetName;
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/RemoveFacetComponentChange.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ReorderChildrenComponentChange.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ReorderChildrenComponentChange.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ReorderChildrenComponentChange.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ReorderChildrenComponentChange.java Mon Jul 24 20:54:50 2006
@@ -1,213 +1,213 @@
-/*
- * Copyright 2005,2006 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.adf.change;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import org.w3c.dom.Node;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Attr;
-
-/**
- * Change specialization for re-ordering of children.
- * While applying this Change, the specified order of children is restored.
- * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/ReorderChildrenComponentChange.java#0 $) $Date: 10-nov-2005.19:10:01 $
- * @author The Oracle ADF Faces Team
- */
-public class ReorderChildrenComponentChange extends ComponentChange
- implements DocumentChange
-{
- /**
- * Constructs a ReorderChange with the given List of identifiers for children.
- * @param childIds An in-order collection (List) of Ids (as java.lang.String)
- * of child components.
- * This List implementation should be of type java.io.Serializable in
- * order to be persisted.
- * @throws IllegalArgumentException if supplied childIds were to be null.
- */
- public ReorderChildrenComponentChange(
- List childIds
- )
- {
- if (childIds == null)
- throw new IllegalArgumentException(
- "Cannot construct a ReorderChange with null childIds.");
-
- // make serializable copy of list
- _childIds = Collections.unmodifiableList(new ArrayList(childIds));
- }
-
- /**
- * Returns an unmodifiable List of the identifiers for the children.
- */
- public List getChildIds()
- {
- return _childIds;
- }
-
- /**
- * {@inheritDoc}
- * In case children were to be removed between the time when this Change was
- * added, and the time when it was applied, maybe due to application of a
- * RemoveChildrenChange, such children are not re-instated.
- * In case children were to be added between the time when this Change was
- * added, and the time when it was applied, maybe due to application of an
- * AddChildChange, such children are appended to the end of the list in
- * preserving the order in which they were added (that is they appear at
- * the end).
- */
- public void changeComponent(UIComponent uiComponent)
- {
- int childCount = uiComponent.getChildCount();
-
- if (childCount == 0)
- return;
-
- // build order map of of current Nodes, keyed by id
- Map childrenMap = new LinkedHashMap();
-
- List children = uiComponent.getChildren();
-
- Iterator kids = children.iterator();
-
- while (kids.hasNext())
- {
- UIComponent currChild = (UIComponent)kids.next();
- childrenMap.put(currChild.getId(), currChild );
- }
-
- // remove the children so that we can add them back in
- children.clear();
-
- //
- // put children back in, in order
- //
- Iterator childIds = _childIds.iterator();
-
- while (childIds.hasNext())
- {
- Object currReorderID = childIds.next();
-
- UIComponent currChild = (UIComponent)childrenMap.remove(currReorderID);
-
- if (currChild != null)
- {
- children.add(currChild);
- }
- }
-
- // add in all of the rest of the children in
- // relative order they originally appeared
- children.addAll(childrenMap.values());
- }
-
- /**
- * {@inheritDoc}
- * In case children were to be removed between the time when this Change was
- * added, and the time when it was applied, maybe due to application of a
- * RemoveChildrenChange, such children are not re-instated.
- * In case children were to be added between the time when this Change was
- * added, and the time when it was applied, maybe due to application of an
- * AddChildChange, such children are appended to the end of the list in
- * preserving the order in which they were added (that is they appear at
- * the end).
- */
- public void changeDocument(
- Node componentNode)
- {
- // build order map of of current Nodes, keyed by id
- LinkedHashMap currChildrenMap = new LinkedHashMap(13);
-
- Node currChild = componentNode.getFirstChild();
-
- while (currChild != null)
- {
- int fakeIndex = 0;
- NamedNodeMap attributes = currChild.getAttributes();
-
- Object currKey = null;
- if (attributes != null)
- {
- Node idAttr = (Attr)attributes.getNamedItem("id");
-
- if (idAttr != null)
- {
- currKey = idAttr.getNodeValue();
- }
- }
-
- // create a dummy key to maintain order of non-ided children
- if (currKey == null)
- {
- // =-= bts What about insignificant whitespace?
- currKey = new Integer(fakeIndex++);
- }
-
- currChildrenMap.put(currKey, currChild);
-
- // remove the children so that we can add them back in
- componentNode.removeChild(currChild);
-
- // next node is first node again
- currChild = componentNode.getFirstChild();
- }
-
- //
- // put children back in, in order
- //
- Iterator childIds = _childIds.iterator();
-
- while (childIds.hasNext())
- {
- Object currReorderID = childIds.next();
-
- currChild = (Node)currChildrenMap.remove(currReorderID);
-
- if (currChild != null)
- {
- componentNode.appendChild(currChild);
- }
- }
-
- // add in all of the rest of the children in
- // relative order they originally appeared
- Iterator restOfChildren = currChildrenMap.entrySet().iterator();
-
- while (restOfChildren.hasNext())
- {
- currChild = (Node)((Map.Entry)restOfChildren.next()).getValue();
- componentNode.appendChild(currChild);
- }
- }
-
- /**
- * Returns true if adding the DocumentChange should force the JSP Document
- * to reload
- */
- public boolean getForcesDocumentReload()
- {
- return false;
- }
-
- private final List _childIds;
+/*
+ * Copyright 2005,2006 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.adf.change;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import org.w3c.dom.Node;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Attr;
+
+/**
+ * Change specialization for re-ordering of children.
+ * While applying this Change, the specified order of children is restored.
+ * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/ReorderChildrenComponentChange.java#0 $) $Date: 10-nov-2005.19:10:01 $
+ * @author The Oracle ADF Faces Team
+ */
+public class ReorderChildrenComponentChange extends ComponentChange
+ implements DocumentChange
+{
+ /**
+ * Constructs a ReorderChange with the given List of identifiers for children.
+ * @param childIds An in-order collection (List) of Ids (as java.lang.String)
+ * of child components.
+ * This List implementation should be of type java.io.Serializable in
+ * order to be persisted.
+ * @throws IllegalArgumentException if supplied childIds were to be null.
+ */
+ public ReorderChildrenComponentChange(
+ List childIds
+ )
+ {
+ if (childIds == null)
+ throw new IllegalArgumentException(
+ "Cannot construct a ReorderChange with null childIds.");
+
+ // make serializable copy of list
+ _childIds = Collections.unmodifiableList(new ArrayList(childIds));
+ }
+
+ /**
+ * Returns an unmodifiable List of the identifiers for the children.
+ */
+ public List getChildIds()
+ {
+ return _childIds;
+ }
+
+ /**
+ * {@inheritDoc}
+ * In case children were to be removed between the time when this Change was
+ * added, and the time when it was applied, maybe due to application of a
+ * RemoveChildrenChange, such children are not re-instated.
+ * In case children were to be added between the time when this Change was
+ * added, and the time when it was applied, maybe due to application of an
+ * AddChildChange, such children are appended to the end of the list in
+ * preserving the order in which they were added (that is they appear at
+ * the end).
+ */
+ public void changeComponent(UIComponent uiComponent)
+ {
+ int childCount = uiComponent.getChildCount();
+
+ if (childCount == 0)
+ return;
+
+ // build order map of of current Nodes, keyed by id
+ Map childrenMap = new LinkedHashMap();
+
+ List children = uiComponent.getChildren();
+
+ Iterator kids = children.iterator();
+
+ while (kids.hasNext())
+ {
+ UIComponent currChild = (UIComponent)kids.next();
+ childrenMap.put(currChild.getId(), currChild );
+ }
+
+ // remove the children so that we can add them back in
+ children.clear();
+
+ //
+ // put children back in, in order
+ //
+ Iterator childIds = _childIds.iterator();
+
+ while (childIds.hasNext())
+ {
+ Object currReorderID = childIds.next();
+
+ UIComponent currChild = (UIComponent)childrenMap.remove(currReorderID);
+
+ if (currChild != null)
+ {
+ children.add(currChild);
+ }
+ }
+
+ // add in all of the rest of the children in
+ // relative order they originally appeared
+ children.addAll(childrenMap.values());
+ }
+
+ /**
+ * {@inheritDoc}
+ * In case children were to be removed between the time when this Change was
+ * added, and the time when it was applied, maybe due to application of a
+ * RemoveChildrenChange, such children are not re-instated.
+ * In case children were to be added between the time when this Change was
+ * added, and the time when it was applied, maybe due to application of an
+ * AddChildChange, such children are appended to the end of the list in
+ * preserving the order in which they were added (that is they appear at
+ * the end).
+ */
+ public void changeDocument(
+ Node componentNode)
+ {
+ // build order map of of current Nodes, keyed by id
+ LinkedHashMap currChildrenMap = new LinkedHashMap(13);
+
+ Node currChild = componentNode.getFirstChild();
+
+ while (currChild != null)
+ {
+ int fakeIndex = 0;
+ NamedNodeMap attributes = currChild.getAttributes();
+
+ Object currKey = null;
+ if (attributes != null)
+ {
+ Node idAttr = (Attr)attributes.getNamedItem("id");
+
+ if (idAttr != null)
+ {
+ currKey = idAttr.getNodeValue();
+ }
+ }
+
+ // create a dummy key to maintain order of non-ided children
+ if (currKey == null)
+ {
+ // =-= bts What about insignificant whitespace?
+ currKey = new Integer(fakeIndex++);
+ }
+
+ currChildrenMap.put(currKey, currChild);
+
+ // remove the children so that we can add them back in
+ componentNode.removeChild(currChild);
+
+ // next node is first node again
+ currChild = componentNode.getFirstChild();
+ }
+
+ //
+ // put children back in, in order
+ //
+ Iterator childIds = _childIds.iterator();
+
+ while (childIds.hasNext())
+ {
+ Object currReorderID = childIds.next();
+
+ currChild = (Node)currChildrenMap.remove(currReorderID);
+
+ if (currChild != null)
+ {
+ componentNode.appendChild(currChild);
+ }
+ }
+
+ // add in all of the rest of the children in
+ // relative order they originally appeared
+ Iterator restOfChildren = currChildrenMap.entrySet().iterator();
+
+ while (restOfChildren.hasNext())
+ {
+ currChild = (Node)((Map.Entry)restOfChildren.next()).getValue();
+ componentNode.appendChild(currChild);
+ }
+ }
+
+ /**
+ * Returns true if adding the DocumentChange should force the JSP Document
+ * to reload
+ */
+ public boolean getForcesDocumentReload()
+ {
+ return false;
+ }
+
+ private final List _childIds;
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/ReorderChildrenComponentChange.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildComponentChange.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildComponentChange.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildComponentChange.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildComponentChange.java Mon Jul 24 20:54:50 2006
@@ -1,77 +1,77 @@
-/*
- * Copyright 2005,2006 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.adf.change;
-
-import javax.faces.component.UIComponent;
-
-/**
- * Change specialization for adding a facet.
- * While applying this Change, the specified component is re-created and added
- * as a facet. If there were to be a facet by the specified name already, it
- * will be replaced.
- * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/SetFacetChildComponentChange.java#0 $) $Date: 10-nov-2005.19:10:02 $
- * @author The Oracle ADF Faces Team
- */
-public class SetFacetChildComponentChange extends AddComponentChange
-{
- /**
- * Constructs an AddFacetChange with the specified facet name and the
- * corresponding component.
- * @param facetName The name by which the component is to be added as a facet.
- * @param facetComponent The component that is to be added as a facet.
- * @throws IllegalArgumentException if specified facetName or the
- * facetComponent were to be null.
- */
- public SetFacetChildComponentChange(
- String facetName,
- UIComponent facetComponent)
- {
- super(facetComponent);
-
- if ((facetName == null) || (facetName.length() == 0))
- throw new IllegalArgumentException(
- "Cannot construct an AddFacetChange with either of facetName or " +
- "facetComponent being null.");
-
- _facetName = facetName;
- }
-
- /**
- * Returns the name by which the facet is to be added while applying this
- * Change.
- */
- public String getFacetName()
- {
- return _facetName;
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void changeComponent(UIComponent uiComponent)
- {
- UIComponent facetComponent = getComponent();
-
- if (facetComponent == null)
- return;
-
- uiComponent.getFacets().put(_facetName, facetComponent);
- }
-
- private final String _facetName;
+/*
+ * Copyright 2005,2006 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.adf.change;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Change specialization for adding a facet.
+ * While applying this Change, the specified component is re-created and added
+ * as a facet. If there were to be a facet by the specified name already, it
+ * will be replaced.
+ * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/change/SetFacetChildComponentChange.java#0 $) $Date: 10-nov-2005.19:10:02 $
+ * @author The Oracle ADF Faces Team
+ */
+public class SetFacetChildComponentChange extends AddComponentChange
+{
+ /**
+ * Constructs an AddFacetChange with the specified facet name and the
+ * corresponding component.
+ * @param facetName The name by which the component is to be added as a facet.
+ * @param facetComponent The component that is to be added as a facet.
+ * @throws IllegalArgumentException if specified facetName or the
+ * facetComponent were to be null.
+ */
+ public SetFacetChildComponentChange(
+ String facetName,
+ UIComponent facetComponent)
+ {
+ super(facetComponent);
+
+ if ((facetName == null) || (facetName.length() == 0))
+ throw new IllegalArgumentException(
+ "Cannot construct an AddFacetChange with either of facetName or " +
+ "facetComponent being null.");
+
+ _facetName = facetName;
+ }
+
+ /**
+ * Returns the name by which the facet is to be added while applying this
+ * Change.
+ */
+ public String getFacetName()
+ {
+ return _facetName;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void changeComponent(UIComponent uiComponent)
+ {
+ UIComponent facetComponent = getComponent();
+
+ if (facetComponent == null)
+ return;
+
+ uiComponent.getFacets().put(_facetName, facetComponent);
+ }
+
+ private final String _facetName;
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildComponentChange.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildDocumentChange.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildDocumentChange.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildDocumentChange.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildDocumentChange.java Mon Jul 24 20:54:50 2006
@@ -1,118 +1,118 @@
-/*
- * Copyright 2005,2006 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.adf.change;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Change specialization for adding a child component to a facet using document
- * mark up. While applying this Change, the child component is created and added to
- * the document. If the facet doesn't exist, it will be created. If the facet
- * does exist, all of its content will be removed and the new content added.
- * @author The Oracle ADF Faces Team
- */
-public class SetFacetChildDocumentChange extends AddComponentDocumentChange
-{
- /**
- * Constructs an AddFacetDocumentChange with the specified child component mark up and
- * the name of the facet.
- * @param facetName Name of facet to create the child component in
- * @param componentFragment DOM mark up for child component to be inserted.
- * @throws IllegalArgumentException if facetName or componentFragment is
- * <code>null</code>
- */
- public SetFacetChildDocumentChange(
- String facetName,
- DocumentFragment fragment)
- {
- super(fragment);
-
- if ((facetName == null) || (facetName.length() == 0))
- throw new IllegalArgumentException("Facet name must be specified");
-
- _facetName = facetName;
- }
-
- /**
- * Returns the identifier of the sibling before which this new child needs to
- * be inserted.
- */
- public String getFacetName()
- {
- return _facetName;
- }
-
- /**
- * Given the DOM Node representing a Component, apply any necessary
- * DOM changes.
- * While applying this Change, the child component is created and added to
- * the document. If the facet doesn't exist, it will be created. If the facet
- * does exist, all of its content will be removed and the new content added.
- */
- public void changeDocument(Node componentNode)
- {
- if (componentNode == null)
- throw new IllegalArgumentException("No node specified");
-
- // get the fragement, imported into the target document
- DocumentFragment targetFragment = getImportedComponentFragment(componentNode);
-
- Element facetElement = ChangeUtils.__getFacetElement(componentNode, _facetName);
-
- if (facetElement != null)
- {
- // remove any current children
- ChangeUtils.__removeAllChildren(facetElement);
- }
- else
- {
- Document targetDocument = componentNode.getOwnerDocument();
-
- facetElement = targetDocument.createElementNS(_JSF_CORE_NAMESPACE, "f:facet");
-
- // set the xmlns for the prefix to make sure that "f:" is the
- // prefix for faces
- // =-= bts TODO In theory, this could cause problems if the
- // added component used the prefix "f:" for something other than
- // the JSF core
- facetElement.setAttributeNS(_XMLNS_NAMESPACE, "xmlns:f",
- _JSF_CORE_NAMESPACE);
-
- componentNode.appendChild(facetElement);
- }
-
- // add our new facet content
- facetElement.appendChild(targetFragment);
- }
-
- /**
- * Returns true if adding the DocumentChange should force the JSP Document
- * to reload
- */
- public boolean getForcesDocumentReload()
- {
- return false;
- }
-
- private static final String _JSF_CORE_NAMESPACE = "http://java.sun.com/jsf/core";
- private static final String _XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
-
- private final String _facetName;
+/*
+ * Copyright 2005,2006 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.adf.change;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Change specialization for adding a child component to a facet using document
+ * mark up. While applying this Change, the child component is created and added to
+ * the document. If the facet doesn't exist, it will be created. If the facet
+ * does exist, all of its content will be removed and the new content added.
+ * @author The Oracle ADF Faces Team
+ */
+public class SetFacetChildDocumentChange extends AddComponentDocumentChange
+{
+ /**
+ * Constructs an AddFacetDocumentChange with the specified child component mark up and
+ * the name of the facet.
+ * @param facetName Name of facet to create the child component in
+ * @param componentFragment DOM mark up for child component to be inserted.
+ * @throws IllegalArgumentException if facetName or componentFragment is
+ * <code>null</code>
+ */
+ public SetFacetChildDocumentChange(
+ String facetName,
+ DocumentFragment fragment)
+ {
+ super(fragment);
+
+ if ((facetName == null) || (facetName.length() == 0))
+ throw new IllegalArgumentException("Facet name must be specified");
+
+ _facetName = facetName;
+ }
+
+ /**
+ * Returns the identifier of the sibling before which this new child needs to
+ * be inserted.
+ */
+ public String getFacetName()
+ {
+ return _facetName;
+ }
+
+ /**
+ * Given the DOM Node representing a Component, apply any necessary
+ * DOM changes.
+ * While applying this Change, the child component is created and added to
+ * the document. If the facet doesn't exist, it will be created. If the facet
+ * does exist, all of its content will be removed and the new content added.
+ */
+ public void changeDocument(Node componentNode)
+ {
+ if (componentNode == null)
+ throw new IllegalArgumentException("No node specified");
+
+ // get the fragement, imported into the target document
+ DocumentFragment targetFragment = getImportedComponentFragment(componentNode);
+
+ Element facetElement = ChangeUtils.__getFacetElement(componentNode, _facetName);
+
+ if (facetElement != null)
+ {
+ // remove any current children
+ ChangeUtils.__removeAllChildren(facetElement);
+ }
+ else
+ {
+ Document targetDocument = componentNode.getOwnerDocument();
+
+ facetElement = targetDocument.createElementNS(_JSF_CORE_NAMESPACE, "f:facet");
+
+ // set the xmlns for the prefix to make sure that "f:" is the
+ // prefix for faces
+ // =-= bts TODO In theory, this could cause problems if the
+ // added component used the prefix "f:" for something other than
+ // the JSF core
+ facetElement.setAttributeNS(_XMLNS_NAMESPACE, "xmlns:f",
+ _JSF_CORE_NAMESPACE);
+
+ componentNode.appendChild(facetElement);
+ }
+
+ // add our new facet content
+ facetElement.appendChild(targetFragment);
+ }
+
+ /**
+ * Returns true if adding the DocumentChange should force the JSP Document
+ * to reload
+ */
+ public boolean getForcesDocumentReload()
+ {
+ return false;
+ }
+
+ private static final String _JSF_CORE_NAMESPACE = "http://java.sun.com/jsf/core";
+ private static final String _XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
+
+ private final String _facetName;
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/change/SetFacetChildDocumentChange.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ChildLoop.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ChildLoop.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ChildLoop.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ChildLoop.java Mon Jul 24 20:54:50 2006
@@ -13,82 +13,82 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.adf.component;
-import java.util.Collection;
-import java.util.Iterator;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-/**
- * @author The Oracle ADF Faces Team
- */
-abstract class ChildLoop
-{
- public ChildLoop()
- {
- }
-
- public final void run(FacesContext context, UIXCollection comp)
- {
- run(context, comp, comp);
- }
-
- public final void run(FacesContext context,
- UIXCollection comp, UIComponent child)
- {
- if (shouldRun(comp))
- runAlways(context, child);
- }
-
- public final void runAlways(FacesContext context, UIComponent comp)
- {
- runAlways(context, comp.getChildren());
- }
-
- public final void runAlways(FacesContext context, Collection kids)
- {
- Iterator children = kids.iterator();
- while (children.hasNext())
- {
- UIComponent child = (UIComponent) children.next();
- process(context, child);
- }
- }
-
- /**
- * See if we need to run at all (which is usually only
- * if there is available data on this row)
- */
- protected boolean shouldRun(UIXCollection comp)
- {
- return comp.isRowAvailable();
- }
-
- protected abstract void process(FacesContext context,
- UIComponent child);
-
- static final class Update extends ChildLoop
- {
- protected void process(FacesContext context, UIComponent child)
- {
- child.processUpdates(context);
- }
- }
-
- static final class Validate extends ChildLoop
- {
- protected void process(FacesContext context, UIComponent child)
- {
- child.processValidators(context);
- }
- }
-
- static final class Decode extends ChildLoop
- {
- protected void process(FacesContext context, UIComponent child)
- {
- child.processDecodes(context);
- }
- }
-
-}
+package org.apache.myfaces.adf.component;
+import java.util.Collection;
+import java.util.Iterator;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author The Oracle ADF Faces Team
+ */
+abstract class ChildLoop
+{
+ public ChildLoop()
+ {
+ }
+
+ public final void run(FacesContext context, UIXCollection comp)
+ {
+ run(context, comp, comp);
+ }
+
+ public final void run(FacesContext context,
+ UIXCollection comp, UIComponent child)
+ {
+ if (shouldRun(comp))
+ runAlways(context, child);
+ }
+
+ public final void runAlways(FacesContext context, UIComponent comp)
+ {
+ runAlways(context, comp.getChildren());
+ }
+
+ public final void runAlways(FacesContext context, Collection kids)
+ {
+ Iterator children = kids.iterator();
+ while (children.hasNext())
+ {
+ UIComponent child = (UIComponent) children.next();
+ process(context, child);
+ }
+ }
+
+ /**
+ * See if we need to run at all (which is usually only
+ * if there is available data on this row)
+ */
+ protected boolean shouldRun(UIXCollection comp)
+ {
+ return comp.isRowAvailable();
+ }
+
+ protected abstract void process(FacesContext context,
+ UIComponent child);
+
+ static final class Update extends ChildLoop
+ {
+ protected void process(FacesContext context, UIComponent child)
+ {
+ child.processUpdates(context);
+ }
+ }
+
+ static final class Validate extends ChildLoop
+ {
+ protected void process(FacesContext context, UIComponent child)
+ {
+ child.processValidators(context);
+ }
+ }
+
+ static final class Decode extends ChildLoop
+ {
+ protected void process(FacesContext context, UIComponent child)
+ {
+ child.processDecodes(context);
+ }
+ }
+
+}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ChildLoop.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ValueMap.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ValueMap.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ValueMap.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ValueMap.java Mon Jul 24 20:54:50 2006
@@ -13,105 +13,105 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.adf.component;
-import java.io.Externalizable;
-
-import java.util.AbstractMap;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.io.ObjectOutput;
-import java.io.IOException;
-import java.io.ObjectInput;
-
-/**
- * This class implements a Map whose values can themselves be used to obtain
- * the corresponding keys.
- *
- * it is illegal for two keys to be paired with the same value.
- *
- * @author The Oracle ADF Faces Team
- */
-final class ValueMap extends AbstractMap implements Externalizable
-{
- public ValueMap()
- {
- // noarg constructor needed for serialization
- }
-
- /**
- * Gets the value associated with the given key
- */
- public Object get(Object key)
- {
- return _cache.get(key);
- }
-
- /**
- * Gets the key associated with the given value
- */
- public Object getKey(Object value)
- {
- return _valueMap.get(value);
- }
-
- public Object put(Object key, Object value)
- {
- Object oldKey = _valueMap.put(value, key);
- assert oldKey == null : "value:"+value+" is referenced by both key:"+key+
- " and key:"+oldKey;
-
- Object old = _cache.put(key, value);
- assert old == null : "can't put the same key twice";
- return old;
- }
-
- public void clear()
- {
- _cache.clear();
- _valueMap.clear();
- }
-
- public int size()
- {
- return _cache.size();
- }
-
- public Set entrySet()
- {
- return Collections.unmodifiableSet(_cache.entrySet());
- }
-
- private static Map _setupValueMap(Map cache)
- {
- Map valueMap = new HashMap(cache.size());
- Iterator entries = cache.entrySet().iterator();
- while(entries.hasNext())
- {
- Map.Entry entry = (Map.Entry) entries.next();
- Object old = valueMap.put(entry.getValue(), entry.getKey());
- assert old == null : "the value:"+entry.getValue()+
- " was bound to both key:"+old+
- " and key:"+entry.getKey();
- }
- return valueMap;
- }
-
- public void writeExternal(ObjectOutput out) throws IOException
- {
- out.writeObject(_cache);
- }
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- {
- _cache = (Map) in.readObject();
- _valueMap = _setupValueMap(_cache);
- }
-
- private Map _cache = new HashMap(13);
- private transient Map _valueMap = new HashMap(13);
-
- //private static final ADFLogger _LOG = ADFLogger.createADFLogger(InvertibleMap.class);
+package org.apache.myfaces.adf.component;
+import java.io.Externalizable;
+
+import java.util.AbstractMap;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.io.ObjectOutput;
+import java.io.IOException;
+import java.io.ObjectInput;
+
+/**
+ * This class implements a Map whose values can themselves be used to obtain
+ * the corresponding keys.
+ *
+ * it is illegal for two keys to be paired with the same value.
+ *
+ * @author The Oracle ADF Faces Team
+ */
+final class ValueMap extends AbstractMap implements Externalizable
+{
+ public ValueMap()
+ {
+ // noarg constructor needed for serialization
+ }
+
+ /**
+ * Gets the value associated with the given key
+ */
+ public Object get(Object key)
+ {
+ return _cache.get(key);
+ }
+
+ /**
+ * Gets the key associated with the given value
+ */
+ public Object getKey(Object value)
+ {
+ return _valueMap.get(value);
+ }
+
+ public Object put(Object key, Object value)
+ {
+ Object oldKey = _valueMap.put(value, key);
+ assert oldKey == null : "value:"+value+" is referenced by both key:"+key+
+ " and key:"+oldKey;
+
+ Object old = _cache.put(key, value);
+ assert old == null : "can't put the same key twice";
+ return old;
+ }
+
+ public void clear()
+ {
+ _cache.clear();
+ _valueMap.clear();
+ }
+
+ public int size()
+ {
+ return _cache.size();
+ }
+
+ public Set entrySet()
+ {
+ return Collections.unmodifiableSet(_cache.entrySet());
+ }
+
+ private static Map _setupValueMap(Map cache)
+ {
+ Map valueMap = new HashMap(cache.size());
+ Iterator entries = cache.entrySet().iterator();
+ while(entries.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) entries.next();
+ Object old = valueMap.put(entry.getValue(), entry.getKey());
+ assert old == null : "the value:"+entry.getValue()+
+ " was bound to both key:"+old+
+ " and key:"+entry.getKey();
+ }
+ return valueMap;
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ out.writeObject(_cache);
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ _cache = (Map) in.readObject();
+ _valueMap = _setupValueMap(_cache);
+ }
+
+ private Map _cache = new HashMap(13);
+ private transient Map _valueMap = new HashMap(13);
+
+ //private static final ADFLogger _LOG = ADFLogger.createADFLogger(InvertibleMap.class);
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/ValueMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/WrapperEvent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/WrapperEvent.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/WrapperEvent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/WrapperEvent.java Mon Jul 24 20:54:50 2006
@@ -13,54 +13,54 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.adf.component;
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-import javax.faces.event.PhaseId;
-
-/**
- * This class wraps a FacesEvent
- * @author The Oracle ADF Faces Team
- */
-class WrapperEvent extends FacesEvent
-{
- public WrapperEvent(UIComponent source, FacesEvent wrappedEvent)
- {
- super(source);
- // Event can't be null
- if (wrappedEvent == null)
- throw new NullPointerException("wrappedEvent");
-
- _event = wrappedEvent;
- }
-
- public PhaseId getPhaseId()
- {
- return _event.getPhaseId();
- }
-
- public void setPhaseId(PhaseId phaseId)
- {
- _event.setPhaseId(phaseId);
- }
-
- public void processListener(FacesListener listener)
- {
- // This event is never delivered to a listener
- throw new IllegalStateException();
- }
-
- public boolean isAppropriateListener(FacesListener listener)
- {
- // This event is never delivered to a listener
- return false;
- }
-
- public FacesEvent getEvent()
- {
- return _event;
- }
-
- private final FacesEvent _event;
+package org.apache.myfaces.adf.component;
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+import javax.faces.event.PhaseId;
+
+/**
+ * This class wraps a FacesEvent
+ * @author The Oracle ADF Faces Team
+ */
+class WrapperEvent extends FacesEvent
+{
+ public WrapperEvent(UIComponent source, FacesEvent wrappedEvent)
+ {
+ super(source);
+ // Event can't be null
+ if (wrappedEvent == null)
+ throw new NullPointerException("wrappedEvent");
+
+ _event = wrappedEvent;
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return _event.getPhaseId();
+ }
+
+ public void setPhaseId(PhaseId phaseId)
+ {
+ _event.setPhaseId(phaseId);
+ }
+
+ public void processListener(FacesListener listener)
+ {
+ // This event is never delivered to a listener
+ throw new IllegalStateException();
+ }
+
+ public boolean isAppropriateListener(FacesListener listener)
+ {
+ // This event is never delivered to a listener
+ return false;
+ }
+
+ public FacesEvent getEvent()
+ {
+ return _event;
+ }
+
+ private final FacesEvent _event;
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/component/WrapperEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/ComponentConfig.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/ComponentConfig.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/ComponentConfig.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/ComponentConfig.java Mon Jul 24 20:54:50 2006
@@ -13,32 +13,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.adf.config;
-
-/**
- * This class represents the metadata of a component definition in
- * a faces-config type file.
- * @author The Oracle ADF Faces Team
- */
-public abstract class ComponentConfig
-{
- protected ComponentConfig()
- {
- }
-
- /**
- * Gets the description of this component
- */
- public abstract String getDescription();
-
- /**
- * Gets the display-name of this component
- */
- public abstract String getDisplayName();
-
- /**
- * Gets the component-type of this component
- */
- public abstract String getComponentType();
-
+package org.apache.myfaces.adf.config;
+
+/**
+ * This class represents the metadata of a component definition in
+ * a faces-config type file.
+ * @author The Oracle ADF Faces Team
+ */
+public abstract class ComponentConfig
+{
+ protected ComponentConfig()
+ {
+ }
+
+ /**
+ * Gets the description of this component
+ */
+ public abstract String getDescription();
+
+ /**
+ * Gets the display-name of this component
+ */
+ public abstract String getDisplayName();
+
+ /**
+ * Gets the component-type of this component
+ */
+ public abstract String getComponentType();
+
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/ComponentConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionConfig.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionConfig.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionConfig.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionConfig.java Mon Jul 24 20:54:50 2006
@@ -13,34 +13,34 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.adf.config;
-
-/**
- * Provides metadata about region definitions.
- * Here's a simple example of a region definition in region-metadata.xml:
- *
- * <pre>
- * <component>
- * <component-type>
- * org.apache.myfaces.adfdemo.view.faces.region.stock
- * </component-type>
- * <component-extension>
- * <region-jsp-ui-def>/regions/stock.jspx</region-jsp-ui-def>
- * </component-extension>
- * </component>
- * </pre>
- * The regionType of a region is defined to be the
- * componentType of that component.
- * @author The Oracle ADF Faces Team
- */
-public abstract class RegionConfig extends ComponentConfig
-{
- protected RegionConfig()
- {
- }
-
- /**
- * Gets the URL of the jsp file that is used to render this region
- */
- public abstract String getJspUIDef();
+package org.apache.myfaces.adf.config;
+
+/**
+ * Provides metadata about region definitions.
+ * Here's a simple example of a region definition in region-metadata.xml:
+ *
+ * <pre>
+ * <component>
+ * <component-type>
+ * org.apache.myfaces.adfdemo.view.faces.region.stock
+ * </component-type>
+ * <component-extension>
+ * <region-jsp-ui-def>/regions/stock.jspx</region-jsp-ui-def>
+ * </component-extension>
+ * </component>
+ * </pre>
+ * The regionType of a region is defined to be the
+ * componentType of that component.
+ * @author The Oracle ADF Faces Team
+ */
+public abstract class RegionConfig extends ComponentConfig
+{
+ protected RegionConfig()
+ {
+ }
+
+ /**
+ * Gets the URL of the jsp file that is used to render this region
+ */
+ public abstract String getJspUIDef();
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionManager.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionManager.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionManager.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionManager.java Mon Jul 24 20:54:50 2006
@@ -13,35 +13,35 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.adf.config;
-import java.util.Map;
-
-/**
- * Manages region definitions.
- * This will parse the region metadata files to create and cache
- * an instance of this object.
- * All resources with the name "/META-INF/region-metadata.xml" will be searched.
- * /WEB-INF/region-metadata.xml will also be searched.
- * @author The Oracle ADF Faces Team
- */
-public abstract class RegionManager
-{
- protected RegionManager()
- {
- }
-
- /**
- * Gets all the registered regions.
- * @return An immutable Map.
- * Each key is a regionType String.
- * Each value is of type {@link RegionConfig}.
- */
- public abstract Map getRegionConfigs();
-
- /**
- * Gets the RegionConfig for a particular regionType
- * @param regionType the component-type of the region
- * @return null, if the region does not exist.
- */
- public abstract RegionConfig getRegionConfig(String regionType);
+package org.apache.myfaces.adf.config;
+import java.util.Map;
+
+/**
+ * Manages region definitions.
+ * This will parse the region metadata files to create and cache
+ * an instance of this object.
+ * All resources with the name "/META-INF/region-metadata.xml" will be searched.
+ * /WEB-INF/region-metadata.xml will also be searched.
+ * @author The Oracle ADF Faces Team
+ */
+public abstract class RegionManager
+{
+ protected RegionManager()
+ {
+ }
+
+ /**
+ * Gets all the registered regions.
+ * @return An immutable Map.
+ * Each key is a regionType String.
+ * Each value is of type {@link RegionConfig}.
+ */
+ public abstract Map getRegionConfigs();
+
+ /**
+ * Gets the RegionConfig for a particular regionType
+ * @param regionType the component-type of the region
+ * @return null, if the region does not exist.
+ */
+ public abstract RegionConfig getRegionConfig(String regionType);
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/config/RegionManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/Agent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/Agent.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/Agent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/Agent.java Mon Jul 24 20:54:50 2006
@@ -13,155 +13,155 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.myfaces.adf.context;
-
-import java.util.Map;
-
-/**
- * The Agent interface describes the client that is making the request that will display
- * the rendered output.
- * <p>
- * Implementations that provide the set of capabilities must clearly define the names
- * of these capabilities and their values.
- * </p>
- * <p>
- * Capability names that are implementation private must be defined so using appropriate
- * naming schemes. ADF private capability names are prefixed using "-adfinternal-xxx",
- * and such capability names (and their values) may change at anytime
- * (and not guaranteed to be supported in future releases).
- * <p>
- */
-public interface Agent {
-
- /**
- * Constant for Unknown device type
- */
- public static final Object TYPE_UNKNOWN = "unknown";
-
- /**
- * Constant for telnet device type
- */
- public static final Object TYPE_TELNET = "telnet";
-
- /**
- * Constant for desktop devices
- */
- public static final Object TYPE_DESKTOP = "desktop";
-
- /**
- * Constant for handheld sized devices (Pocket-PC, Palm)
- */
- public static final Object TYPE_PDA = "pda";
-
- /**
- * Constant for Phone sized devices
- */
- public static final Object TYPE_PHONE = "phone";
-
- /**
- * Constant for windows platform
- */
- public static final String PLATFORM_WINDOWS = "windows";
-
- /**
- * Constant for linux platform
- */
- public static final String PLATFORM_LINUX = "linux";
-
- /**
- * Constant for MAC platform
- */
- public static final String PLATFORM_MAC = "mac";
-
- /**
- * Constant for plam platform
- */
- public static final String PLATFORM_PALM = "palm";
-
- /**
- * Constant for solaris platform
- */
- public static final String PLATFORM_SOLARIS = "solaris";
-
- /**
- * Constant for pocket pc platform
- */
- public static final String PLATFORM_PPC = "ppc";
-
- /**
- * Constant for Internet Explorer agent
- */
- public static final String AGENT_IE = "ie";
-
- /**
- * Constant for Gecko agent. Used for all Gecko based agents like Mozilla, Netscape 6+
- */
- public static final String AGENT_GECKO = "gecko";
-
- /**
- * Constant for Apple Webkit agent. Used for all Webkit based agent like Safari
- */
- public static final String AGENT_WEBKIT = "webkit";
-
- /**
- *
- * @return return the Type of Agent. Returns <code>TYPE_UNKNOWN</code> if not available.
- * <br>E.g. desktop, pda, phone
- *
- */
- public Object getType();
-
- /**
- *
- * @return return the canonical name of the agent (browser application).
- * Returns <code>null</code> if not available.
- * <br>E.g. gecko, ie, opera, pocketie
- */
- public String getAgentName();
-
- /**
- *
- * @return return the version number of the agent (browser application).
- * Return <code>null</code> if not available.
- */
- public String getAgentVersion();
-
- /**
- *
- * @return return the canonical name for the platform. Returns <code>null</code> if not available.
- * <br>E.g ppc, series60, windows, mac, linux, solaris
- */
- public String getPlatformName();
-
-
- /**
- *
- * @return return the version number for the platform.
- * Returns <code>null</code> if not available.
- */
- public String getPlatformVersion();
-
-
- /**
- *
- * @return return a canonical name for the Hardware make and Model. Re
- * turns <code>null</code> if not available.
- * <br>E.g nokia6600, sonyericssonP900, nokai3650i
- */
- public String getHardwareMakeModel();
-
-
- /**
- * @return Map of capability names and their values for the current client request.
- * <br>Some of the available capability names are:
- * <br><i>height</i>- provides the screen height in pixels of the Agent as an Integer.
- * <br><i>width</i>- provides the screen width in pixels of the Agent as an Integer.
- * <br><i>dom</i>- provides the DOM API support of the agent as a String.
- * Possible values are: <i>level2</i>, <i>level1</i>, <i>form</i>, and <i>none</i>.
- * <br><i>frames</i>- returns a Boolean value signifying whether or not the Agent
- * supports frames.
- * <br><i>accessKeys</i>- returns a Boolean value signifying whether or not the Agent
- * supports accessKeys.
- */
- public Map getCapabilities ();
+package org.apache.myfaces.adf.context;
+
+import java.util.Map;
+
+/**
+ * The Agent interface describes the client that is making the request that will display
+ * the rendered output.
+ * <p>
+ * Implementations that provide the set of capabilities must clearly define the names
+ * of these capabilities and their values.
+ * </p>
+ * <p>
+ * Capability names that are implementation private must be defined so using appropriate
+ * naming schemes. ADF private capability names are prefixed using "-adfinternal-xxx",
+ * and such capability names (and their values) may change at anytime
+ * (and not guaranteed to be supported in future releases).
+ * <p>
+ */
+public interface Agent {
+
+ /**
+ * Constant for Unknown device type
+ */
+ public static final Object TYPE_UNKNOWN = "unknown";
+
+ /**
+ * Constant for telnet device type
+ */
+ public static final Object TYPE_TELNET = "telnet";
+
+ /**
+ * Constant for desktop devices
+ */
+ public static final Object TYPE_DESKTOP = "desktop";
+
+ /**
+ * Constant for handheld sized devices (Pocket-PC, Palm)
+ */
+ public static final Object TYPE_PDA = "pda";
+
+ /**
+ * Constant for Phone sized devices
+ */
+ public static final Object TYPE_PHONE = "phone";
+
+ /**
+ * Constant for windows platform
+ */
+ public static final String PLATFORM_WINDOWS = "windows";
+
+ /**
+ * Constant for linux platform
+ */
+ public static final String PLATFORM_LINUX = "linux";
+
+ /**
+ * Constant for MAC platform
+ */
+ public static final String PLATFORM_MAC = "mac";
+
+ /**
+ * Constant for plam platform
+ */
+ public static final String PLATFORM_PALM = "palm";
+
+ /**
+ * Constant for solaris platform
+ */
+ public static final String PLATFORM_SOLARIS = "solaris";
+
+ /**
+ * Constant for pocket pc platform
+ */
+ public static final String PLATFORM_PPC = "ppc";
+
+ /**
+ * Constant for Internet Explorer agent
+ */
+ public static final String AGENT_IE = "ie";
+
+ /**
+ * Constant for Gecko agent. Used for all Gecko based agents like Mozilla, Netscape 6+
+ */
+ public static final String AGENT_GECKO = "gecko";
+
+ /**
+ * Constant for Apple Webkit agent. Used for all Webkit based agent like Safari
+ */
+ public static final String AGENT_WEBKIT = "webkit";
+
+ /**
+ *
+ * @return return the Type of Agent. Returns <code>TYPE_UNKNOWN</code> if not available.
+ * <br>E.g. desktop, pda, phone
+ *
+ */
+ public Object getType();
+
+ /**
+ *
+ * @return return the canonical name of the agent (browser application).
+ * Returns <code>null</code> if not available.
+ * <br>E.g. gecko, ie, opera, pocketie
+ */
+ public String getAgentName();
+
+ /**
+ *
+ * @return return the version number of the agent (browser application).
+ * Return <code>null</code> if not available.
+ */
+ public String getAgentVersion();
+
+ /**
+ *
+ * @return return the canonical name for the platform. Returns <code>null</code> if not available.
+ * <br>E.g ppc, series60, windows, mac, linux, solaris
+ */
+ public String getPlatformName();
+
+
+ /**
+ *
+ * @return return the version number for the platform.
+ * Returns <code>null</code> if not available.
+ */
+ public String getPlatformVersion();
+
+
+ /**
+ *
+ * @return return a canonical name for the Hardware make and Model. Re
+ * turns <code>null</code> if not available.
+ * <br>E.g nokia6600, sonyericssonP900, nokai3650i
+ */
+ public String getHardwareMakeModel();
+
+
+ /**
+ * @return Map of capability names and their values for the current client request.
+ * <br>Some of the available capability names are:
+ * <br><i>height</i>- provides the screen height in pixels of the Agent as an Integer.
+ * <br><i>width</i>- provides the screen width in pixels of the Agent as an Integer.
+ * <br><i>dom</i>- provides the DOM API support of the agent as a String.
+ * Possible values are: <i>level2</i>, <i>level1</i>, <i>form</i>, and <i>none</i>.
+ * <br><i>frames</i>- returns a Boolean value signifying whether or not the Agent
+ * supports frames.
+ * <br><i>accessKeys</i>- returns a Boolean value signifying whether or not the Agent
+ * supports accessKeys.
+ */
+ public Map getCapabilities ();
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/Agent.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/DialogService.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/DialogService.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/DialogService.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/DialogService.java Mon Jul 24 20:54:50 2006
@@ -1,17 +1,17 @@
-/*
- * Copyright 2004-2006 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.
+/*
+ * Copyright 2004-2006 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.adf.context;
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/context/DialogService.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/PollEvent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/PollEvent.java?rev=425268&r1=425267&r2=425268&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/PollEvent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/PollEvent.java Mon Jul 24 20:54:50 2006
@@ -1,75 +1,75 @@
-/*
- * Copyright 2004-2006 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.adf.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * Event delivered when the poll component polls the server.
- * <p>
- * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/event/PollEvent.java#0 $) $Date: 10-nov-2005.19:09:03 $
- * @author The Oracle ADF Faces Team
- */
-public class PollEvent extends FacesEvent
-{
- public PollEvent(UIComponent source)
- {
- super(source);
- }
-
- public void processListener(FacesListener listener)
- {
- ((PollListener) listener).processPoll(this);
- }
-
- public boolean isAppropriateListener(FacesListener listener)
- {
- return (listener instanceof PollListener);
- }
-
- public int hashCode()
- {
- //A simple implementation to differentiate based on component that
- // fires the event.
- return (getComponent() == null) ? 0 : getComponent().hashCode();
- }
-
- public boolean equals(
- Object o)
- {
- if (o instanceof PollEvent)
- {
- PollEvent that = (PollEvent)o;
- return (this.getComponent().equals(that.getComponent()));
- }
-
- return false;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(getClass().getName());
- sb.append("[component=");
- sb.append(getComponent());
- sb.append(']');
- return sb.toString();
- }
-
+/*
+ * Copyright 2004-2006 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.adf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * Event delivered when the poll component polls the server.
+ * <p>
+ * @version $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/event/PollEvent.java#0 $) $Date: 10-nov-2005.19:09:03 $
+ * @author The Oracle ADF Faces Team
+ */
+public class PollEvent extends FacesEvent
+{
+ public PollEvent(UIComponent source)
+ {
+ super(source);
+ }
+
+ public void processListener(FacesListener listener)
+ {
+ ((PollListener) listener).processPoll(this);
+ }
+
+ public boolean isAppropriateListener(FacesListener listener)
+ {
+ return (listener instanceof PollListener);
+ }
+
+ public int hashCode()
+ {
+ //A simple implementation to differentiate based on component that
+ // fires the event.
+ return (getComponent() == null) ? 0 : getComponent().hashCode();
+ }
+
+ public boolean equals(
+ Object o)
+ {
+ if (o instanceof PollEvent)
+ {
+ PollEvent that = (PollEvent)o;
+ return (this.getComponent().equals(that.getComponent()));
+ }
+
+ return false;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append(getClass().getName());
+ sb.append("[component=");
+ sb.append(getComponent());
+ sb.append(']');
+ return sb.toString();
+ }
+
}
Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/PollEvent.java
------------------------------------------------------------------------------
svn:eol-style = native