home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 November
/
Chip_1998-11_cd.bin
/
tema
/
Cafe
/
jfc.bin
/
SingleSelectionModel.java
< prev
next >
Wrap
Text File
|
1998-02-26
|
2KB
|
68 lines
/*
* %W% %E%
*
* Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
*/
package com.sun.java.swing;
import com.sun.java.swing.event.*;
/**
* A model that supports at most one indexed selection.
*
* @version %I% %G%
* @author Dave Moore
*/
public interface SingleSelectionModel {
/**
* @return the model's selection, or -1 if there is no selection.
* @see #setSelectedIndex
*/
public int getSelectedIndex();
/**
* Sets the model's selected index to <I>index</I>.
*
* Notifies any listeners if the model changes
*
* @see #getSelectedIndex
* @see #addChangeListener
*/
public void setSelectedIndex(int index);
/**
* Clears the selection (to -1).
*/
public void clearSelection();
/**
* Returns true if the selection model currently has a selected value.
*/
public boolean isSelected();
/**
* Adds <I>listener</I> as a listener to changes in the model.
*/
void addChangeListener(ChangeListener listener);
/**
* Removes <I>listener</I> as a listener to changes in the model.
*/
void removeChangeListener(ChangeListener listener);
}