TableColumnModelExt.java
上传用户:zhengdagz
上传日期:2014-03-06
资源大小:1956k
文件大小:3k
源码类别:

xml/soap/webservice

开发平台:

Java

  1. /*
  2.  * $Id: TableColumnModelExt.java,v 1.5 2005/10/10 18:03:04 rbair Exp $
  3.  *
  4.  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
  5.  * Santa Clara, California 95054, U.S.A. All rights reserved.
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  * 
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  20.  */
  21. package org.jdesktop.swingx.table;
  22. import java.util.List;
  23. import java.util.Set;
  24. import javax.swing.table.TableColumnModel;
  25. /**
  26.  * An extension to the TableColumnModel that adds logic dealing with the
  27.  * "visibilty" property of the TableColumnExt. If a column is made invisible,
  28.  * then the ColumnModel must not return that column in subsequent calls to
  29.  * <code>getColumnXXX</code>. In other words, it is "silently" removed from
  30.  * the column model until it is again made visible. However, a change in the
  31.  * visibility status of a column will trigger an event so that the underlying
  32.  * JTable can repaint/relayout itself.
  33.  *
  34.  * The semantics behind removing a column and making it invisible are two
  35.  * different things. When a column is removed, it is no longer associated
  36.  * with the model in any way, whereas an invisible column is simply not
  37.  * displayed. This is somewhat similar to the idea of column ordering being
  38.  * different in the model from the view.
  39.  *
  40.  * @author Richard Bair
  41.  */
  42. public interface TableColumnModelExt extends TableColumnModel {
  43.     /**
  44.      * Returns a list containing all of the columns that are invisible. If
  45.      * no columns in this model are invisible, then this will be an empty
  46.      * list.
  47.      */
  48.     public Set getInvisibleColumns();
  49.     /**
  50.      * Returns all of the columns in the TableColumnModel, including invisible
  51.      * ones.
  52.      * @deprecated use getColumns(boolean instead)
  53.      */
  54.     public List getAllColumns();
  55.     
  56.     
  57.     /**
  58.      * Returns all of the columns in the TableColumnModel, including invisible
  59.      * ones if the parameter is true.
  60.      * @param includeHidden if true the returned list contains all columns 
  61.      *  otherwise only the subset of visible columns.
  62.      * 
  63.      */
  64.     public List getColumns(boolean includeHidden);
  65.     
  66.     /**
  67.      * returns the first TableColumnExt with the given identifier or null
  68.      * if none is found. The returned column may be visible or hidden.
  69.      *  
  70.      * @param identifier
  71.      * @return
  72.      */
  73.     public TableColumnExt getColumnExt(Object identifier);
  74.     
  75.     /**
  76.      * returns the number of contained columns including invisible 
  77.      *  if the parameter is true.
  78.      * 
  79.      * @param includeHidden 
  80.      * @return
  81.      */
  82.     public int getColumnCount(boolean includeHidden);
  83. }