Added: #2328 Searching/replacing in texts now supports selection / all files scope

This commit is contained in:
Jindra Petřík
2024-10-13 20:43:18 +02:00
parent 531cb00e1d
commit 8fefb0b1f3
3 changed files with 107 additions and 46 deletions
@@ -120,13 +120,6 @@ public class SearchDialog extends AppDialog {
scopeComboBox.setSelectedIndex(1);
}
if (replace) {
if (selection != null) {
scopeComboBox.setSelectedIndex(1);
}
scopeComboBox.setEnabled(false);
}
cnt.add(panField);
JPanel checkPanel = new JPanel(new FlowLayout());
@@ -152,10 +145,6 @@ public class SearchDialog extends AppDialog {
rbPanel.add(searchInPCodeRadioButton);
rbPanel.add(searchInTextsRadioButton);
cnt.add(rbPanel);
searchInASRadioButton.addActionListener(this::searchTypeActionPerformed);
searchInPCodeRadioButton.addActionListener(this::searchTypeActionPerformed);
searchInTextsRadioButton.addActionListener(this::searchTypeActionPerformed);
}
cnt.add(panButtons);
@@ -170,20 +159,7 @@ public class SearchDialog extends AppDialog {
images.add(View.loadImage(replace ? "replace32" : "search32"));
setIconImages(images);
}
private void searchTypeActionPerformed(ActionEvent e) {
if (searchInTextsRadioButton.isSelected()) {
if (scopeComboBox.getModel().getSize() == 3) {
scopeComboBox.setSelectedIndex(1);
} else {
scopeComboBox.setSelectedIndex(0);
}
scopeComboBox.setEnabled(false);
} else {
scopeComboBox.setEnabled(true);
}
}
@Override
public void setVisible(boolean b) {
if (b) {