GP-5769 - Updated dialogs with combo boxes to have consistent behavior

when the Enter key is pressed
This commit is contained in:
dragonmacher
2025-08-27 19:47:35 -04:00
parent dc09c94c81
commit dc72238178
20 changed files with 46 additions and 137 deletions

View File

@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -127,7 +127,6 @@ public class ChooseMatchTagAction extends DockingAction {
tagComboBox = new MatchTagComboBox(session, matches, component, selectedTag);
Dimension dim = new Dimension(50, tagComboBox.getPreferredSize().height);
tagComboBox.setMinimumSize(dim);
tagComboBox.addActionListener(e -> fieldEdited());
panel.add(tagComboBox, BorderLayout.CENTER);
return panel;
}
@@ -148,12 +147,5 @@ public class ChooseMatchTagAction extends DockingAction {
VTMatchTag getSelectedTag() {
return selectedTag;
}
/**
* An address edit action occurred in the panel so handle it as if ok button were pressed.
*/
public void fieldEdited() {
okCallback();
}
}
}

View File

@@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,10 +15,6 @@
*/
package ghidra.feature.vt.gui.editors;
import ghidra.feature.vt.api.main.*;
import ghidra.feature.vt.gui.plugin.VTController;
import ghidra.util.SystemUtilities;
import java.awt.Component;
import java.awt.event.*;
import java.util.*;
@@ -29,6 +24,9 @@ import javax.swing.table.TableCellEditor;
import javax.swing.table.TableModel;
import docking.widgets.table.RowObjectTableModel;
import ghidra.feature.vt.api.main.*;
import ghidra.feature.vt.gui.plugin.VTController;
import ghidra.util.SystemUtilities;
public class MatchTagCellEditor extends AbstractCellEditor implements TableCellEditor {
@@ -55,12 +53,6 @@ public class MatchTagCellEditor extends AbstractCellEditor implements TableCellE
VTSession session = controller.getSession();
tag = match.getTag();
matchTagChoices = new MatchTagComboBox(session, matches, theTable, tag);
matchTagChoices.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stopCellEditing();
}
});
matchTagChoices.addItemListener(new ItemListener() {
@Override

View File

@@ -831,7 +831,7 @@ public class ApplyMarkupPropertyEditor implements OptionsEditor {
Enum<?>[] enums = editor.getEnums();
final JComboBox<Enum<?>> applyComboBox = new GComboBox<>(enums);
applyComboBox.addActionListener(e -> changesMade(true));
applyComboBox.addItemListener(e -> changesMade(true));
return applyComboBox;
}