Author: nbelaevski
Date: 2007-08-02 12:29:00 -0400 (Thu, 02 Aug 2007)
New Revision: 2021
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
Log:
StackingTreeModel API: models map changed to getModelById() & getModelsIterator()
UIRecursiveTreeNodes updated to comply changes
Modified: trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-08-02
16:28:54 UTC (rev 2020)
+++
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2007-08-02
16:29:00 UTC (rev 2021)
@@ -103,7 +103,7 @@
return this;
} else {
Key key = (Key) keyIterator.next();
- StackingTreeModel stackingTreeModel = (StackingTreeModel)
this.getModels().get(key.modelId);
+ StackingTreeModel stackingTreeModel = this.getModelById(key.modelId);
if (entriesIterator != null && entriesIterator.hasNext()) {
StackEntry entry = (StackEntry) entriesIterator.next();
if (entry.model != stackingTreeModel || entry.modelKey != key.modelKey) {
@@ -199,8 +199,7 @@
}
StackEntry lastEntry = (StackEntry) stackEntries.getLast();
- Collection values = lastEntry.model.getModels().values();
- for (Iterator iterator = values.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = lastEntry.model.getModelsIterator(); iterator.hasNext();) {
StackingTreeModel stackingTreeModel = (StackingTreeModel) iterator.next();
if (!stackingTreeModel.isEmpty()) {
@@ -238,10 +237,9 @@
new Visitor1(dataVisitor));
if (treeRange == null || treeRange.processChildren(argumentKey)) {
- Iterator iterator = StackingTreeModel.this.getModels().entrySet().iterator();
+ Iterator iterator = this.getModelsIterator();
while (iterator.hasNext()) {
- Map.Entry entry = (Map.Entry) iterator.next();
- StackingTreeModel model = (StackingTreeModel) entry.getValue();
+ StackingTreeModel model = (StackingTreeModel) iterator.next();
Argument argument2 = new Argument();
argument2.listRowKey = argumentKey;
@@ -260,10 +258,14 @@
}
}
- public Map getModels() {
- return models;
+ public StackingTreeModel getModelById(String id) {
+ return (StackingTreeModel) models.get(id);
}
-
+
+ public Iterator getModelsIterator() {
+ return models.values().iterator();
+ }
+
public void walk(FacesContext context, DataVisitor dataVisitor,
Range range, Object rowKey, Object argument,
boolean last) throws IOException {
Show replies by date