1 20 package org.enhydra.barracuda.core.comp; 21 22 import java.util.*; 23 import org.enhydra.barracuda.core.comp.model.*; 24 25 44 public abstract class AbstractTableModel implements TableModel { 45 46 protected ViewContext viewContext = null; 47 protected List listeners = new ArrayList(); 48 49 56 public void addModelListener(ModelListener ml) { 57 listeners.add(ml); 58 } 59 60 65 public void removeModelListener(ModelListener ml) { 66 listeners.remove(ml); 67 } 68 69 74 public void fireModelChanged() { 75 Iterator it = listeners.iterator(); 76 ModelListener ml = null; 77 while (it.hasNext()) { 78 ml = (ModelListener) it.next(); 79 ml.modelChanged(this); 80 } 81 } 82 84 91 95 100 104 111 public void resetModel() { 112 } 114 115 124 128 141 145 153 157 165 169 177 181 189 193 203 212 218 222 231 public void setViewContext(ViewContext ivc) { 232 viewContext = ivc; 233 } 234 235 240 public ViewContext getViewContext() { 241 return viewContext; 242 } 243 } | Popular Tags |