org.mozilla.javascript.tools.debugger.treetable

## Class JTreeTable.ListToTreeSelectionModelWrapper

- java.lang.Object
- - javax.swing.tree.DefaultTreeSelectionModel
  - - org.mozilla.javascript.tools.debugger.treetable.JTreeTable.ListToTreeSelectionModelWrapper

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, javax.swing.tree.TreeSelectionModel
  Enclosing class:
    JTreeTable

      public class JTreeTable.ListToTreeSelectionModelWrapper
      extends javax.swing.tree.DefaultTreeSelectionModel

  ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel to listen for changes in the ListSelectionModel it maintains. Once a change in the ListSelectionModel happens, the paths are updated in the DefaultTreeSelectionModel.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `updatingListSelectionModel` Set to true when we are updating the ListSelectionModel.

    - ### Fields inherited from class javax.swing.tree.DefaultTreeSelectionModel

      `changeSupport, leadIndex, leadPath, leadRow, listenerList, listSelectionModel, rowMapper, selection, SELECTION_MODE_PROPERTY, selectionMode`

    - ### Fields inherited from interface javax.swing.tree.TreeSelectionModel

      `CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JTreeTable.ListToTreeSelectionModelWrapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected javax.swing.event.ListSelectionListener` | `createListSelectionListener()` Creates and returns an instance of ListSelectionHandler.
    `javax.swing.ListSelectionModel` | `getListSelectionModel()` Returns the list selection model.
    `void` | `resetRowSelection()` This is overridden to set `updatingListSelectionModel` and message super.
    `protected void` | `updateSelectedPathsFromSelectedRows()` If `updatingListSelectionModel` is false, this will reset the selected paths from the selected rows in the list selection model.

    - ### Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel

      `addPropertyChangeListener, addSelectionPath, addSelectionPaths, addTreeSelectionListener, arePathsContiguous, canPathsBeAdded, canPathsBeRemoved, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, insureRowContinuity, insureUniqueness, isPathSelected, isRowSelected, isSelectionEmpty, notifyPathChange, removePropertyChangeListener, removeSelectionPath, removeSelectionPaths, removeTreeSelectionListener, setRowMapper, setSelectionMode, setSelectionPath, setSelectionPaths, toString, updateLeadIndex`

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

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

- - ### Field Detail

    - #### updatingListSelectionModel

          protected boolean updatingListSelectionModel

      Set to true when we are updating the ListSelectionModel.

  - ### Constructor Detail

    - #### JTreeTable.ListToTreeSelectionModelWrapper

          public JTreeTable.ListToTreeSelectionModelWrapper()

  - ### Method Detail

    - #### getListSelectionModel

          public javax.swing.ListSelectionModel getListSelectionModel()

      Returns the list selection model. ListToTreeSelectionModelWrapper listens for changes to this model and updates the selected paths accordingly.

    - #### resetRowSelection

          public void resetRowSelection()

      This is overridden to set `updatingListSelectionModel` and message super. This is the only place DefaultTreeSelectionModel alters the ListSelectionModel.
      Specified by:
        `resetRowSelection` in interface `javax.swing.tree.TreeSelectionModel`
      Overrides:
        `resetRowSelection` in class `javax.swing.tree.DefaultTreeSelectionModel`

    - #### createListSelectionListener

          protected javax.swing.event.ListSelectionListener createListSelectionListener()

      Creates and returns an instance of ListSelectionHandler.

    - #### updateSelectedPathsFromSelectedRows

          protected void updateSelectedPathsFromSelectedRows()

      If `updatingListSelectionModel` is false, this will reset the selected paths from the selected rows in the list selection model.