You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2009/12/07 20:34:02 UTC

svn commit: r888103 - in /myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad: component/UIXHierarchy.java model/CollectionModel.java

Author: arobinson74
Date: Mon Dec  7 19:33:59 2009
New Revision: 888103

URL: http://svn.apache.org/viewvc?rev=888103&view=rev
Log:
Application of new patch for TRINIDAD-1620

Modified:
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java?rev=888103&r1=888102&r2=888103&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java Mon Dec  7 19:33:59 2009
@@ -27,6 +27,8 @@
 import org.apache.myfaces.trinidad.model.CollectionModel;
 import org.apache.myfaces.trinidad.model.LocalRowKeyIndex;
 import org.apache.myfaces.trinidad.model.ModelUtils;
+import org.apache.myfaces.trinidad.model.RowKeySet;
+import org.apache.myfaces.trinidad.model.TreeLocalRowKeyIndex;
 import org.apache.myfaces.trinidad.model.TreeModel;
 
 
@@ -35,7 +37,8 @@
  *
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/component/UIXHierarchy.java#0 $) $Date: 10-nov-2005.19:09:52 $
  */
-abstract public class UIXHierarchy extends UIXCollection implements CollectionComponent, LocalRowKeyIndex
+abstract public class UIXHierarchy extends UIXCollection implements CollectionComponent, LocalRowKeyIndex, 
+             TreeLocalRowKeyIndex
 {
   /**
    * Create a Page component with the given render-type
@@ -176,6 +179,93 @@
     return getTreeModel().getAllAncestorContainerRowKeys(childRowKey);
   }
 
+  //
+  //  TreeLocalRowKeyIndex implementation
+  //
+
+  /**
+   * Indicates whether data for a child model (children of the current node) is 
+   * locally available. 
+   * @see TreeModel#isChildCollectionLocallyAvailable()
+   * @return true if child data is locally available
+   */
+  public boolean isChildCollectionLocallyAvailable()
+  {
+    return getTreeModel().isChildCollectionLocallyAvailable();
+  }
+
+  /**
+   * Indicates whether child data for the node with the given index is
+   * locally available.   
+   * @see TreeModel#isChildCollectionLocallyAvailable(int)
+   * @param index row index to check
+   * @return true if child data is available, false otherwise
+   */
+  public boolean isChildCollectionLocallyAvailable(int index)
+  {
+    return getTreeModel().isChildCollectionLocallyAvailable(index);
+  }
+
+  /**
+   * Indicates whether child data for the node with the given row key is
+   * locally available.   
+   * @see TreeModel#isChildCollectionLocallyAvailable(Object)
+   * @param rowKey row key to check
+   * @return true if child data is available, false otherwise
+   */
+  public boolean isChildCollectionLocallyAvailable(Object rowKey)
+  {
+    return getTreeModel().isChildCollectionLocallyAvailable(rowKey);
+  }
+
+  /**
+   * Check if a range of rows is locally available starting from a row index.  The range
+   * can include child nodes in any expanded nodes within the range.
+   * @param startIndex staring index for the range  
+   * @param rowCount number of rows in the range
+   * @param disclosedRowKeys set of expanded nodes which may fall within the range to check for
+   * availability
+   * @return <code>true</code> if range of rows is locally available <code>flase</code> otherwise
+   * @see TreeModel#areRowsLocallyAvailable(int, int, RowKeySet)
+   */
+  public boolean areRowsLocallyAvailable(int startIndex, int rowCount,
+                                         RowKeySet disclosedRowKeys)
+  {
+    return getTreeModel().areRowsLocallyAvailable(startIndex, rowCount, disclosedRowKeys);
+  }
+
+  /**
+   * Check if a range of rows is locally available starting from a row key.   The range
+   * can include child nodes in any expanded nodes within the range.
+   * @param startRowKey staring row key for the range  
+   * @param rowCount number of rows in the range
+   * @param disclosedRowKeys set of expanded nodes which may fall within the range to check for
+   * availability
+   * @return <code>true</code> if range of rows is locally available <code>flase</code> otherwise
+   * @see TreeModel#areRowsLocallyAvailable(Object, int, RowKeySet)
+   */
+  public boolean areRowsLocallyAvailable(Object startRowKey, int rowCount,
+                                         RowKeySet disclosedRowKeys)
+  {
+    return getTreeModel().areRowsLocallyAvailable(startRowKey, rowCount, disclosedRowKeys);
+  }
+
+  /**
+   * Check if a range of rows is locally available starting from current position.   The range
+   * can include child nodes  in any expanded nodes within the range.
+   * @param rowCount number of rows in the range
+   * @param disclosedRowKeys set of expanded nodes which may fall within the range to check for
+   * availability
+   * @return <code>true</code> if range of rows is locally available <code>flase</code> otherwise
+   * @see TreeModel#areRowsLocallyAvailable(int , RowKeySet)
+   */
+  public boolean areRowsLocallyAvailable(int rowCount,
+                                         RowKeySet disclosedRowKeys)
+  {
+    return getTreeModel().areRowsLocallyAvailable(rowCount, disclosedRowKeys);
+  }
+
+
   /**
    * Gets the TreeModel that this tree is displaying.
    */

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java?rev=888103&r1=888102&r2=888103&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java Mon Dec  7 19:33:59 2009
@@ -328,13 +328,22 @@
 
   /**
    * Check if a range of rows is locally available starting from current position.
-   * This implementation returns <code>false</code>
+   * This implementation checks for a valid current index and delegates to 
+   * <code>areRowsLocallyAvailable(startIndex, rowsToCheck)</code>
    * @param rowsToCheck number of rows to check
    * @return default implementation returns <code>false</code>
+   * @see <code>areRowsLocallyAvailable(startIndex, rowsToCheck)</code>
    */
   public boolean areRowsLocallyAvailable(int rowsToCheck)
   {
-    return false;
+    boolean available = false;    
+    int startIndex = getRowIndex();
+    
+    if (startIndex >= 0)
+    {
+      available = areRowsLocallyAvailable(startIndex, rowsToCheck);
+    }
+    return available;
   }
   
   /**