1 13 package com.tonbeller.wcf.tree; 14 15 import java.util.Comparator ; 16 import java.util.HashSet ; 17 import java.util.Set ; 18 import java.util.TreeSet ; 19 20 23 public class DefaultDeleteNodeModel implements DeleteNodeModel { 24 Set deleted; 25 NodeFilter deletableFilter; 26 27 30 public DefaultDeleteNodeModel() { 31 deleted = new HashSet (); 32 } 33 34 38 public DefaultDeleteNodeModel(Comparator comp) { 39 deleted = new TreeSet (comp); 40 } 41 42 public boolean isDeletable(Object node) { 43 return deletableFilter != null && deletableFilter.accept(node); 44 } 45 46 public void delete(Object node) { 47 deleted.add(node); 48 } 49 50 public Set getDeleted() { 51 return deleted; 52 } 53 54 57 public NodeFilter getDeletableFilter() { 58 return deletableFilter; 59 } 60 61 64 public void setDeletableFilter(NodeFilter filter) { 65 deletableFilter = filter; 66 } 67 68 } 69 | Popular Tags |