Skip to content

Commit

Permalink
Disable up/down buttons upon dialog initialisation.
Browse files Browse the repository at this point in the history
When initialising the ExplanationPreferencesGeneralPanel dialog, make
sure the "up" and "down" buttons are disabled if no row is selected in
the list of available explanation services (which is normally the case
when the dialog is created).
  • Loading branch information
gouttegd committed May 28, 2024
1 parent 966a66e commit 23e9b01
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private void addUpDownButtons(PreferencesLayoutPanel panel, JTable pluginTable)
}
pluginTable.setRowSelectionInterval(rowIndex - 1, rowIndex - 1);
});
buttonUp.setEnabled(pluginTable.getSelectedRow() != -1);

JButton buttonDown = new JButton("↓ Move down︎");
buttonDown.setToolTipText("Move the selected explanation service towards the bottom of the list");
Expand All @@ -104,6 +105,7 @@ private void addUpDownButtons(PreferencesLayoutPanel panel, JTable pluginTable)
}
pluginTable.setRowSelectionInterval(rowIndex + 1, rowIndex + 1);
});
buttonDown.setEnabled(pluginTable.getSelectedRow() != -1);

JPanel buttonsUpDown = new JPanel();
buttonsUpDown.add(buttonUp);
Expand Down

0 comments on commit 23e9b01

Please sign in to comment.