01: /*
02: * Created on Apr 22, 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.dbmjui;
20:
21: import java.util.LinkedList;
22: import java.util.ListIterator;
23:
24: /**
25: * @author tom
26: *
27: * (c) 2001, 2003 Thomas Cataldo
28: */
29: public class InstanceSelectionSupport {
30:
31: private LinkedList selectionListeners;
32:
33: public InstanceSelectionSupport() {
34: selectionListeners = new LinkedList();
35: }
36:
37: public void fireInstanceSelectionChangeEvent(DbInstance dbi) {
38: ListIterator li = selectionListeners.listIterator(0);
39: while (li.hasNext()) {
40: ((IInstanceSelectionListener) li.next())
41: .instanceSelected(dbi);
42: }
43: }
44:
45: public void addInstanceSelectionListener(
46: IInstanceSelectionListener sl) {
47: selectionListeners.add(sl);
48: }
49:
50: public void removeInstanceSelectionListener(
51: IInstanceSelectionListener sl) {
52: selectionListeners.remove(sl);
53: }
54:
55: }
|