1 13 package com.tonbeller.wcf.table; 14 15 18 public class TableModelDecorator implements TableModel, TableModelChangeListener { 19 private TableModel decoree; 20 21 protected TableModelDecorator() { 22 } 23 24 public TableModelDecorator(TableModel decoree) { 25 this.decoree = decoree; 26 decoree.addTableModelChangeListener(this); 27 } 28 29 public TableModel getDecoree() { 30 return decoree; 31 } 32 33 public void setDecoree(TableModel newDecoree) { 34 if (decoree != null) 35 decoree.removeTableModelChangeListener(this); 36 decoree = newDecoree; 37 decoree.addTableModelChangeListener(this); 38 } 39 40 public void addTableModelChangeListener(TableModelChangeListener listener) { 41 decoree.addTableModelChangeListener(listener); 42 } 43 44 public void fireModelChanged(boolean identityChanged) { 45 decoree.fireModelChanged(identityChanged); 46 } 47 48 public int getColumnCount() { 49 return decoree.getColumnCount(); 50 } 51 52 public String getColumnTitle(int columnIndex) { 53 return decoree.getColumnTitle(columnIndex); 54 } 55 56 public TableRow getRow(int rowIndex) { 57 return decoree.getRow(rowIndex); 58 } 59 60 public int getRowCount() { 61 return decoree.getRowCount(); 62 } 63 64 public String getTitle() { 65 return decoree.getTitle(); 66 } 67 68 public void removeTableModelChangeListener(TableModelChangeListener listener) { 69 decoree.removeTableModelChangeListener(listener); 70 } 71 72 public void tableModelChanged(TableModelChangeEvent event) { 73 } 74 75 } 76 | Popular Tags |