Example usage for javax.swing.event ListSelectionEvent getLastIndex

List of usage examples for javax.swing.event ListSelectionEvent getLastIndex

Introduction

In this page you can find the example usage for javax.swing.event ListSelectionEvent getLastIndex.

Prototype

public int getLastIndex() 

Source Link

Document

Returns the index of the last row whose selection may have changed.

Usage

From source file:com.mirth.connect.client.ui.editors.transformer.TransformerPane.java

private void TransformerListSelected(ListSelectionEvent evt) {
    updating = true;//from w  w w. jav a2s. c o m

    int row = transformerTable.getSelectedRow();
    int last = evt.getLastIndex();

    if (row != prevSelRow) {
        saveData(prevSelRow);

        if (invalidVar) {
            row = prevSelRow;
            invalidVar = false;
        }

        if (isValid(row)) {
            loadData(row);
        } else if (isValid(last)) {
            loadData(last);
            row = last;
        }

        String type = (String) transformerTable.getValueAt(row, STEP_TYPE_COL);
        stepPanel.showCard(type);
        transformerTable.setRowSelectionInterval(row, row);
        prevSelRow = row;
        updateTaskPane(type);
    }

    updateCodePanel(null);
    updating = false;
}