incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r425268 [3/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...
Date Tue, 25 Jul 2006 03:54:52 GMT
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureEvent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureEvent.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/RowDisclosureEvent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureEvent.java Mon Jul 24 20:54:50 2006
@@ -13,48 +13,48 @@
 * 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.FacesListener;
-
-import org.apache.myfaces.adf.model.RowKeySet;
-
-
-/**
- * Event that is generated when nodes are expanded or collapsed in a tree
- * component.
- * @author The Oracle ADF Faces Team
- */
-public class RowDisclosureEvent extends RowKeySetChangeEvent
-{
-  /**
-   * Creates a new ExpansionEvent
-   * @param collapsed the set of rowKeys that have just been collapsed.
-   * @param expanded the set of rowKeys that have just been expanded.
-   */
-  public RowDisclosureEvent(UIComponent source, RowKeySet collapsed, RowKeySet expanded)
-  {
-    super(source, collapsed, expanded);
-  }
-
-  /**
-   * Creates a new ExpansionEvent
-   * @param oldSet the set of rowKeys before any changes.
-   * @param newSet the set of rowKeys after any changes.
-   */
-  public RowDisclosureEvent(RowKeySet oldSet, RowKeySet newSet, UIComponent source)
-  {
-    super(oldSet, newSet, source);
-  }
-
-  public void processListener(FacesListener listener)
-  {
-    ((RowDisclosureListener) listener).processDisclosure(this);
-  }
-
-  public boolean isAppropriateListener(FacesListener listener)
-  {
-    return (listener instanceof RowDisclosureListener);
-  }  
+package org.apache.myfaces.adf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesListener;
+
+import org.apache.myfaces.adf.model.RowKeySet;
+
+
+/**
+ * Event that is generated when nodes are expanded or collapsed in a tree
+ * component.
+ * @author The Oracle ADF Faces Team
+ */
+public class RowDisclosureEvent extends RowKeySetChangeEvent
+{
+  /**
+   * Creates a new ExpansionEvent
+   * @param collapsed the set of rowKeys that have just been collapsed.
+   * @param expanded the set of rowKeys that have just been expanded.
+   */
+  public RowDisclosureEvent(UIComponent source, RowKeySet collapsed, RowKeySet expanded)
+  {
+    super(source, collapsed, expanded);
+  }
+
+  /**
+   * Creates a new ExpansionEvent
+   * @param oldSet the set of rowKeys before any changes.
+   * @param newSet the set of rowKeys after any changes.
+   */
+  public RowDisclosureEvent(RowKeySet oldSet, RowKeySet newSet, UIComponent source)
+  {
+    super(oldSet, newSet, source);
+  }
+
+  public void processListener(FacesListener listener)
+  {
+    ((RowDisclosureListener) listener).processDisclosure(this);
+  }
+
+  public boolean isAppropriateListener(FacesListener listener)
+  {
+    return (listener instanceof RowDisclosureListener);
+  }  
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureListener.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureListener.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/RowDisclosureListener.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureListener.java Mon Jul 24 20:54:50 2006
@@ -13,17 +13,17 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adf.event;
-
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesListener;
-
-/**
- * Listener for ExpansionEvents.
- * @author The Oracle ADF Faces Team
- */
-public interface RowDisclosureListener extends FacesListener
-{
-  public void processDisclosure(RowDisclosureEvent event)
-    throws AbortProcessingException;
-}
+package org.apache.myfaces.adf.event;
+
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesListener;
+
+/**
+ * Listener for ExpansionEvents.
+ * @author The Oracle ADF Faces Team
+ */
+public interface RowDisclosureListener extends FacesListener
+{
+  public void processDisclosure(RowDisclosureEvent event)
+    throws AbortProcessingException;
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowDisclosureListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowKeySetChangeEvent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowKeySetChangeEvent.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/RowKeySetChangeEvent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowKeySetChangeEvent.java Mon Jul 24 20:54:50 2006
@@ -13,96 +13,96 @@
 * 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 org.apache.myfaces.adf.model.RowKeySet;
-
-/**
- * Event that is generated when the contents of a RowKeySet changes.
- * @author The Oracle ADF Faces Team
- */
-public abstract class RowKeySetChangeEvent extends FacesEvent
-{
-  /**
-   * Creates a new Event.
-   * @param addedSet This is the Set of keys that have just been added.
-   * @param removedSet This is the Set of keys that have just been removed.
-   */
-  public RowKeySetChangeEvent(UIComponent source, 
-                              RowKeySet removedSet, 
-                              RowKeySet addedSet)
-  {
-    this(source, removedSet, addedSet, false);
-  }
-
-  /**
-   * This constructor lazily computes the difference between the 
-   * oldSet and the newSet.
-   * @param oldSet This is the Set of keys before any changes.
-   * @param newSet This is the Set of keys after any changes.
-   */
-  public RowKeySetChangeEvent(RowKeySet oldSet, 
-                              RowKeySet newSet,
-                              UIComponent source)
-  {
-    // "oldSet" is very often the actual instance-on-the-component.
-    // so make sure that we clone this object, so that subsequent mutations of
-    // the instance-on-the-component will
-    // not affect the parameters of this event: bug 4733858:
-    // we do the clone in the _diff() method:
-    this(source, oldSet, newSet, true);
-  }
-
-  private RowKeySetChangeEvent(UIComponent source,
-                               RowKeySet oldRemoved,
-                               RowKeySet newAdded, 
-                               boolean needsDiff)
-                               
-  {
-    super(source);
-    _newAdded = newAdded;
-    _oldRemoved = oldRemoved;
-    _needsDiff = needsDiff;
-  }
-
-  /**
-   * Gets the Set of keys that have just been added.
-   */
-  public RowKeySet getAddedSet()
-  {
-    _diff();
-    return _newAdded;
-  }
-
-  /**
-   * Gets the Set of keys that have just been removed.
-   */
-  public RowKeySet getRemovedSet()
-  {
-    _diff();
-    return _oldRemoved;
-  }
-  
-  private void _diff()
-  {
-    if (_needsDiff)
-    {
-      RowKeySet removed = _oldRemoved.clone();
-      removed.removeAll(_newAdded);
-      RowKeySet added = _newAdded.clone();
-      added.removeAll(_oldRemoved);
-
-      _needsDiff = false;
-      _oldRemoved = removed;
-      _newAdded = added;
-    }
-  }
-  
-  // set1 - oldSet or removed elements
-  // set2 = newSet or added elements
-  private RowKeySet _oldRemoved, _newAdded;
-  private boolean _needsDiff;
-}
+package org.apache.myfaces.adf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+
+import org.apache.myfaces.adf.model.RowKeySet;
+
+/**
+ * Event that is generated when the contents of a RowKeySet changes.
+ * @author The Oracle ADF Faces Team
+ */
+public abstract class RowKeySetChangeEvent extends FacesEvent
+{
+  /**
+   * Creates a new Event.
+   * @param addedSet This is the Set of keys that have just been added.
+   * @param removedSet This is the Set of keys that have just been removed.
+   */
+  public RowKeySetChangeEvent(UIComponent source, 
+                              RowKeySet removedSet, 
+                              RowKeySet addedSet)
+  {
+    this(source, removedSet, addedSet, false);
+  }
+
+  /**
+   * This constructor lazily computes the difference between the 
+   * oldSet and the newSet.
+   * @param oldSet This is the Set of keys before any changes.
+   * @param newSet This is the Set of keys after any changes.
+   */
+  public RowKeySetChangeEvent(RowKeySet oldSet, 
+                              RowKeySet newSet,
+                              UIComponent source)
+  {
+    // "oldSet" is very often the actual instance-on-the-component.
+    // so make sure that we clone this object, so that subsequent mutations of
+    // the instance-on-the-component will
+    // not affect the parameters of this event: bug 4733858:
+    // we do the clone in the _diff() method:
+    this(source, oldSet, newSet, true);
+  }
+
+  private RowKeySetChangeEvent(UIComponent source,
+                               RowKeySet oldRemoved,
+                               RowKeySet newAdded, 
+                               boolean needsDiff)
+                               
+  {
+    super(source);
+    _newAdded = newAdded;
+    _oldRemoved = oldRemoved;
+    _needsDiff = needsDiff;
+  }
+
+  /**
+   * Gets the Set of keys that have just been added.
+   */
+  public RowKeySet getAddedSet()
+  {
+    _diff();
+    return _newAdded;
+  }
+
+  /**
+   * Gets the Set of keys that have just been removed.
+   */
+  public RowKeySet getRemovedSet()
+  {
+    _diff();
+    return _oldRemoved;
+  }
+  
+  private void _diff()
+  {
+    if (_needsDiff)
+    {
+      RowKeySet removed = _oldRemoved.clone();
+      removed.removeAll(_newAdded);
+      RowKeySet added = _newAdded.clone();
+      added.removeAll(_oldRemoved);
+
+      _needsDiff = false;
+      _oldRemoved = removed;
+      _newAdded = added;
+    }
+  }
+  
+  // set1 - oldSet or removed elements
+  // set2 = newSet or added elements
+  private RowKeySet _oldRemoved, _newAdded;
+  private boolean _needsDiff;
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/RowKeySetChangeEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SelectionEvent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SelectionEvent.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/SelectionEvent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SelectionEvent.java Mon Jul 24 20:54:50 2006
@@ -1,57 +1,57 @@
-/*
- * 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.FacesListener;
-import org.apache.myfaces.adf.model.RowKeySet;
-
-/**
- * Event that is generated when the selection of a component changes.
- * @author The Oracle ADF Faces Team
- */
-public class SelectionEvent extends RowKeySetChangeEvent
-{
-  /**
-   * Creates a new SelectionEvent
-   * @param unselected the set of rowKeys that have just been unselected.
-   * @param selected the set of rowKeys that have just been selected.
-   */
-  public SelectionEvent(UIComponent source, RowKeySet unselected, RowKeySet selected)
-  {
-    super(source, unselected, selected);
-  }
-
-  /**
-   * Creates a new SelectionEvent
-   * @param oldSet the set of rowKeys before any changes.
-   * @param newSet the set of rowKeys after any changes.
-   */
-  public SelectionEvent(RowKeySet oldSet, RowKeySet newSet, UIComponent source)
-  {
-    super(oldSet, newSet, source);
-  }
-
-  public void processListener(FacesListener listener)
-  {
-    ((SelectionListener) listener).processSelection(this);
-  }
-
-  public boolean isAppropriateListener(FacesListener listener)
-  {
-    return (listener instanceof SelectionListener);
-  }  
+/*
+ * 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.FacesListener;
+import org.apache.myfaces.adf.model.RowKeySet;
+
+/**
+ * Event that is generated when the selection of a component changes.
+ * @author The Oracle ADF Faces Team
+ */
+public class SelectionEvent extends RowKeySetChangeEvent
+{
+  /**
+   * Creates a new SelectionEvent
+   * @param unselected the set of rowKeys that have just been unselected.
+   * @param selected the set of rowKeys that have just been selected.
+   */
+  public SelectionEvent(UIComponent source, RowKeySet unselected, RowKeySet selected)
+  {
+    super(source, unselected, selected);
+  }
+
+  /**
+   * Creates a new SelectionEvent
+   * @param oldSet the set of rowKeys before any changes.
+   * @param newSet the set of rowKeys after any changes.
+   */
+  public SelectionEvent(RowKeySet oldSet, RowKeySet newSet, UIComponent source)
+  {
+    super(oldSet, newSet, source);
+  }
+
+  public void processListener(FacesListener listener)
+  {
+    ((SelectionListener) listener).processSelection(this);
+  }
+
+  public boolean isAppropriateListener(FacesListener listener)
+  {
+    return (listener instanceof SelectionListener);
+  }  
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SelectionEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SortEvent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SortEvent.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/SortEvent.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SortEvent.java Mon Jul 24 20:54:50 2006
@@ -13,48 +13,48 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adf.event;
-
-import java.util.List;
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * The Event generated when a Collection is to be sorted.
- * @author The Oracle ADF Faces Team
- */
-public final class SortEvent extends FacesEvent
-{
-  private final List _criteria;
-
-  /**
-   * Creates a new SortEvent.
-   * @param criteria each element must be of type SortCriterion
-   * @see org.apache.myfaces.adf.model.SortCriterion
-   */
-  public SortEvent(UIComponent source, List criteria)
-  {
-    super(source);
-    _criteria = criteria;
-  }
-
-  /**
-   * Each element of this List is of type SortCriterion
-   * @see org.apache.myfaces.adf.model.SortCriterion
-   */
-  public List getSortCriteria()
-  {
-    return _criteria;
-  }
-
-  public boolean isAppropriateListener(FacesListener listener)
-  {
-    return (listener instanceof SortListener);
-  }
-
-  public void processListener(FacesListener listener)
-  {
-    ((SortListener) listener).processSort(this);
-  }
+package org.apache.myfaces.adf.event;
+
+import java.util.List;
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * The Event generated when a Collection is to be sorted.
+ * @author The Oracle ADF Faces Team
+ */
+public final class SortEvent extends FacesEvent
+{
+  private final List _criteria;
+
+  /**
+   * Creates a new SortEvent.
+   * @param criteria each element must be of type SortCriterion
+   * @see org.apache.myfaces.adf.model.SortCriterion
+   */
+  public SortEvent(UIComponent source, List criteria)
+  {
+    super(source);
+    _criteria = criteria;
+  }
+
+  /**
+   * Each element of this List is of type SortCriterion
+   * @see org.apache.myfaces.adf.model.SortCriterion
+   */
+  public List getSortCriteria()
+  {
+    return _criteria;
+  }
+
+  public boolean isAppropriateListener(FacesListener listener)
+  {
+    return (listener instanceof SortListener);
+  }
+
+  public void processListener(FacesListener listener)
+  {
+    ((SortListener) listener).processSort(this);
+  }
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/event/SortEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/logging/ADFLogRecord.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/logging/ADFLogRecord.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/logging/ADFLogRecord.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/logging/ADFLogRecord.java Mon Jul 24 20:54:50 2006
@@ -1,17 +1,17 @@
-/*
- * Copyright 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 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.logging;
 

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/logging/ADFLogRecord.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/BoundedRangeModel.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/BoundedRangeModel.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/model/BoundedRangeModel.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/BoundedRangeModel.java Mon Jul 24 20:54:50 2006
@@ -1,41 +1,41 @@
-/*
- * 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.model;
-
-/**
- * Model that represents a bounded range, 0 <- value <- maximum if value > -1 and
- * maximum > -1.  'value' or 'maximum' being -1 indicates that they are unknown.
- * This model is used by the 'progress' components.
- *
- * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/model/BoundedRangeModel.java#0 $) $Date: 10-nov-2005.19:08:49 $
- * @author The Oracle ADF Faces Team
- */
-
-public abstract class BoundedRangeModel 
-{
-  /**
-   * Gets the maximum value for this model.
-   * @return the maximum value. A return of -1 indicates that maximum is unknown.
-   */
-  public abstract long getMaximum();
-
-  /**
-   * Gets the current value for this model.
-   * @return the current value. A return of -1 indicates that value is unknown.
-   */
-  public abstract long getValue();
+/*
+ * 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.model;
+
+/**
+ * Model that represents a bounded range, 0 <- value <- maximum if value > -1 and
+ * maximum > -1.  'value' or 'maximum' being -1 indicates that they are unknown.
+ * This model is used by the 'progress' components.
+ *
+ * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/model/BoundedRangeModel.java#0 $) $Date: 10-nov-2005.19:08:49 $
+ * @author The Oracle ADF Faces Team
+ */
+
+public abstract class BoundedRangeModel 
+{
+  /**
+   * Gets the maximum value for this model.
+   * @return the maximum value. A return of -1 indicates that maximum is unknown.
+   */
+  public abstract long getMaximum();
+
+  /**
+   * Gets the current value for this model.
+   * @return the current value. A return of -1 indicates that value is unknown.
+   */
+  public abstract long getValue();
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/BoundedRangeModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ChildPropertyTreeModel.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ChildPropertyTreeModel.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/model/ChildPropertyTreeModel.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ChildPropertyTreeModel.java Mon Jul 24 20:54:50 2006
@@ -13,351 +13,351 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adf.model;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.faces.context.FacesContext;
-
-/**
- * Creates a TreeModel from a List of beans.
- * To use this class you must have a tree of beans (or Maps).
- * The structure of your tree must be a List (or array) of root beans, and each
- * bean must have a getter method (or Map property) that returns the 
- * children List. All elements of your tree must be the same type.
- * <P>
- * Suppose you have a bean called EmpBean that contains the data
- * for a particular employee. Suppose this bean has a method called
- * getDirectReports() that returns a List of EmpBeans which are the direct 
- * reports of the employee. Suppose there is a List called "founders" which
- * is the root list of EmpBeans. Now you can construct a TreeModel by calling
- * <pre>
- * TreeModel model = new ChildPropertyTreeModel(founders, "directReports");
- * </pre>
- * Bean rules will be used to find an appropriate getter method for the 
- * "directReports" property. 
- * java.util.Maps are also supported instead of beans.
- * <p>
- * Example: Given the following class:
- * <pre>
- * public class Person
- * {
- *    public Person(String name)
- *    {
- *      _name = name;
- *    }
- *    
- *    public String getName()
- *    {
- *      return _name;
- *    }
- *    
- *    public List getKids()
- *    {
- *      return _kids;
- *    }
- *    
- *    private final String _name;
- *    private final List _kids = new ArrayList();
- * }
- * </pre>
- * You can construct a tree by:
- * <pre>
- * Person john = new Person("John Smith");
- * Person kim = new Person("Kim Smith");
- * Person tom = new Person("Tom Smith");
- * Person ira = new Person("Ira Wickrememsinghe");
- * Person mallika = new Person("Mallika Wickremesinghe");
- * 
- * john.getKids().add(kim);
- * john.getKids().add(tom);
- * ira.getKids().add(mallika);
- * 
- * // create the list of root nodes:
- * List people = new ArrayList();
- * people.add(john);
- * people.add(ira);
- * </pre>
- * Now you can construct a TreeModel by:
- * <pre>
- * TreeModel model = new ChildPropertyTreeModel(people, "kids");
- * </pre>
- * @author The Oracle ADF Faces Team
- */
-public class ChildPropertyTreeModel extends TreeModel
-{
-
-  /**
-   * Creates a TreeModel
-   * @param instance The Collection of root nodes of this tree.
-   * This can be a List or array of beans (or Maps).
-   * This instance is first converted into a CollectionModel (see
-   * {@link ModelUtils#toCollectionModel}).
-   * @param childProperty This property will be used to get at the child Lists
-   * from each bean (or Map). Bean rules will be used to find a getter method
-   * that matches this property. If each node is a Map, this property will be
-   * passed in to the Map's get method to get the child List. 
-   */
-  public ChildPropertyTreeModel(Object instance, String childProperty)
-  {
-    this();
-    setChildProperty(childProperty);
-    setWrappedData(instance);
-  }
-
-  /**
-   * No-arg constructor for use with managed-beans.
-   * Must call the {@link #setChildProperty} and
-   * {@link #setWrappedData} methods after constructing this instance.
-   */
-  public ChildPropertyTreeModel()
-  {
-    Node root = new Node(null);
-    _path.add(root);
-  }
-
-  /**
-   * Gets the rowKey of the current row.
-   */
-  public Object getRowKey()
-  {
-    final int sz = _path.size() - 1;
-    Object lastRowkey = _getRowKey();
-    if ((sz == 0) && (lastRowkey == null))
-      return null;  // root collection
-    
-    // have to clone the path here. otherwise, we have to say that
-    // this tree model cannot be mutated while accessing the path
-    // returned by this method.
-    List path = new ArrayList(sz+1);
-    if (sz > 0)
-    {
-      for(int i=0; i<sz; i++)
-      {
-        Node node = _getNode(i);
-        path.add(node.childModel.getRowKey());
-      }
-    }
-    path.add(lastRowkey);
-    return path;
-  }
-
-  /**
-   * Selects a new current row. The row that matches the given rowKey
-   * is made current.
-   * @param rowKey use null to access the root collection 
-   */
-  public void setRowKey(Object rowKey)
-  {
-    Node root = _getNode(0);
-    _path.clear();
-    _path.add(root);
-    
-    List path = (List) rowKey;
-    if ((path == null) || (path.size() == 0))
-    {
-      setRowIndex(-1);
-      return;
-    }
-      
-    int lastIndex = path.size() - 1;
-    for(int i=0; i<lastIndex; i++)
-    {
-      Object pathKey = path.get(i);
-      _setRowKey(pathKey);
-      enterContainer();
-    }
-    
-    _setRowKey(path.get(lastIndex));
-  }
-
-  public Object getContainerRowKey(Object childKey)
-  {
-    List path = (List) childKey;
-    if ((path == null) || (path.size() <= 1))
-      return null;
-    return path.subList(0, path.size() - 1);
-  }
-
-  public int getRowCount()
-  {
-    return _getModel().getRowCount();
-  }
-
-  public Object getRowData()
-  {
-    return _getModel().getRowData();
-  }
-
-  public boolean isRowAvailable()
-  {
-    return _getModel().isRowAvailable();
-  }
-
-  public boolean isContainer()
-  {
-    Object rowData = getRowData();
-    Object value = getChildData(rowData);
-    return (value != null);
-  }
-
-  public void enterContainer()
-  {
-    Object rowData = getRowData();
-    if (rowData == null)
-      throw new IllegalStateException("rowData is null");
-    Node node = new Node(rowData);
-    _path.add(node);
-  }
-
-  public void exitContainer()
-  {
-    int sz = _path.size();
-    if (sz > 1)
-      _path.remove(sz - 1);
-    else
-      throw new IllegalStateException("Cannot exit the root container");
-  }
-  
-  /**
-   * Gets the instance being wrapped by this TreeModel.
-   */
-  public Object getWrappedData()
-  {
-    return _wrappedData;
-  }
-
-  /**
-   * Sets the instance being wrapped by this TreeModel.
-   * Calling this method sets the path to empty.
-   */
-  public void setWrappedData(Object data)
-  {
-    Node root = _getNode(0);
-    root.childModel = ModelUtils.toCollectionModel(data);
-    setRowKey(null);
-    _wrappedData = data;
-  }
-
-  /**
-   * Gets the property name used to fetch the children.
-   */
-  public final String getChildProperty()
-  {
-    return _childProperty;
-  }
-
-  /**
-   * Sets the property name used to fetch the children.
-   */
-  public final void setChildProperty(String childProperty)
-  {
-    _childProperty = childProperty;
-  }
-
-  public int getRowIndex()
-  {
-    return _getModel().getRowIndex();
-  }
-
-  public void setRowIndex(int rowIndex)
-  {
-    _getModel().setRowIndex(rowIndex);
-  }
-
-  public boolean isSortable(String property)
-  {
-    return _getModel().isSortable(property);
-  }
-
-  public List getSortCriteria()
-  {
-    return _getModel().getSortCriteria();
-  }
-
-  public void setSortCriteria(List criteria)
-  {
-    _getModel().setSortCriteria(criteria);
-  }
-
-  /**
-   * Gets the child data for a node. This child data will be
-   * converted into a CollectionModel by calling
-   * {@link #createChildModel}.
-   * @param parentData the node to get the child data from
-   * @return the List or array that is the child data.
-   * must return null for a leaf node.
-   */
-  protected Object getChildData(Object parentData)
-  {
-    String prop = getChildProperty();
-    if (prop == null)
-      return null;
-    
-    FacesContext context = FacesContext.getCurrentInstance();
-    return 
-      context.getApplication().getPropertyResolver().getValue(parentData, prop);
-  }
-
-  /**
-   * Converts childData into a CollectionModel.
-   * This method calls {@link ModelUtils#toCollectionModel}
-   * @param childData the data to convert. This can be a List or array.
-   */
-  protected CollectionModel createChildModel(Object childData)
-  {
-    CollectionModel model = ModelUtils.toCollectionModel(childData);
-    model.setRowIndex(-1);
-    return model;
-  }
-
-  private Object _getRowKey()
-  {
-    return _getModel().getRowKey();
-  }
-
-  private void _setRowKey(Object key)
-  {
-    _getModel().setRowKey(key);
-  }
-  
-  private Node _getCurrentNode()
-  {
-    return _getNode(_path.size() - 1);
-  }
-
-  private Node _getNode(int index)
-  {
-    Node node = (Node) _path.get(index);
-    return node;    
-  }
-
-  private CollectionModel _getModel()
-  {
-    Node node = _getCurrentNode();
-    CollectionModel model = node.childModel;
-  
-    if (model == null)
-    {
-      Object value = getChildData(node.parentData);
-      model = createChildModel(value);
-      node.childModel = model;
-    }
-    return model;
-  }
-  
-  private static final class Node
-  {
-    public final Object parentData;
-    public CollectionModel childModel = null;
-
-    public Node(Object parentData)
-    {
-      this.parentData = parentData;
-    }
-  }
-
-  private final List _path = new ArrayList(5);
-  private String _childProperty = null;
-  private Object _wrappedData = null;
-}
+package org.apache.myfaces.adf.model;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Creates a TreeModel from a List of beans.
+ * To use this class you must have a tree of beans (or Maps).
+ * The structure of your tree must be a List (or array) of root beans, and each
+ * bean must have a getter method (or Map property) that returns the 
+ * children List. All elements of your tree must be the same type.
+ * <P>
+ * Suppose you have a bean called EmpBean that contains the data
+ * for a particular employee. Suppose this bean has a method called
+ * getDirectReports() that returns a List of EmpBeans which are the direct 
+ * reports of the employee. Suppose there is a List called "founders" which
+ * is the root list of EmpBeans. Now you can construct a TreeModel by calling
+ * <pre>
+ * TreeModel model = new ChildPropertyTreeModel(founders, "directReports");
+ * </pre>
+ * Bean rules will be used to find an appropriate getter method for the 
+ * "directReports" property. 
+ * java.util.Maps are also supported instead of beans.
+ * <p>
+ * Example: Given the following class:
+ * <pre>
+ * public class Person
+ * {
+ *    public Person(String name)
+ *    {
+ *      _name = name;
+ *    }
+ *    
+ *    public String getName()
+ *    {
+ *      return _name;
+ *    }
+ *    
+ *    public List getKids()
+ *    {
+ *      return _kids;
+ *    }
+ *    
+ *    private final String _name;
+ *    private final List _kids = new ArrayList();
+ * }
+ * </pre>
+ * You can construct a tree by:
+ * <pre>
+ * Person john = new Person("John Smith");
+ * Person kim = new Person("Kim Smith");
+ * Person tom = new Person("Tom Smith");
+ * Person ira = new Person("Ira Wickrememsinghe");
+ * Person mallika = new Person("Mallika Wickremesinghe");
+ * 
+ * john.getKids().add(kim);
+ * john.getKids().add(tom);
+ * ira.getKids().add(mallika);
+ * 
+ * // create the list of root nodes:
+ * List people = new ArrayList();
+ * people.add(john);
+ * people.add(ira);
+ * </pre>
+ * Now you can construct a TreeModel by:
+ * <pre>
+ * TreeModel model = new ChildPropertyTreeModel(people, "kids");
+ * </pre>
+ * @author The Oracle ADF Faces Team
+ */
+public class ChildPropertyTreeModel extends TreeModel
+{
+
+  /**
+   * Creates a TreeModel
+   * @param instance The Collection of root nodes of this tree.
+   * This can be a List or array of beans (or Maps).
+   * This instance is first converted into a CollectionModel (see
+   * {@link ModelUtils#toCollectionModel}).
+   * @param childProperty This property will be used to get at the child Lists
+   * from each bean (or Map). Bean rules will be used to find a getter method
+   * that matches this property. If each node is a Map, this property will be
+   * passed in to the Map's get method to get the child List. 
+   */
+  public ChildPropertyTreeModel(Object instance, String childProperty)
+  {
+    this();
+    setChildProperty(childProperty);
+    setWrappedData(instance);
+  }
+
+  /**
+   * No-arg constructor for use with managed-beans.
+   * Must call the {@link #setChildProperty} and
+   * {@link #setWrappedData} methods after constructing this instance.
+   */
+  public ChildPropertyTreeModel()
+  {
+    Node root = new Node(null);
+    _path.add(root);
+  }
+
+  /**
+   * Gets the rowKey of the current row.
+   */
+  public Object getRowKey()
+  {
+    final int sz = _path.size() - 1;
+    Object lastRowkey = _getRowKey();
+    if ((sz == 0) && (lastRowkey == null))
+      return null;  // root collection
+    
+    // have to clone the path here. otherwise, we have to say that
+    // this tree model cannot be mutated while accessing the path
+    // returned by this method.
+    List path = new ArrayList(sz+1);
+    if (sz > 0)
+    {
+      for(int i=0; i<sz; i++)
+      {
+        Node node = _getNode(i);
+        path.add(node.childModel.getRowKey());
+      }
+    }
+    path.add(lastRowkey);
+    return path;
+  }
+
+  /**
+   * Selects a new current row. The row that matches the given rowKey
+   * is made current.
+   * @param rowKey use null to access the root collection 
+   */
+  public void setRowKey(Object rowKey)
+  {
+    Node root = _getNode(0);
+    _path.clear();
+    _path.add(root);
+    
+    List path = (List) rowKey;
+    if ((path == null) || (path.size() == 0))
+    {
+      setRowIndex(-1);
+      return;
+    }
+      
+    int lastIndex = path.size() - 1;
+    for(int i=0; i<lastIndex; i++)
+    {
+      Object pathKey = path.get(i);
+      _setRowKey(pathKey);
+      enterContainer();
+    }
+    
+    _setRowKey(path.get(lastIndex));
+  }
+
+  public Object getContainerRowKey(Object childKey)
+  {
+    List path = (List) childKey;
+    if ((path == null) || (path.size() <= 1))
+      return null;
+    return path.subList(0, path.size() - 1);
+  }
+
+  public int getRowCount()
+  {
+    return _getModel().getRowCount();
+  }
+
+  public Object getRowData()
+  {
+    return _getModel().getRowData();
+  }
+
+  public boolean isRowAvailable()
+  {
+    return _getModel().isRowAvailable();
+  }
+
+  public boolean isContainer()
+  {
+    Object rowData = getRowData();
+    Object value = getChildData(rowData);
+    return (value != null);
+  }
+
+  public void enterContainer()
+  {
+    Object rowData = getRowData();
+    if (rowData == null)
+      throw new IllegalStateException("rowData is null");
+    Node node = new Node(rowData);
+    _path.add(node);
+  }
+
+  public void exitContainer()
+  {
+    int sz = _path.size();
+    if (sz > 1)
+      _path.remove(sz - 1);
+    else
+      throw new IllegalStateException("Cannot exit the root container");
+  }
+  
+  /**
+   * Gets the instance being wrapped by this TreeModel.
+   */
+  public Object getWrappedData()
+  {
+    return _wrappedData;
+  }
+
+  /**
+   * Sets the instance being wrapped by this TreeModel.
+   * Calling this method sets the path to empty.
+   */
+  public void setWrappedData(Object data)
+  {
+    Node root = _getNode(0);
+    root.childModel = ModelUtils.toCollectionModel(data);
+    setRowKey(null);
+    _wrappedData = data;
+  }
+
+  /**
+   * Gets the property name used to fetch the children.
+   */
+  public final String getChildProperty()
+  {
+    return _childProperty;
+  }
+
+  /**
+   * Sets the property name used to fetch the children.
+   */
+  public final void setChildProperty(String childProperty)
+  {
+    _childProperty = childProperty;
+  }
+
+  public int getRowIndex()
+  {
+    return _getModel().getRowIndex();
+  }
+
+  public void setRowIndex(int rowIndex)
+  {
+    _getModel().setRowIndex(rowIndex);
+  }
+
+  public boolean isSortable(String property)
+  {
+    return _getModel().isSortable(property);
+  }
+
+  public List getSortCriteria()
+  {
+    return _getModel().getSortCriteria();
+  }
+
+  public void setSortCriteria(List criteria)
+  {
+    _getModel().setSortCriteria(criteria);
+  }
+
+  /**
+   * Gets the child data for a node. This child data will be
+   * converted into a CollectionModel by calling
+   * {@link #createChildModel}.
+   * @param parentData the node to get the child data from
+   * @return the List or array that is the child data.
+   * must return null for a leaf node.
+   */
+  protected Object getChildData(Object parentData)
+  {
+    String prop = getChildProperty();
+    if (prop == null)
+      return null;
+    
+    FacesContext context = FacesContext.getCurrentInstance();
+    return 
+      context.getApplication().getPropertyResolver().getValue(parentData, prop);
+  }
+
+  /**
+   * Converts childData into a CollectionModel.
+   * This method calls {@link ModelUtils#toCollectionModel}
+   * @param childData the data to convert. This can be a List or array.
+   */
+  protected CollectionModel createChildModel(Object childData)
+  {
+    CollectionModel model = ModelUtils.toCollectionModel(childData);
+    model.setRowIndex(-1);
+    return model;
+  }
+
+  private Object _getRowKey()
+  {
+    return _getModel().getRowKey();
+  }
+
+  private void _setRowKey(Object key)
+  {
+    _getModel().setRowKey(key);
+  }
+  
+  private Node _getCurrentNode()
+  {
+    return _getNode(_path.size() - 1);
+  }
+
+  private Node _getNode(int index)
+  {
+    Node node = (Node) _path.get(index);
+    return node;    
+  }
+
+  private CollectionModel _getModel()
+  {
+    Node node = _getCurrentNode();
+    CollectionModel model = node.childModel;
+  
+    if (model == null)
+    {
+      Object value = getChildData(node.parentData);
+      model = createChildModel(value);
+      node.childModel = model;
+    }
+    return model;
+  }
+  
+  private static final class Node
+  {
+    public final Object parentData;
+    public CollectionModel childModel = null;
+
+    public Node(Object parentData)
+    {
+      this.parentData = parentData;
+    }
+  }
+
+  private final List _path = new ArrayList(5);
+  private String _childProperty = null;
+  private Object _wrappedData = null;
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ChildPropertyTreeModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/CollectionModel.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/CollectionModel.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/model/CollectionModel.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/CollectionModel.java Mon Jul 24 20:54:50 2006
@@ -1,130 +1,130 @@
-/*
- * 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.model;
-import java.util.Collections;
-import java.util.List;
-import javax.faces.model.DataModel;
-
-/**
- * The data model that is used by ADF Table components.
- * This extends the faces DataModel class and adds on support for
- * rowKeys and sorting.
- * @author The Oracle ADF Faces Team
- */
-public abstract class CollectionModel extends DataModel
-  implements RowKeyIndex
-{
-
-  /**
-   * Gets the rowKey of the current row.
-   * rowKeys are safer to use than row indices because rowKeys are
-   * unaffected by mutations to this collection.
-   * rowKeys should have efficient implementations of 
-   * {@link Object#equals} and {@link Object#hashCode} as they will be used
-   * as keys in hashtables. rowKeys should also be Serializable, so that the
-   * application can run under all JSF state-saving schemes.
-   * @return this key should be Serializable and immutable.
-   * @see #setRowKey
-   */
-  public abstract Object getRowKey();
-
-  /**
-   * Finds the row with the matching key and makes it current
-   * @param key the rowKey, previously obtained from {@link #getRowKey}.
-   */
-  public abstract void setRowKey(Object key);
-
-  
-  /**
-   * Checks to see if the row at the given index is available.
-   * This method makes the given row current and calls
-   * {@link #isRowAvailable()}.
-   * Finally, the row that was current before this method was called
-   * is made current again.
-   * @param rowIndex the index of the row to check.
-   * @return true if data for the row exists.
-   */
-  public boolean isRowAvailable(int rowIndex)
-  {
-    int oldIndex = getRowIndex();
-    try
-    {
-      setRowIndex(rowIndex);
-      return isRowAvailable();
-    }
-    finally
-    {
-      setRowIndex(oldIndex);
-    }
-  }
-
-  /**
-   * Gets the rowData at the given index.
-   * This method makes the given row current and calls
-   * {@link #getRowData()}.
-   * Finally, the row that was current before this method was called
-   * is made current again.
-   * @param rowIndex the index of the row to get data from.
-   * @return the data for the given row.
-   */
-  public Object getRowData(int rowIndex)
-  {
-    int oldIndex = getRowIndex();
-    try
-    {
-      setRowIndex(rowIndex);
-      return getRowData();
-    }
-    finally
-    {
-      setRowIndex(oldIndex);
-    }
-  }
-
-  /**
-   * Return true if this collection is sortable by the given property.
-   * This implementation always returns false;
-   */
-  public boolean isSortable(String property)
-  {
-    return false;
-  }
-
-  /**
-   * Gets the criteria that this collection is sorted by.
-   * This method should never return null.
-   * This implementation always returns an empty List.
-   * @return each element in this List is of type SortCriterion. 
-   * An empty list is returned if this collection is not sorted.
-   * @see SortCriterion
-   */
-  public List getSortCriteria()
-  {
-    return Collections.EMPTY_LIST;
-  }
-
-  /**
-   * Sorts this collection by the given criteria.
-   * @param criteria Each element in this List must be of type SortCriterion.
-   * The empty list may be used to cancel any sort order. null should be treated
-   * the same as an empty list.
-   * @see SortCriterion
-   */
-  public void setSortCriteria(List criteria)
-  {
-  }
-
+/*
+ * 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.model;
+import java.util.Collections;
+import java.util.List;
+import javax.faces.model.DataModel;
+
+/**
+ * The data model that is used by ADF Table components.
+ * This extends the faces DataModel class and adds on support for
+ * rowKeys and sorting.
+ * @author The Oracle ADF Faces Team
+ */
+public abstract class CollectionModel extends DataModel
+  implements RowKeyIndex
+{
+
+  /**
+   * Gets the rowKey of the current row.
+   * rowKeys are safer to use than row indices because rowKeys are
+   * unaffected by mutations to this collection.
+   * rowKeys should have efficient implementations of 
+   * {@link Object#equals} and {@link Object#hashCode} as they will be used
+   * as keys in hashtables. rowKeys should also be Serializable, so that the
+   * application can run under all JSF state-saving schemes.
+   * @return this key should be Serializable and immutable.
+   * @see #setRowKey
+   */
+  public abstract Object getRowKey();
+
+  /**
+   * Finds the row with the matching key and makes it current
+   * @param key the rowKey, previously obtained from {@link #getRowKey}.
+   */
+  public abstract void setRowKey(Object key);
+
+  
+  /**
+   * Checks to see if the row at the given index is available.
+   * This method makes the given row current and calls
+   * {@link #isRowAvailable()}.
+   * Finally, the row that was current before this method was called
+   * is made current again.
+   * @param rowIndex the index of the row to check.
+   * @return true if data for the row exists.
+   */
+  public boolean isRowAvailable(int rowIndex)
+  {
+    int oldIndex = getRowIndex();
+    try
+    {
+      setRowIndex(rowIndex);
+      return isRowAvailable();
+    }
+    finally
+    {
+      setRowIndex(oldIndex);
+    }
+  }
+
+  /**
+   * Gets the rowData at the given index.
+   * This method makes the given row current and calls
+   * {@link #getRowData()}.
+   * Finally, the row that was current before this method was called
+   * is made current again.
+   * @param rowIndex the index of the row to get data from.
+   * @return the data for the given row.
+   */
+  public Object getRowData(int rowIndex)
+  {
+    int oldIndex = getRowIndex();
+    try
+    {
+      setRowIndex(rowIndex);
+      return getRowData();
+    }
+    finally
+    {
+      setRowIndex(oldIndex);
+    }
+  }
+
+  /**
+   * Return true if this collection is sortable by the given property.
+   * This implementation always returns false;
+   */
+  public boolean isSortable(String property)
+  {
+    return false;
+  }
+
+  /**
+   * Gets the criteria that this collection is sorted by.
+   * This method should never return null.
+   * This implementation always returns an empty List.
+   * @return each element in this List is of type SortCriterion. 
+   * An empty list is returned if this collection is not sorted.
+   * @see SortCriterion
+   */
+  public List getSortCriteria()
+  {
+    return Collections.EMPTY_LIST;
+  }
+
+  /**
+   * Sorts this collection by the given criteria.
+   * @param criteria Each element in this List must be of type SortCriterion.
+   * The empty list may be used to cancel any sort order. null should be treated
+   * the same as an empty list.
+   * @see SortCriterion
+   */
+  public void setSortCriteria(List criteria)
+  {
+  }
+
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/CollectionModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/PathHelper.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/PathHelper.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/model/PathHelper.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/PathHelper.java Mon Jul 24 20:54:50 2006
@@ -13,185 +13,185 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adf.model;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author The Oracle ADF Faces Team
- */
-class PathHelper 
-{
-  protected PathHelper()
-  {
-  }
-  
-  /**
-   * Sets the current rowKey.
-   * @param rowKey
-   */
-  public final void setRowKey(String rowKey)
-  {
-    _rowKey = rowKey;
-  }
-  
-  /**
-   * @return the current row key
-   */
-  public final String getRowKey()
-  {
-    return _rowKey;
-  }
-  
-  /**
-   * @return the current size of the path
-   */
-  public final int getPathSize()
-  {
-    return _path.size();
-  }
-  
-  /**
-   * Gets the current path.
-   * @return a List, with each element a rowKey String
-   */
-  public final List getPath()
-  {
-    int sz = _path.size();
-    List path = new ArrayList(sz+1);
-    if (sz > 0)
-    {
-      for(int i=0; i<sz; i++)
-      {
-        path.add(getPath(i));
-      }
-    }
-    path.add(getRowKey());
-    return path;
-  }
-
-  /**
-   * Gets a rowKey at the specified location in the path.
-   * @param index
-   * @return the rowKey String
-   */
-  public final String getPath(int index)
-  {
-    return _getPathElement(index).rowKey;
-  }
-  
-  /**
-   * Sets the path.
-   * @param path a List with each element a rowKey String
-   */
-  public final void setPath(List path)
-  {
-    int sz = (path==null) ? 0 : path.size();
-
-    if (sz > 0)
-    {
-      _path = new ArrayList(sz);
-      int lastIndex = sz - 1;
-  
-      for(int i=0; i<lastIndex; i++)
-      {
-        setRowKey(path.get(i).toString());
-        pushPath();
-      }
-      setRowKey((String) path.get(lastIndex));
-    }
-    else
-    {
-      _path = Collections.EMPTY_LIST;
-      setRowKey(null);
-    }
-  }
-
-  /**
-   * Gets the path data at the specified index.
-   * @param index
-   * @return this is the path data that was set using 
-   * {@link #pushPath(Object,String)}
-   */
-  protected final Object getPathData(int index)
-  {
-    return _getPathElement(index).node;
-  }
-
-  /**
-   * @return the path data for the last element in the path.
-   */
-  protected Object getLastPathData()
-  {
-    int sz = getPathSize();
-    return (sz > 0) ? getPathData(sz - 1) : null;
-  }
-  
-  /**
-   * Pushes the current rowKey onto the path.
-   */
-  public final void pushPath()
-  {
-    if (_rowKey == null)
-      throw new IllegalStateException("rowKey");
-  
-    Object parentData = getLastPathData();
-    Object data = pushPath(parentData, _rowKey);
-
-    if (_path == Collections.EMPTY_LIST)
-      _path = new ArrayList(5);
-
-    _path.add(new PathHelper.PathElement(_rowKey, data));
-    
-    _rowKey = null;
-  }
-  
-  /**
-   * Gets the path data to use for a new path segment.
-   * @param parentData the path data of the previous path segment
-   * @param rowKey the path segment that is just about to be added.
-   * @return new path data, which can be retrieved using
-   * {@link #getPathData(int)}
-   */
-  protected Object pushPath(Object parentData, String rowKey)
-  {
-    return null;
-  }
-  
-  /**
-   * Removes the last rowKey from the end of this path.
-   * The current rowKey is set to be this last rowKey.
-   */
-  public final void popPath()
-  {
-    int sz = _path.size();
-    if (sz > 0)
-    {
-      PathHelper.PathElement lastPath = (PathElement) _path.remove(sz-1);
-      _rowKey = lastPath.rowKey;
-    }
-    else
-      throw new IllegalStateException("No Path element to pop");
-  }
-
-  private PathHelper.PathElement _getPathElement(int index)
-  {
-    return (PathElement) _path.get(index);
-  }
-  
-  private String _rowKey = null;
-  private List _path = Collections.EMPTY_LIST;
-  
-  private static final class PathElement
-  {
-    public final Object node;
-    public final String rowKey;
-    
-    public PathElement(String rowKey, Object data)
-    {
-      this.rowKey = rowKey;
-      this.node = data;
-    }
-  }
-}
+package org.apache.myfaces.adf.model;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author The Oracle ADF Faces Team
+ */
+class PathHelper 
+{
+  protected PathHelper()
+  {
+  }
+  
+  /**
+   * Sets the current rowKey.
+   * @param rowKey
+   */
+  public final void setRowKey(String rowKey)
+  {
+    _rowKey = rowKey;
+  }
+  
+  /**
+   * @return the current row key
+   */
+  public final String getRowKey()
+  {
+    return _rowKey;
+  }
+  
+  /**
+   * @return the current size of the path
+   */
+  public final int getPathSize()
+  {
+    return _path.size();
+  }
+  
+  /**
+   * Gets the current path.
+   * @return a List, with each element a rowKey String
+   */
+  public final List getPath()
+  {
+    int sz = _path.size();
+    List path = new ArrayList(sz+1);
+    if (sz > 0)
+    {
+      for(int i=0; i<sz; i++)
+      {
+        path.add(getPath(i));
+      }
+    }
+    path.add(getRowKey());
+    return path;
+  }
+
+  /**
+   * Gets a rowKey at the specified location in the path.
+   * @param index
+   * @return the rowKey String
+   */
+  public final String getPath(int index)
+  {
+    return _getPathElement(index).rowKey;
+  }
+  
+  /**
+   * Sets the path.
+   * @param path a List with each element a rowKey String
+   */
+  public final void setPath(List path)
+  {
+    int sz = (path==null) ? 0 : path.size();
+
+    if (sz > 0)
+    {
+      _path = new ArrayList(sz);
+      int lastIndex = sz - 1;
+  
+      for(int i=0; i<lastIndex; i++)
+      {
+        setRowKey(path.get(i).toString());
+        pushPath();
+      }
+      setRowKey((String) path.get(lastIndex));
+    }
+    else
+    {
+      _path = Collections.EMPTY_LIST;
+      setRowKey(null);
+    }
+  }
+
+  /**
+   * Gets the path data at the specified index.
+   * @param index
+   * @return this is the path data that was set using 
+   * {@link #pushPath(Object,String)}
+   */
+  protected final Object getPathData(int index)
+  {
+    return _getPathElement(index).node;
+  }
+
+  /**
+   * @return the path data for the last element in the path.
+   */
+  protected Object getLastPathData()
+  {
+    int sz = getPathSize();
+    return (sz > 0) ? getPathData(sz - 1) : null;
+  }
+  
+  /**
+   * Pushes the current rowKey onto the path.
+   */
+  public final void pushPath()
+  {
+    if (_rowKey == null)
+      throw new IllegalStateException("rowKey");
+  
+    Object parentData = getLastPathData();
+    Object data = pushPath(parentData, _rowKey);
+
+    if (_path == Collections.EMPTY_LIST)
+      _path = new ArrayList(5);
+
+    _path.add(new PathHelper.PathElement(_rowKey, data));
+    
+    _rowKey = null;
+  }
+  
+  /**
+   * Gets the path data to use for a new path segment.
+   * @param parentData the path data of the previous path segment
+   * @param rowKey the path segment that is just about to be added.
+   * @return new path data, which can be retrieved using
+   * {@link #getPathData(int)}
+   */
+  protected Object pushPath(Object parentData, String rowKey)
+  {
+    return null;
+  }
+  
+  /**
+   * Removes the last rowKey from the end of this path.
+   * The current rowKey is set to be this last rowKey.
+   */
+  public final void popPath()
+  {
+    int sz = _path.size();
+    if (sz > 0)
+    {
+      PathHelper.PathElement lastPath = (PathElement) _path.remove(sz-1);
+      _rowKey = lastPath.rowKey;
+    }
+    else
+      throw new IllegalStateException("No Path element to pop");
+  }
+
+  private PathHelper.PathElement _getPathElement(int index)
+  {
+    return (PathElement) _path.get(index);
+  }
+  
+  private String _rowKey = null;
+  private List _path = Collections.EMPTY_LIST;
+  
+  private static final class PathElement
+  {
+    public final Object node;
+    public final String rowKey;
+    
+    public PathElement(String rowKey, Object data)
+    {
+      this.rowKey = rowKey;
+      this.node = data;
+    }
+  }
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/PathHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ProcessMenuModel.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ProcessMenuModel.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/model/ProcessMenuModel.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ProcessMenuModel.java Mon Jul 24 20:54:50 2006
@@ -13,208 +13,208 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adf.model;
-
-import java.beans.IntrospectionException;
-
-
- /**
-  *
-  *
-  *  <p>
-  *         There are two common scenarios for processes,
-  *         "Plus One" and "Max Visited" which are explained below.
-  *           <ul>
-  *             <li>"Plus One" - from the current step the user can
-  *             navigate to any previous page and the next page.
-  *             If the user is on the 5th step of a process
-  *             and goes back to step 2, then the user can only
-  *             navigate from step 2 to step 1 and step 3.
-  *             </li>
-  *             <li>"Max Visited" - the user can navigate to the max
-  *             visited page. If the user is currently on the max
-  *             visited page then the user can also navigate to
-  *             the next page. If the user is on the 5th step of a
-  *             process and goes back to step 2, then the user can
-  *             navigate from step 2 to steps 1, 2, 3, 4, and 5.
-  *             </li>
-  *           </ul>
-  *
-  *           </p>
-  *           <p>
-  *           A node in a process should be readOnly
-  *           if that step of the process is not reachable from the current
-  *           step. The {@link #isReadOnly} method can be used to
-  *           bind the node's readOnly attribute.
-  *           </p>
-  *           <p>
-  *           A node in a process should be immediate if the values
-  *           in the current step don't need to be validated.
-  *           The {@link #isImmediate} method can be used to
-  *           bind the node's immediate attribute.
-  *           </p>
-  *           <p>
-  *
-  *
-  *
-  * @see ProcessUtils
-  *
-  */
-public class ProcessMenuModel extends ViewIdPropertyMenuModel
-{
-
-  /**
-   * No-arg constructor for use with managed-beans.
-   * Must call the {@link #setViewIdProperty} and
-   * {@link #setWrappedData} methods after constructing this instance.
-   */
-  public ProcessMenuModel()
-  {
-    super();
-  }
-
-  /**
-   *
-   * The "Plus One" behavior will be used with this constructor.
-   *
-   * @param instance a treeModel. This object will be passed to
-   * {@link ModelUtils#toTreeModel}
-   * @param viewIdProperty the property to use to retrieve a viewId
-   * from a node in the tree
-   * @throws IntrospectionException
-   */
-  public ProcessMenuModel(
-    Object instance,
-    String viewIdProperty
-  )throws IntrospectionException
-  {
-    super(instance, viewIdProperty);
-  }
-
-
-  /**
-   *
-   * @param instance a treeModel. This object will be passed to
-   * {@link ModelUtils#toTreeModel}
-   * @param viewIdProperty the property to use to retrieve a viewId
-   * from a node in the tree
-   * @param maxPathKey if the "Max Visited" behavior is desired, this
-   * is the key that will be used to get and set the maxPath value
-   * on the session and request. For the "Plus One" behavior pass in null.
-   * @throws IntrospectionException
-   */
-  public ProcessMenuModel(
-    Object instance,
-    String viewIdProperty,
-    Object maxPathKey
-  )throws IntrospectionException
-  {
-    super(instance, viewIdProperty);
-    setMaxPathKey(maxPathKey);
-  }
-
- /**
-  *           <p>
-  *           A node in a process should be immediate if the values
-  *           in the current step don't need to be validated.
-  *           This method can be used to
-  *           bind the node's immediate attribute. If a user will have to
-  *           return to the current page then immediate can be set to true.
-  *           For example in a "Plus One" process, if the user is on step 5
-  *           and goes back to step 2, the user will have to come back
-  *           to step 5 again, so the fields on page 5 don't need to
-  *           be validated when going back to steps 1,2,3,4, but should be
-  *           validated when going to step 6.
-  *           </p>
-  *           <p>
-  *
-  *
-  *           <ul>
-  *             <li>"Plus One"
-  *               <ul>
-  *                 <li>immediate - immediate will be true for any previous step,
-  *                                 and false otherwise.</li>
-  *               </ul>
-  *             </li>
-  *             <li>"Max Visited" - when the current step and the max step
-  *                  are the same, "max visited" behaves like "plus one". If
-  *                  the current step is before the max step, then:
-  *               <ul>
-  *                 <li>immediate - immediate is false. </li>
-  *               </ul>
-  *             </li>
-  *           </ul>
-  *         </p>
-  */
-  public boolean isImmediate()
-  {
-    Object maxPathKey = getMaxPathKey();
-    if ( maxPathKey == null)
-      return ProcessUtils.isImmediate(this, false);
-    else
-    {
-      Object  maxPath = ProcessUtils.getMaxVisitedRowKey(this, maxPathKey);
-      return ProcessUtils.isImmediate(this, maxPath, false);
-    }
-  }
-
- /**
-  *           <p>
-  *           A node in a process should be readOnly
-  *           if that step of the process is not reachable from the current
-  *           step. This method can be used to
-  *           bind the node's readOnly attribute.
-  *           </p>
-  *
-  *           <ul>
-  *             <li>"Plus One"
-  *               <ul>
-  *                 <li>readOnly - readOnly will be true for any step past
-  *                                the next available step</li>
-  *               </ul>
-  *             </li>
-  *             <li>"Max Visited" - when the current step and the max step
-  *                  are the same, "max visited" behaves like "plus one". If
-  *                  the current step is before the max step, then:
-  *               <ul>
-  *                 <li>readOnly - readOnly will be true for any step
-  *                                past the max step</li>
-  *               </ul>
-  *             </li>
-  *           </ul>
-  *         </p>
-  */
-  public boolean isReadOnly()
-  {
-    Object maxPathKey = getMaxPathKey();
-    if (maxPathKey == null)
-      return ProcessUtils.isReadOnly(this, true);
-    else
-    {
-      Object maxPath = ProcessUtils.getMaxVisitedRowKey(this, maxPathKey);
-      return ProcessUtils.isReadOnly(this, maxPath, true);
-    }
-  }
-
-  /**
-   * to clear the max visited path out of the session
-   */
-  public void clearMaxPath()
-  {
-    Object maxPathKey = getMaxPathKey();
-    if ( maxPathKey != null)
-      ProcessUtils.clearMaxPath(maxPathKey);
-  }
-
-  public void setMaxPathKey(Object maxPathKey)
-  {
-    _maxPathKey = maxPathKey;
-  }
-
-  public Object getMaxPathKey()
-  {
-    return _maxPathKey;
-  }
-
-  Object _maxPathKey = null;
-}
+package org.apache.myfaces.adf.model;
+
+import java.beans.IntrospectionException;
+
+
+ /**
+  *
+  *
+  *  <p>
+  *         There are two common scenarios for processes,
+  *         "Plus One" and "Max Visited" which are explained below.
+  *           <ul>
+  *             <li>"Plus One" - from the current step the user can
+  *             navigate to any previous page and the next page.
+  *             If the user is on the 5th step of a process
+  *             and goes back to step 2, then the user can only
+  *             navigate from step 2 to step 1 and step 3.
+  *             </li>
+  *             <li>"Max Visited" - the user can navigate to the max
+  *             visited page. If the user is currently on the max
+  *             visited page then the user can also navigate to
+  *             the next page. If the user is on the 5th step of a
+  *             process and goes back to step 2, then the user can
+  *             navigate from step 2 to steps 1, 2, 3, 4, and 5.
+  *             </li>
+  *           </ul>
+  *
+  *           </p>
+  *           <p>
+  *           A node in a process should be readOnly
+  *           if that step of the process is not reachable from the current
+  *           step. The {@link #isReadOnly} method can be used to
+  *           bind the node's readOnly attribute.
+  *           </p>
+  *           <p>
+  *           A node in a process should be immediate if the values
+  *           in the current step don't need to be validated.
+  *           The {@link #isImmediate} method can be used to
+  *           bind the node's immediate attribute.
+  *           </p>
+  *           <p>
+  *
+  *
+  *
+  * @see ProcessUtils
+  *
+  */
+public class ProcessMenuModel extends ViewIdPropertyMenuModel
+{
+
+  /**
+   * No-arg constructor for use with managed-beans.
+   * Must call the {@link #setViewIdProperty} and
+   * {@link #setWrappedData} methods after constructing this instance.
+   */
+  public ProcessMenuModel()
+  {
+    super();
+  }
+
+  /**
+   *
+   * The "Plus One" behavior will be used with this constructor.
+   *
+   * @param instance a treeModel. This object will be passed to
+   * {@link ModelUtils#toTreeModel}
+   * @param viewIdProperty the property to use to retrieve a viewId
+   * from a node in the tree
+   * @throws IntrospectionException
+   */
+  public ProcessMenuModel(
+    Object instance,
+    String viewIdProperty
+  )throws IntrospectionException
+  {
+    super(instance, viewIdProperty);
+  }
+
+
+  /**
+   *
+   * @param instance a treeModel. This object will be passed to
+   * {@link ModelUtils#toTreeModel}
+   * @param viewIdProperty the property to use to retrieve a viewId
+   * from a node in the tree
+   * @param maxPathKey if the "Max Visited" behavior is desired, this
+   * is the key that will be used to get and set the maxPath value
+   * on the session and request. For the "Plus One" behavior pass in null.
+   * @throws IntrospectionException
+   */
+  public ProcessMenuModel(
+    Object instance,
+    String viewIdProperty,
+    Object maxPathKey
+  )throws IntrospectionException
+  {
+    super(instance, viewIdProperty);
+    setMaxPathKey(maxPathKey);
+  }
+
+ /**
+  *           <p>
+  *           A node in a process should be immediate if the values
+  *           in the current step don't need to be validated.
+  *           This method can be used to
+  *           bind the node's immediate attribute. If a user will have to
+  *           return to the current page then immediate can be set to true.
+  *           For example in a "Plus One" process, if the user is on step 5
+  *           and goes back to step 2, the user will have to come back
+  *           to step 5 again, so the fields on page 5 don't need to
+  *           be validated when going back to steps 1,2,3,4, but should be
+  *           validated when going to step 6.
+  *           </p>
+  *           <p>
+  *
+  *
+  *           <ul>
+  *             <li>"Plus One"
+  *               <ul>
+  *                 <li>immediate - immediate will be true for any previous step,
+  *                                 and false otherwise.</li>
+  *               </ul>
+  *             </li>
+  *             <li>"Max Visited" - when the current step and the max step
+  *                  are the same, "max visited" behaves like "plus one". If
+  *                  the current step is before the max step, then:
+  *               <ul>
+  *                 <li>immediate - immediate is false. </li>
+  *               </ul>
+  *             </li>
+  *           </ul>
+  *         </p>
+  */
+  public boolean isImmediate()
+  {
+    Object maxPathKey = getMaxPathKey();
+    if ( maxPathKey == null)
+      return ProcessUtils.isImmediate(this, false);
+    else
+    {
+      Object  maxPath = ProcessUtils.getMaxVisitedRowKey(this, maxPathKey);
+      return ProcessUtils.isImmediate(this, maxPath, false);
+    }
+  }
+
+ /**
+  *           <p>
+  *           A node in a process should be readOnly
+  *           if that step of the process is not reachable from the current
+  *           step. This method can be used to
+  *           bind the node's readOnly attribute.
+  *           </p>
+  *
+  *           <ul>
+  *             <li>"Plus One"
+  *               <ul>
+  *                 <li>readOnly - readOnly will be true for any step past
+  *                                the next available step</li>
+  *               </ul>
+  *             </li>
+  *             <li>"Max Visited" - when the current step and the max step
+  *                  are the same, "max visited" behaves like "plus one". If
+  *                  the current step is before the max step, then:
+  *               <ul>
+  *                 <li>readOnly - readOnly will be true for any step
+  *                                past the max step</li>
+  *               </ul>
+  *             </li>
+  *           </ul>
+  *         </p>
+  */
+  public boolean isReadOnly()
+  {
+    Object maxPathKey = getMaxPathKey();
+    if (maxPathKey == null)
+      return ProcessUtils.isReadOnly(this, true);
+    else
+    {
+      Object maxPath = ProcessUtils.getMaxVisitedRowKey(this, maxPathKey);
+      return ProcessUtils.isReadOnly(this, maxPath, true);
+    }
+  }
+
+  /**
+   * to clear the max visited path out of the session
+   */
+  public void clearMaxPath()
+  {
+    Object maxPathKey = getMaxPathKey();
+    if ( maxPathKey != null)
+      ProcessUtils.clearMaxPath(maxPathKey);
+  }
+
+  public void setMaxPathKey(Object maxPathKey)
+  {
+    _maxPathKey = maxPathKey;
+  }
+
+  public Object getMaxPathKey()
+  {
+    return _maxPathKey;
+  }
+
+  Object _maxPathKey = null;
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/ProcessMenuModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/RowKeyIndex.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/RowKeyIndex.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/model/RowKeyIndex.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/RowKeyIndex.java Mon Jul 24 20:54:50 2006
@@ -13,83 +13,83 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adf.model;
-
-/**
- * Identifies a collection that is indexed by rowKeys.
- * Data is accessed by setting a rowKey, and then accessing
- * {@link #getRowData}.
- */
-public interface RowKeyIndex
-{
-  /**
-   * Gets the number of values in this collection
-   * @return -1 if the number of values is not known.
-   */
-  public int getRowCount();
-  
-  /**
-   * Gets the index of the current value.
-   * The current value is returned by calling {link #getRowData}
-   * @return the zero-based index of the current value, or -1 if there
-   * is no current value
-   */
-  public int getRowIndex();
-  
-  /**
-   * Sets up a value at a particular index to be the current value.
-   * The current value is returned by calling {link #getRowData}
-   * @param rowIndex the zero-based index of the value to make current.
-   * Use -1 to clear the current value
-   */
-  public void setRowIndex(int rowIndex);
-
-  /**
-   * Gets the rowKey of the current value.
-   * The current value is returned by calling {link #getRowData}
-   * @return the rowKey of the current value, or null if there
-   * is no current value
-   */
-  public Object getRowKey();
-  
-  /**
-   * Sets up a value at a particular rowKey to be the current value.
-   * The current value is returned by calling {link #getRowData}
-   * @param rowKey the rowKey of the value to make current.
-   * Use null to clear the current value
-   */
-  public void setRowKey(Object rowKey);
-  
-  /**
-   * Checks to make sure a value exists for the current index or rowKey.
-   * This is useful if the number of values in this collection is not known
-   * (See {@link #getRowCount}).
-   * @see #getRowKey
-   * @see #getRowIndex
-   * @return true if a value exists; false otherwise.
-   */
-  public boolean isRowAvailable();
-  
-  /**
-   * Gets the current value identified by the current index or rowKey.
-   * @see #getRowKey
-   * @see #getRowIndex
-   * @return null if the current value has been cleared.
-   */
-  public Object getRowData();
-
-  /**
-   * Checks to make sure a value exists for the given index.
-   * @param rowIndex the index of the row to check.
-   * @return true if a value exists; false otherwise.
-   */
-  public boolean isRowAvailable(int rowIndex);
-
-  /**
-   * Gets the row value at the given index.
-   * @param rowIndex the index of the row to get data from.
-   * @return null if the current value has been cleared.
-   */
-  public Object getRowData(int rowIndex);
-
+package org.apache.myfaces.adf.model;
+
+/**
+ * Identifies a collection that is indexed by rowKeys.
+ * Data is accessed by setting a rowKey, and then accessing
+ * {@link #getRowData}.
+ */
+public interface RowKeyIndex
+{
+  /**
+   * Gets the number of values in this collection
+   * @return -1 if the number of values is not known.
+   */
+  public int getRowCount();
+  
+  /**
+   * Gets the index of the current value.
+   * The current value is returned by calling {link #getRowData}
+   * @return the zero-based index of the current value, or -1 if there
+   * is no current value
+   */
+  public int getRowIndex();
+  
+  /**
+   * Sets up a value at a particular index to be the current value.
+   * The current value is returned by calling {link #getRowData}
+   * @param rowIndex the zero-based index of the value to make current.
+   * Use -1 to clear the current value
+   */
+  public void setRowIndex(int rowIndex);
+
+  /**
+   * Gets the rowKey of the current value.
+   * The current value is returned by calling {link #getRowData}
+   * @return the rowKey of the current value, or null if there
+   * is no current value
+   */
+  public Object getRowKey();
+  
+  /**
+   * Sets up a value at a particular rowKey to be the current value.
+   * The current value is returned by calling {link #getRowData}
+   * @param rowKey the rowKey of the value to make current.
+   * Use null to clear the current value
+   */
+  public void setRowKey(Object rowKey);
+  
+  /**
+   * Checks to make sure a value exists for the current index or rowKey.
+   * This is useful if the number of values in this collection is not known
+   * (See {@link #getRowCount}).
+   * @see #getRowKey
+   * @see #getRowIndex
+   * @return true if a value exists; false otherwise.
+   */
+  public boolean isRowAvailable();
+  
+  /**
+   * Gets the current value identified by the current index or rowKey.
+   * @see #getRowKey
+   * @see #getRowIndex
+   * @return null if the current value has been cleared.
+   */
+  public Object getRowData();
+
+  /**
+   * Checks to make sure a value exists for the given index.
+   * @param rowIndex the index of the row to check.
+   * @return true if a value exists; false otherwise.
+   */
+  public boolean isRowAvailable(int rowIndex);
+
+  /**
+   * Gets the row value at the given index.
+   * @param rowIndex the index of the row to get data from.
+   * @return null if the current value has been cleared.
+   */
+  public Object getRowData(int rowIndex);
+
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-api/src/main/java/org/apache/myfaces/adf/model/RowKeyIndex.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message