From 8225c10b6c1fb3c582049560c397351675f1221c Mon Sep 17 00:00:00 2001 From: ghidragon <106987263+ghidragon@users.noreply.github.com> Date: Thu, 18 Jul 2024 13:00:29 -0400 Subject: [PATCH] GP-4779 fixed issue in add references dialog where moving mouse would sometimes reset address space choice in comboBox. --- .../function/AbstractEditFunctionSignatureDialog.java | 6 +++--- .../plugin/core/references/EditMemoryReferencePanel.java | 8 ++++---- .../Base/src/main/java/ghidra/app/util/AddressInput.java | 6 +++--- .../provider/matchtable/ApplyMarkupPropertyEditor.java | 6 +++--- .../widgets/conditiontestpanel/ConditionTestPanel.java | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/AbstractEditFunctionSignatureDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/AbstractEditFunctionSignatureDialog.java index ee199456ee..cee9f6323e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/AbstractEditFunctionSignatureDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/AbstractEditFunctionSignatureDialog.java @@ -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. @@ -235,7 +235,7 @@ public abstract class AbstractEditFunctionSignatureDialog extends DialogComponen private void installInlineWidget(JPanel parentPanel) { inlineCheckBox = new GCheckBox("Inline"); - inlineCheckBox.addChangeListener(e -> { + inlineCheckBox.addItemListener(e -> { if (inlineCheckBox.isSelected() && callFixupComboBox != null) { callFixupComboBox.setSelectedItem(NONE_CHOICE); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java index b2462f7d28..a390606c53 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java @@ -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. @@ -103,7 +103,7 @@ class EditMemoryReferencePanel extends EditReferencePanel { .setAccessibleDescription( "Selecting this checkbox allows entering a refernce offset"); offsetCheckbox.setHorizontalAlignment(SwingConstants.RIGHT); - offsetCheckbox.addChangeListener(e -> enableOffsetField(offsetCheckbox.isSelected())); + offsetCheckbox.addItemListener(e -> enableOffsetField(offsetCheckbox.isSelected())); offsetField = new JTextField(); offsetField.getAccessibleContext().setAccessibleName("Enter Offset"); @@ -123,7 +123,7 @@ class EditMemoryReferencePanel extends EditReferencePanel { includeOtherOverlaysCheckbox = new JCheckBox("Include OTHER overlay spaces", Boolean.getBoolean(Preferences.getProperty(INCLUDE_OTHER_OVERLAY_PREFERENCE, "false"))); - includeOtherOverlaysCheckbox.addChangeListener(e -> refreshToAddressField()); + includeOtherOverlaysCheckbox.addItemListener(e -> refreshToAddressField()); refTypes = new GhidraComboBox<>(MEM_REF_TYPES); refTypes.getAccessibleContext().setAccessibleName("Memory Ref Types"); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddressInput.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddressInput.java index e493a2f5ff..c31a4318f0 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddressInput.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddressInput.java @@ -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. @@ -416,7 +416,7 @@ public class AddressInput extends JPanel implements FocusableEditor { remove(combo); comboAdded = false; } - invalidate(); + revalidate(); } @Override diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java index adfc0bf7af..382873ab52 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java @@ -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. @@ -838,7 +838,7 @@ public class ApplyMarkupPropertyEditor implements OptionsEditor { private JCheckBox createCheckBox(String optionName) { JCheckBox applyCheckBox = new GCheckBox(optionName); - applyCheckBox.addChangeListener(e -> changesMade(true)); + applyCheckBox.addItemListener(e -> changesMade(true)); return applyCheckBox; } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java index 6621c59ada..a40a2b63cf 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java @@ -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. @@ -376,7 +376,7 @@ public class ConditionTestPanel extends JPanel { label = new GDLabel(test.getName()); add(label); label.setToolTipText(test.getDescription()); - checkbox.addChangeListener(e -> { + checkbox.addItemListener(e -> { conditionTestModel.setEnabled(test, checkbox.isSelected()); label.setEnabled(checkbox.isSelected()); });