public class IndexSelectionModel
extends javax.swing.DefaultListSelectionModel
ListSelectionModel
that allows for controlling the current index in a JTable
or
JList
. An IndexChangeEvent
is being fired when the selection index changes. But prior to this a
IndexChangeIntendedEvent
is passed around in order to find out whether any listener wants to veto
the index-change. A edit-form for instance that has non applied data may need to veto the event for not
loosing the users edits.Constructor and Description |
---|
IndexSelectionModel() |
Modifier and Type | Method and Description |
---|---|
void |
addIndexChangeListener(IndexChangeEvent.Listener l) |
void |
clearSelection() |
protected boolean |
fireIndexAllowedToChange() |
protected void |
fireIndexChanged() |
void |
fireSelectionState()
Tell all SelectionListeners to update their current state.
|
int |
getCurrentIndex() |
void |
removeIndexChangeListener(IndexChangeEvent.Listener l) |
void |
removeIndexInterval(int index0,
int index1) |
void |
removeSelectionInterval(int index0,
int index1) |
void |
setAnchorSelectionIndex(int anchorIndex) |
void |
setCurrentIndex(int index) |
void |
setLeadSelectionIndex(int leadIndex) |
void |
setSelectionInterval(int index0,
int index1) |
addListSelectionListener, addSelectionInterval, clone, fireValueChanged, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, moveLeadSelectionIndex, removeListSelectionListener, setLeadAnchorNotificationEnabled, setSelectionMode, setValueIsAdjusting, toString
public void setAnchorSelectionIndex(int anchorIndex)
setAnchorSelectionIndex
in interface javax.swing.ListSelectionModel
setAnchorSelectionIndex
in class javax.swing.DefaultListSelectionModel
public void setLeadSelectionIndex(int leadIndex)
setLeadSelectionIndex
in interface javax.swing.ListSelectionModel
setLeadSelectionIndex
in class javax.swing.DefaultListSelectionModel
public void setSelectionInterval(int index0, int index1)
setSelectionInterval
in interface javax.swing.ListSelectionModel
setSelectionInterval
in class javax.swing.DefaultListSelectionModel
public void clearSelection()
clearSelection
in interface javax.swing.ListSelectionModel
clearSelection
in class javax.swing.DefaultListSelectionModel
public void removeIndexInterval(int index0, int index1)
removeIndexInterval
in interface javax.swing.ListSelectionModel
removeIndexInterval
in class javax.swing.DefaultListSelectionModel
public void removeSelectionInterval(int index0, int index1)
removeSelectionInterval
in interface javax.swing.ListSelectionModel
removeSelectionInterval
in class javax.swing.DefaultListSelectionModel
public void setCurrentIndex(int index)
public int getCurrentIndex()
public void addIndexChangeListener(IndexChangeEvent.Listener l)
public void removeIndexChangeListener(IndexChangeEvent.Listener l)
protected boolean fireIndexAllowedToChange()
protected void fireIndexChanged()
public void fireSelectionState()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.