001/*
002 * $Id: TableColumnModelExtListener.java 1395 2006-09-14 14:40:12Z kleopatra $
003 *
004 * Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle,
005 * Santa Clara, California 95054, U.S.A. All rights reserved.
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 * 
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015 * Lesser General Public License for more details.
016 * 
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this library; if not, write to the Free Software
019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
020 */
021package org.jdesktop.swingx.event;
022
023import java.beans.PropertyChangeEvent;
024
025import javax.swing.event.TableColumnModelListener;
026
027/**
028 * Extended <code>TableColumnModelListener</code> which is interested 
029 * in property changes of contained <code>TableColumn</code>s. <p>
030 * 
031 * Enhanced <code>TableColumnModelExt</code> guarantees to notify 
032 * these extended column listeners. An example of a client which 
033 * adjusts itself based on <code>headerValue</code> property of visible columns: 
034 * <pre><code>
035 * TableColumnModelExtListener l = new TableColumnModelExtListener() {
036 * 
037 *     public void columnPropertyChange(PropertyChangeEvent event) {
038 *         if (&quot;headerValue&quot;.equals(event.getPropertyName())) {
039 *             TableColumn column = (TableColumn) event.getSource();
040 *             if ((column instanceof TableColumnExt)
041 *                     &amp;&amp; !((TableColumnExt) column).isVisible()) {
042 *                 return;
043 *             }
044 *             resizeAndRepaint();
045 *         }
046 *     }
047 * 
048 *     public void columnAdded(TableColumnModelEvent e) {
049 *     }
050 * 
051 *     public void columnMarginChanged(ChangeEvent e) {
052 *     }
053 * 
054 *     public void columnMoved(TableColumnModelEvent e) {
055 *     }
056 * 
057 *     public void columnRemoved(TableColumnModelEvent e) {
058 *     }
059 * 
060 *     public void columnSelectionChanged(ListSelectionEvent e) {
061 *     }
062 * 
063 * };
064 * columnModel.addColumnModelListener(l);
065 * </code></pre>
066 * 
067 * @author Jeanette Winzenburg
068 * @see org.jdesktop.swingx.table.TableColumnModelExt
069 */
070public interface TableColumnModelExtListener extends TableColumnModelListener {
071
072    /**
073     * Notifies listeners about property changes of contained columns.
074     * The event is the original as fired from the <code>TableColumn</code>.
075     * @param event a <code>PropertyChangeEvent</code> fired by a <code>TableColumn</code>
076     *   contained in a <code>TableColumnModel</code>
077     */
078    void columnPropertyChange(PropertyChangeEvent event);
079}