de.esprit.common.gui.util

## Class IndexSelectionModel

- java.lang.Object
- - javax.swing.DefaultListSelectionModel
  - - de.esprit.common.gui.util.IndexSelectionModel

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, javax.swing.ListSelectionModel

      public class IndexSelectionModel
      extends javax.swing.DefaultListSelectionModel

  This is a special `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.
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class javax.swing.DefaultListSelectionModel

      `leadAnchorNotificationEnabled, listenerList`

    - ### Fields inherited from interface javax.swing.ListSelectionModel

      `MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexSelectionModel()`

  - ### Method Summary

    Methods
    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)`

    - ### Methods inherited from class javax.swing.DefaultListSelectionModel

      `addListSelectionListener, addSelectionInterval, clone, fireValueChanged, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, moveLeadSelectionIndex, removeListSelectionListener, setLeadAnchorNotificationEnabled, setSelectionMode, setValueIsAdjusting, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### IndexSelectionModel

          public IndexSelectionModel()

  - ### Method Detail

    - #### setAnchorSelectionIndex

          public void setAnchorSelectionIndex(int anchorIndex)

      Specified by:
        `setAnchorSelectionIndex` in interface `javax.swing.ListSelectionModel`
      Overrides:
        `setAnchorSelectionIndex` in class `javax.swing.DefaultListSelectionModel`

    - #### setLeadSelectionIndex

          public void setLeadSelectionIndex(int leadIndex)

      Specified by:
        `setLeadSelectionIndex` in interface `javax.swing.ListSelectionModel`
      Overrides:
        `setLeadSelectionIndex` in class `javax.swing.DefaultListSelectionModel`

    - #### setSelectionInterval

          public void setSelectionInterval(int index0,
                                  int index1)

      Specified by:
        `setSelectionInterval` in interface `javax.swing.ListSelectionModel`
      Overrides:
        `setSelectionInterval` in class `javax.swing.DefaultListSelectionModel`

    - #### clearSelection

          public void clearSelection()

      Specified by:
        `clearSelection` in interface `javax.swing.ListSelectionModel`
      Overrides:
        `clearSelection` in class `javax.swing.DefaultListSelectionModel`

    - #### removeIndexInterval

          public void removeIndexInterval(int index0,
                                 int index1)

      Specified by:
        `removeIndexInterval` in interface `javax.swing.ListSelectionModel`
      Overrides:
        `removeIndexInterval` in class `javax.swing.DefaultListSelectionModel`

    - #### removeSelectionInterval

          public void removeSelectionInterval(int index0,
                                     int index1)

      Specified by:
        `removeSelectionInterval` in interface `javax.swing.ListSelectionModel`
      Overrides:
        `removeSelectionInterval` in class `javax.swing.DefaultListSelectionModel`

    - #### setCurrentIndex

          public void setCurrentIndex(int index)

    - #### getCurrentIndex

          public int getCurrentIndex()

    - #### addIndexChangeListener

          public void addIndexChangeListener(IndexChangeEvent.Listener l)

    - #### removeIndexChangeListener

          public void removeIndexChangeListener(IndexChangeEvent.Listener l)

    - #### fireIndexAllowedToChange

          protected boolean fireIndexAllowedToChange()

    - #### fireIndexChanged

          protected void fireIndexChanged()

    - #### fireSelectionState

          public void fireSelectionState()

      Tell all SelectionListeners to update their current state.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.