package textbender.o.swing; // Copyright 2005, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Textbender Software"), to deal in the Textbender Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Textbender Software, and to permit persons to whom the Textbender Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Textbender Software. THE TEXTBENDER SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE TEXTBENDER SOFTWARE OR THE USE OR OTHER DEALINGS IN THE TEXTBENDER SOFTWARE. import javax.swing.ListSelectionModel; import javax.swing.event.*; /** A dummy implementation of a list selection model. It permits no selections. */ public final class ListSelectionModel0 implements ListSelectionModel // never tested under heavy use, but only as a dummy for JTable.setSelectionModel(), which perversely rejects nulls { /** A common instance of ListSelectionModel0. */ public static ListSelectionModel0 i() { return instance; } // - L i s t - S e l e c t i o n - M o d e l ------------------------------------------ public void addListSelectionListener( ListSelectionListener x ) {} public void addSelectionInterval( int index0, int index1 ) {} public void clearSelection() {} public int getAnchorSelectionIndex() { return -1; } public int getLeadSelectionIndex() { return -1; } public int getMaxSelectionIndex() { return -1; } public int getMinSelectionIndex() { return -1; } public int getSelectionMode() { return SINGLE_SELECTION; } public boolean getValueIsAdjusting() { return false; } public void insertIndexInterval( int index, int length, boolean before ) {} public boolean isSelectedIndex( int index ) { return false; } public boolean isSelectionEmpty() { return true; } public void removeIndexInterval( int index0, int index1 ) {} public void removeListSelectionListener( ListSelectionListener x ) {} public void removeSelectionInterval( int index0, int index1 ) {} public void setAnchorSelectionIndex( int index ) {} public void setLeadSelectionIndex( int index ) {} public void setSelectionInterval( int index0, int index1 ) {} public void setSelectionMode( int selectionMode ) {} public void setValueIsAdjusting( boolean valueIsAdjusting ) {} ////////////////////////////////////////////////////////////////////////////////////////// // Last, so static fields above initialize, and are available during instantiation below private static final ListSelectionModel0 instance = new ListSelectionModel0(); }