2 * Copyright (C) 2015 Roland Haeder
\r
4 * This program is free software: you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation, either version 3 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
17 package org.mxchange.addressbook.model;
\r
19 import java.text.MessageFormat;
\r
20 import javax.swing.event.EventListenerList;
\r
21 import javax.swing.event.TableModelListener;
\r
22 import org.mxchange.addressbook.BaseFrameworkSystem;
\r
26 * @author Roland Haeder
\r
28 public class BaseModel extends BaseFrameworkSystem {
\r
29 /** List of listeners */
\r
30 private final EventListenerList listenerList;
\r
33 * Protected constructor
\r
35 protected BaseModel () {
\r
36 // Init listener list
\r
37 this.listenerList = new EventListenerList();
\r
41 * Adds a TableModel listener instance to the event list.
\r
43 * @param listener Lister instance
\r
45 public void addTableModelListener (final TableModelListener listener) {
\r
47 this.getLogger().debug(MessageFormat.format("Adding listener {0} ...", listener.getClass()));
\r
50 this.listenerList.add(TableModelListener.class, listener);
\r
54 * Removes a TableModel listener instance from the event list.
\r
56 * @param listener Listener instance
\r
58 public void removeTableModelListener (final TableModelListener listener) {
\r
60 this.getLogger().debug(MessageFormat.format("Removing listener {0} ...", listener.getClass()));
\r
63 this.listenerList.remove(TableModelListener.class, listener);
\r