--- /dev/null
+/*\r
+ * Copyright (C) 2015 Roland Haeder\r
+ *\r
+ * This program is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ */\r
+package org.mxchange.addressbook.model;\r
+\r
+import java.text.MessageFormat;\r
+import javax.swing.event.EventListenerList;\r
+import javax.swing.event.TableModelListener;\r
+import org.mxchange.addressbook.BaseFrameworkSystem;\r
+\r
+/**\r
+ *\r
+ * @author Roland Haeder\r
+ */\r
+public class BaseModel extends BaseFrameworkSystem {\r
+ /** List of listeners */\r
+ private final EventListenerList listenerList;\r
+\r
+ /**\r
+ * Protected constructor\r
+ */\r
+ protected BaseModel () {\r
+ // Init listener list\r
+ this.listenerList = new EventListenerList();\r
+ }\r
+\r
+ /**\r
+ * Adds a TableModel listener instance to the event list.\r
+ * \r
+ * @param listener Lister instance\r
+ */\r
+ public void addTableModelListener (final TableModelListener listener) {\r
+ // Debug message\r
+ this.getLogger().debug(MessageFormat.format("Adding listener {0} ...", listener.getClass()));\r
+\r
+ // Add listener\r
+ this.listenerList.add(TableModelListener.class, listener);\r
+ }\r
+\r
+ /**\r
+ * Removes a TableModel listener instance from the event list.\r
+ * \r
+ * @param listener Listener instance\r
+ */\r
+ public void removeTableModelListener (final TableModelListener listener) {\r
+ // Debug message\r
+ this.getLogger().debug(MessageFormat.format("Removing listener {0} ...", listener.getClass()));\r
+\r
+ // Remove listener\r
+ this.listenerList.remove(TableModelListener.class, listener);\r
+ }\r
+}\r