/* This file belongs to the Servoy development and deployment environment, Copyright (C) 1997-2010 Servoy BV This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program; if not, see http://www.gnu.org/licenses or write to the Free Software Foundation,Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 */ package com.servoy.j2db.util.editlist; import java.io.Serializable; import javax.swing.AbstractListModel; import com.servoy.j2db.util.model.IEditListModel; /** * This abstract class provides default implementations for most of * the methods in the <code>TableModel</code> interface. It takes care of * the management of listeners and provides some conveniences for generating * <code>TableModelEvents</code> and dispatching them to the listeners. * To create a concrete <code>TableModel</code> as a subclass of * <code>AbstractTableModel</code> you need only provide implementations * for the following three methods: * * <pre> * public int getRowCount(); * public Object getValueAt(int row); * </pre> * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans<sup><font size="-2">TM</font></sup> * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * */ public abstract class AbstractEditListModel extends AbstractListModel implements IEditListModel, Serializable { /** * Returns false. This is the default implementation for all cells. * * @param rowIndex the row being queried * @return false */ public boolean isCellEditable(int rowIndex) { return false; } /** * This empty implementation is provided so users don't have to implement * this method if their data model is not editable. * * @param aValue value to assign to cell * @param rowIndex row of cell */ public void setElementAt(Object aValue, int rowIndex) { } } // End of class AbstractTableModel