01: /*
02: * Created on Mar 27, 2003
03: *
04: * Dbmjui is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License version 2 as
06: * published by the Free Software Foundation.
07: *
08: * Dbmjui is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public
14: * License along with dbmjui; see the file COPYING. If not,
15: * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16: * Boston, MA 02111-1307, USA.
17: *
18: */
19: package fr.aliacom.common.ui.table;
20:
21: import java.util.ArrayList;
22:
23: /**
24: * @author tom
25: *
26: * (c) 2001, 2003 Thomas Cataldo
27: */
28: public class CellEditorSupport {
29:
30: private ArrayList listeners;
31:
32: public CellEditorSupport() {
33: listeners = new ArrayList();
34: }
35:
36: /**
37: * @see fr.aliacom.common.ui.table.ICellEditor#addCellEditorListener(fr.aliacom.common.ui.table.ICellEditorListener)
38: */
39: public void addCellEditorListener(ICellEditorListener icel) {
40: System.err.println("Cell editor listener added !");
41: listeners.add(icel);
42: }
43:
44: /**
45: * @see fr.aliacom.common.ui.table.ICellEditor#removeCellEditorListener(fr.aliacom.common.ui.table.ICellEditorListener)
46: */
47: public void removeCellEditorListener(ICellEditorListener icel) {
48: System.err.println("Cell editor listener removed !");
49: listeners.remove(icel);
50: }
51:
52: public void fireEditingStopped() {
53: for (int i = 0, n = listeners.size(); i < n; i++) {
54: ICellEditorListener icel = (ICellEditorListener) listeners
55: .get(i);
56: icel.editingStopped();
57: System.err
58: .println("Cell editor fired editing stopped event !");
59: }
60: }
61:
62: }
|