1 53 54 106 107 package com.Yasna.forum; 108 109 112 public class TreeWalkerProxy implements TreeWalker{ 113 114 private TreeWalker treeWalker; 115 private Authorization authorization; 116 private ForumPermissions permissions; 117 118 public TreeWalkerProxy(TreeWalker treeWalker, Authorization authorization, 119 ForumPermissions permissions) 120 { 121 this.treeWalker = treeWalker; 122 this.authorization = authorization; 123 this.permissions = permissions; 124 } 125 126 public ForumMessage getRoot() { 127 ForumMessage message = treeWalker.getRoot(); 128 return new ForumMessageProxy(message, authorization, permissions); 129 } 130 131 public ForumMessage getChild(ForumMessage parent, int index) { 132 ForumMessage message = treeWalker.getChild(parent, index); 133 return new ForumMessageProxy(message, authorization, permissions); 134 } 135 136 public int getChildCount(ForumMessage parent) { 137 return treeWalker.getChildCount(parent); 138 } 139 140 public int getRecursiveChildCount(ForumMessage parent) { 141 return treeWalker.getRecursiveChildCount(parent); 142 } 143 144 public int getIndexOfChild(ForumMessage parent, ForumMessage child) { 145 return treeWalker.getIndexOfChild(parent, child); 146 } 147 148 public boolean isLeaf(ForumMessage node) { 149 return treeWalker.isLeaf(node); 150 } 151 152 } 153 | Popular Tags |