diff --git a/Ghidra/Extensions/sample/src/main/java/ghidra/examples/graph/SampleGraphProvider.java b/Ghidra/Extensions/sample/src/main/java/ghidra/examples/graph/SampleGraphProvider.java index fdbe11e9f8..12256aa7e3 100644 --- a/Ghidra/Extensions/sample/src/main/java/ghidra/examples/graph/SampleGraphProvider.java +++ b/Ghidra/Extensions/sample/src/main/java/ghidra/examples/graph/SampleGraphProvider.java @@ -35,6 +35,7 @@ import docking.action.ToolBarData; import docking.menu.ActionState; import docking.menu.MultiStateDockingAction; import docking.widgets.*; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import ghidra.examples.graph.layout.SampleGraphPluginDependencyLayoutProvider; @@ -189,9 +190,9 @@ public class SampleGraphProvider extends ComponentProviderAdapter { // // How should we display the filtered-out vertices? // - fadedButton = new JRadioButton("Faded"); + fadedButton = new GRadioButton("Faded"); fadedButton.setToolTipText("Filtered vertices remain in the graph, but are grayed-out"); - removedButton = new JRadioButton("Removed"); + removedButton = new GRadioButton("Removed"); removedButton.setToolTipText("Filtered vertices are removed from the graph"); ButtonGroup group = new ButtonGroup(); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryConflictPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryConflictPanel.java index b04473f708..9fc9ec7da3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryConflictPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryConflictPanel.java @@ -22,6 +22,7 @@ import java.awt.event.ItemListener; import javax.swing.*; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import ghidra.app.merge.MergeConstants; @@ -96,9 +97,9 @@ class CategoryConflictPanel extends JPanel { labelPanel.add(Box.createHorizontalStrut(5)); labelPanel.add(categoryLabel); - latestRB = new JRadioButton("Use Latest"); - myRB = new JRadioButton("Use My Version"); - originalRB = new JRadioButton("Use Original"); + latestRB = new GRadioButton("Use Latest"); + myRB = new GRadioButton("Use My Version"); + originalRB = new GRadioButton("Use Original"); latestRB.setName(LATEST_BUTTON_NAME); myRB.setName(CHECKED_OUT_BUTTON_NAME); originalRB.setName(ORIGINAL_BUTTON_NAME); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypeMergePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypeMergePanel.java index bf21253f6e..98f2478ddc 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypeMergePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypeMergePanel.java @@ -23,6 +23,7 @@ import java.awt.event.ItemListener; import javax.swing.*; import docking.widgets.MultiLineLabel; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GIconLabel; import ghidra.app.merge.MergeConstants; @@ -114,15 +115,15 @@ class DataTypeMergePanel extends JPanel { } }; - latestRB = new JRadioButton(MergeConstants.LATEST_TITLE); + latestRB = new GRadioButton(MergeConstants.LATEST_TITLE); latestRB.setName(LATEST_BUTTON_NAME); latestRB.addItemListener(listener); - myRB = new JRadioButton(MergeConstants.MY_TITLE); + myRB = new GRadioButton(MergeConstants.MY_TITLE); myRB.setName(CHECKED_OUT_BUTTON_NAME); myRB.addItemListener(listener); - originalRB = new JRadioButton(MergeConstants.ORIGINAL_TITLE); + originalRB = new GRadioButton(MergeConstants.ORIGINAL_TITLE); originalRB.setName(ORIGINAL_BUTTON_NAME); originalRB.addItemListener(listener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/SourceArchiveMergePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/SourceArchiveMergePanel.java index 294f978ea8..31a7ef9b04 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/SourceArchiveMergePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/SourceArchiveMergePanel.java @@ -23,6 +23,7 @@ import java.awt.event.ItemListener; import javax.swing.*; import docking.widgets.MultiLineLabel; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GIconLabel; import ghidra.app.merge.MergeConstants; @@ -113,15 +114,15 @@ class SourceArchiveMergePanel extends JPanel { } }; - latestRB = new JRadioButton(MergeConstants.LATEST_TITLE); + latestRB = new GRadioButton(MergeConstants.LATEST_TITLE); latestRB.setName(LATEST_BUTTON_NAME); latestRB.addItemListener(listener); - myRB = new JRadioButton(MergeConstants.MY_TITLE); + myRB = new GRadioButton(MergeConstants.MY_TITLE); myRB.setName(CHECKED_OUT_BUTTON_NAME); myRB.addItemListener(listener); - originalRB = new JRadioButton(MergeConstants.ORIGINAL_TITLE); + originalRB = new GRadioButton(MergeConstants.ORIGINAL_TITLE); originalRB.setName(ORIGINAL_BUTTON_NAME); originalRB.addItemListener(listener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalAddConflictPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalAddConflictPanel.java index 53cc046551..09c68737e8 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalAddConflictPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalAddConflictPanel.java @@ -22,6 +22,7 @@ import java.awt.event.ItemListener; import javax.swing.*; import docking.widgets.EmptyBorderButton; +import docking.widgets.button.GRadioButton; import docking.widgets.fieldpanel.FieldPanel; import docking.widgets.fieldpanel.internal.FieldPanelCoordinator; import docking.widgets.label.GIconLabel; @@ -224,19 +225,19 @@ class ExternalAddConflictPanel extends JPanel implements CodeFormatService { } }; - keepLatestRB = new JRadioButton(MergeConstants.LATEST_TITLE); + keepLatestRB = new GRadioButton(MergeConstants.LATEST_TITLE); keepLatestRB.setName(KEEP_LATEST_BUTTON_NAME); keepLatestRB.addItemListener(listener); - keepMyRB = new JRadioButton(MergeConstants.MY_TITLE); + keepMyRB = new GRadioButton(MergeConstants.MY_TITLE); keepMyRB.setName(KEEP_MY_BUTTON_NAME); keepMyRB.addItemListener(listener); - keepBothRB = new JRadioButton("Both"); + keepBothRB = new GRadioButton("Both"); keepBothRB.setName(KEEP_BOTH_BUTTON_NAME); keepBothRB.addItemListener(listener); - mergeBothRB = new JRadioButton("Merge"); + mergeBothRB = new GRadioButton("Merge"); mergeBothRB.setName(MERGE_BOTH_BUTTON_NAME); mergeBothRB.addItemListener(listener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ScrollingListChoicesPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ScrollingListChoicesPanel.java index c7d17c7381..606fe4c8fd 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ScrollingListChoicesPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ScrollingListChoicesPanel.java @@ -25,6 +25,7 @@ import javax.swing.border.TitledBorder; import javax.swing.event.ChangeListener; import javax.swing.table.TableModel; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GDLabel; import docking.widgets.table.AbstractSortedTableModel; import docking.widgets.table.GTable; @@ -253,7 +254,7 @@ class ListChoice extends JPanel { setLayout(new BorderLayout()); - rb = new JRadioButton("UNKNOWN"); + rb = new GRadioButton("UNKNOWN"); rb.addItemListener(radioButtonListener); group.add(rb); add(rb, BorderLayout.NORTH); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java index aa8899594b..664c48cd06 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java @@ -25,6 +25,8 @@ import javax.swing.border.Border; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import ghidra.app.merge.util.ConflictUtility; @@ -547,7 +549,7 @@ public class VariousChoicesPanel extends ConflictPanel { } } - private class MyRadioButton extends JRadioButton { + private class MyRadioButton extends GRadioButton { private final static long serialVersionUID = 1; /** @@ -592,7 +594,7 @@ public class VariousChoicesPanel extends ConflictPanel { } } - private class MyCheckBox extends JCheckBox { + private class MyCheckBox extends GCheckBox { private final static long serialVersionUID = 1; /** diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java index 01f466386d..132116589e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java @@ -24,6 +24,7 @@ import javax.swing.border.Border; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -105,7 +106,7 @@ public class VerticalChoicesPanel extends ConflictPanel { add(rowPanel, BorderLayout.CENTER); rowPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - JRadioButton rb = new JRadioButton(); + GRadioButton rb = new GRadioButton(); JCheckBox cb = new GCheckBox(); indent = Math.max(rb.getPreferredSize().width, cb.getPreferredSize().width); @@ -504,7 +505,7 @@ public class VerticalChoicesPanel extends ConflictPanel { } } - private class MyRadioButton extends JRadioButton { + private class MyRadioButton extends GRadioButton { private final static long serialVersionUID = 1; private int option; @@ -560,7 +561,7 @@ public class VerticalChoicesPanel extends ConflictPanel { } - private class MyCheckBox extends JCheckBox { + private class MyCheckBox extends GCheckBox { private final static long serialVersionUID = 1; private int option; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/BlockConflictPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/BlockConflictPanel.java index a7d7447845..246ad8c6dc 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/BlockConflictPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/BlockConflictPanel.java @@ -1,6 +1,5 @@ /* ### * 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. @@ -22,6 +21,8 @@ import java.awt.event.ItemListener; import javax.swing.*; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; + /** * Panel to show radio buttons to choose a name or a set of permissions * for a memory block, or to resolve the conflict for the image base @@ -89,6 +90,7 @@ class BlockConflictPanel extends JPanel { group = new ButtonGroup(); ItemListener itemListener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { listener.stateChanged(null); @@ -96,13 +98,13 @@ class BlockConflictPanel extends JPanel { } }; - latestRB = new JRadioButton("Latest"); + latestRB = new GRadioButton("Latest"); latestRB.setName(MemoryMergePanel.LATEST_BUTTON_NAME); latestRB.addItemListener(itemListener); - myRB = new JRadioButton("My"); + myRB = new GRadioButton("My"); myRB.addItemListener(itemListener); myRB.setName(MemoryMergePanel.MY_BUTTON_NAME); - originalRB = new JRadioButton("Original"); + originalRB = new GRadioButton("Original"); originalRB.addItemListener(itemListener); originalRB.setName(MemoryMergePanel.ORIGINAL_BUTTON_NAME); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/CommentsConflictPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/CommentsConflictPanel.java index 7fa5d2440d..b3d1ada111 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/CommentsConflictPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/CommentsConflictPanel.java @@ -1,6 +1,5 @@ /* ### * 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. @@ -16,15 +15,16 @@ */ package ghidra.app.merge.memory; -import ghidra.app.merge.MergeConstants; -import ghidra.util.layout.PairLayout; - import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.*; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; +import ghidra.app.merge.MergeConstants; +import ghidra.util.layout.PairLayout; + /** * Panel that shows the block comments; has radio buttons to choose * which comment to use. @@ -123,8 +123,9 @@ class CommentsConflictPanel extends JPanel { case MergeConstants.ORIGINAL: str = MergeConstants.ORIGINAL_TITLE; } - JRadioButton rb = new JRadioButton("Use comments from " + str); + GRadioButton rb = new GRadioButton("Use comments from " + str); rb.addItemListener(new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { listener.stateChanged(null); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/propertylist/ConflictPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/propertylist/ConflictPanel.java index c2c639ca7c..33e253fe85 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/propertylist/ConflictPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/propertylist/ConflictPanel.java @@ -22,6 +22,7 @@ import java.awt.event.ItemListener; import javax.swing.*; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import ghidra.app.merge.MergeConstants; @@ -140,9 +141,9 @@ class ConflictPanel extends JPanel { namePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 10, 5)); namePanel.add(propertyGroupLabel); - latestRB = new JRadioButton("Use " + MergeConstants.LATEST_TITLE); - myRB = new JRadioButton("Use " + MergeConstants.MY_TITLE); - originalRB = new JRadioButton("Use " + MergeConstants.ORIGINAL_TITLE); + latestRB = new GRadioButton("Use " + MergeConstants.LATEST_TITLE); + myRB = new GRadioButton("Use " + MergeConstants.MY_TITLE); + originalRB = new GRadioButton("Use " + MergeConstants.ORIGINAL_TITLE); latestRB.setName(LATEST_BUTTON_NAME); myRB.setName(CHECKED_OUT_BUTTON_NAME); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tool/ListingMergePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tool/ListingMergePanel.java index 9715e6dd65..6b731398d3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tool/ListingMergePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tool/ListingMergePanel.java @@ -24,6 +24,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import docking.widgets.EmptyBorderButton; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.fieldpanel.FieldPanel; import docking.widgets.fieldpanel.internal.FieldPanelCoordinator; import docking.widgets.fieldpanel.support.BackgroundColorModel; @@ -607,7 +608,7 @@ public class ListingMergePanel extends JPanel } -class LockComponent extends JCheckBox { +class LockComponent extends GCheckBox { private static final Icon lock = ResourceManager.loadImage("images/lock.gif"); private static final Icon unlock = ResourceManager.loadImage("images/unlock.gif"); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NameConflictsPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NameConflictsPanel.java index 3b702e644e..a1195cd901 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NameConflictsPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NameConflictsPanel.java @@ -22,6 +22,7 @@ import java.awt.event.ItemListener; import javax.swing.*; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GDLabel; import docking.widgets.label.GIconLabel; import ghidra.app.merge.MergeConstants; @@ -134,9 +135,9 @@ class NameConflictsPanel extends JPanel { iconPanel.add(conflictsLabel); iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); - keepOtherRB = new JRadioButton("Keep 'Other' Name"); - addOrRenameRB = new JRadioButton("Rename 'My' name to My.username"); - originalRB = new JRadioButton("Use 'Original' name"); + keepOtherRB = new GRadioButton("Keep 'Other' Name"); + addOrRenameRB = new GRadioButton("Rename 'My' name to My.username"); + originalRB = new GRadioButton("Use 'Original' name"); keepOtherRB.setName(ProgramTreeMergePanel.KEEP_OTHER_BUTTON_NAME); addOrRenameRB.setName(ProgramTreeMergePanel.RENAME_PRIVATE_BUTTON_NAME); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NamePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NamePanel.java index d151fb62aa..547c0afe4e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NamePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/NamePanel.java @@ -1,6 +1,5 @@ /* ### * 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. @@ -16,8 +15,6 @@ */ package ghidra.app.merge.tree; -import ghidra.app.merge.MergeConstants; - import java.awt.BorderLayout; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -25,6 +22,9 @@ import java.awt.event.ItemListener; import javax.swing.*; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; +import ghidra.app.merge.MergeConstants; + /** * Panel for resolving name conflicts among program trees when private * name of tree does not exist in destination program. @@ -88,10 +88,10 @@ class NamePanel extends JPanel { panel.setLayout(new BorderLayout()); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - keepOtherRB = new JRadioButton("Keep 'Other' Name"); - keepMyRB = new JRadioButton("Keep 'My' Name"); - newTreeRB = new JRadioButton("Add New Tree"); - originalRB = new JRadioButton("Use Original Name"); + keepOtherRB = new GRadioButton("Keep 'Other' Name"); + keepMyRB = new GRadioButton("Keep 'My' Name"); + newTreeRB = new GRadioButton("Add New Tree"); + originalRB = new GRadioButton("Use Original Name"); keepOtherRB.setName(ProgramTreeMergePanel.KEEP_OTHER_BUTTON_NAME); keepMyRB.setName(ProgramTreeMergePanel.KEEP_PRIVATE_BUTTON_NAME); @@ -112,6 +112,7 @@ class NamePanel extends JPanel { add(panel); ItemListener itemListener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { if (listener != null) { listener.stateChanged(null); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java index 5c39bcfefd..9e0f360ed9 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java @@ -27,6 +27,7 @@ import javax.swing.text.Document; import docking.ToolTipManager; import docking.widgets.OptionDialog; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import ghidra.program.model.data.Category; @@ -332,9 +333,9 @@ public class CompEditorPanel extends CompositeEditorPanel { } private void setupMinimumAlignment() { - defaultMinAlignButton = new JRadioButton("none "); - machineMinAlignButton = new JRadioButton("machine "); - byValueMinAlignButton = new JRadioButton(); + defaultMinAlignButton = new GRadioButton("none "); + machineMinAlignButton = new GRadioButton("machine "); + byValueMinAlignButton = new GRadioButton(); minAlignValueTextField = new JTextField(); setupDefaultMinAlignButton(); setupMachineMinAlignButton(); @@ -519,8 +520,8 @@ public class CompEditorPanel extends CompositeEditorPanel { } private void setupPacking() { - noPackingButton = new JRadioButton("none "); - byValuePackingButton = new JRadioButton(); + noPackingButton = new GRadioButton("none "); + byValuePackingButton = new GRadioButton(); packingValueTextField = new JTextField(); setupNoPackingButton(); setupByValuePackingButton(); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java index 8a9352c783..9870ed7fe1 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java @@ -29,6 +29,7 @@ import javax.swing.text.BadLocationException; import javax.swing.text.Document; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.table.*; import ghidra.app.services.DataTypeManagerService; import ghidra.app.util.ToolTipUtils; @@ -245,8 +246,8 @@ public class CreateStructureDialog extends DialogComponentProvider { matchingStylePanel.setBorder( new TitledBorder(BorderFactory.createEmptyBorder(), "Matching: ")); - exactMatchButton = new JRadioButton("Exact"); - sizeMatchButton = new JRadioButton("Size"); + exactMatchButton = new GRadioButton("Exact"); + sizeMatchButton = new GRadioButton("Size"); exactMatchButton.setToolTipText( "Match structures with the same " + "number and type of data elements"); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/util/ConflictDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/util/ConflictDialog.java index 06fac15b08..6a80ab4935 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/util/ConflictDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/util/ConflictDialog.java @@ -21,6 +21,7 @@ import java.awt.event.*; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GIconLabel; import docking.widgets.label.GLabel; import ghidra.util.HelpLocation; @@ -119,9 +120,9 @@ public class ConflictDialog extends DialogComponentProvider { }; ButtonGroup bg = new ButtonGroup(); - renameRB = new JRadioButton("Rename new data type to " + newDTName, true); - replaceRB = new JRadioButton("Replace existing data type"); - useExistingRB = new JRadioButton("Use existing data type"); + renameRB = new GRadioButton("Rename new data type to " + newDTName, true); + replaceRB = new GRadioButton("Replace existing data type"); + useExistingRB = new GRadioButton("Use existing data type"); renameRB.addItemListener(listener); useExistingRB.addItemListener(listener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/FilterAction.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/FilterAction.java index dfb36aa7c4..f98cfec86a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/FilterAction.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/FilterAction.java @@ -26,6 +26,7 @@ import javax.swing.*; import docking.*; import docking.action.ToggleDockingAction; import docking.action.ToolBarData; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GHtmlCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.filter.FilterListener; @@ -243,11 +244,11 @@ class FilterAction extends ToggleDockingAction { JPanel enablePanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); ButtonGroup group = new ButtonGroup(); - enableButton = new JRadioButton("Enabled", true); + enableButton = new GRadioButton("Enabled", true); enableButton.addKeyListener(listener); enablePanel.add(enableButton); group.add(enableButton); - disableButton = new JRadioButton("Disabled", false); + disableButton = new GRadioButton("Disabled", false); disableButton.addKeyListener(listener); enablePanel.add(disableButton); group.add(disableButton); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/ProcessorStateDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/ProcessorStateDialog.java index 893b2f387d..c159112dff 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/ProcessorStateDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/ProcessorStateDialog.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GLabel; import ghidra.app.util.bean.FixedBitSizeValueField; import ghidra.program.model.lang.Register; @@ -77,8 +78,8 @@ public class ProcessorStateDialog extends DialogComponentProvider { mainPanel.add(scrollPane, BorderLayout.CENTER); JPanel radioPanel = new JPanel(new FlowLayout()); mainPanel.add(radioPanel, BorderLayout.SOUTH); - JRadioButton hexButton = new JRadioButton("Hex"); - JRadioButton decimalButton = new JRadioButton("Decimal"); + GRadioButton hexButton = new GRadioButton("Hex"); + GRadioButton decimalButton = new GRadioButton("Decimal"); hexButton.setSelected(true); ButtonGroup group = new ButtonGroup(); group.add(hexButton); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/fallthrough/FallThroughDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/fallthrough/FallThroughDialog.java index 104acb029a..489f2966a2 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/fallthrough/FallThroughDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/fallthrough/FallThroughDialog.java @@ -27,6 +27,7 @@ import javax.swing.event.ChangeListener; import docking.DialogComponentProvider; import docking.ToolTipManager; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GDLabel; import ghidra.app.util.AddressInput; import ghidra.program.model.address.Address; @@ -231,7 +232,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene panel.setLayout(bl); ButtonGroup group = new ButtonGroup(); - defaultRB = new JRadioButton("Default", true); + defaultRB = new GRadioButton("Default", true); defaultRB.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ev) { @@ -240,7 +241,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene }); ToolTipManager.setToolTipText(defaultRB, "Use default fallthrough address"); - userRB = new JRadioButton("User", false); + userRB = new GRadioButton("User", false); userRB.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ev) { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SearchDirectionWidget.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SearchDirectionWidget.java index e3dc961cbf..d074e4b3e1 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SearchDirectionWidget.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SearchDirectionWidget.java @@ -20,6 +20,8 @@ import java.awt.event.ActionEvent; import javax.swing.*; +import docking.widgets.button.GRadioButton; + /** * Allows the user to define a custom search range for the {@link InstructionSearchDialog}. * @@ -126,7 +128,7 @@ public class SearchDirectionWidget extends ControlPanelWidget { * @return */ private JRadioButton createSearchRB(AbstractAction action, String name, String tooltip) { - JRadioButton button = new JRadioButton(action); + GRadioButton button = new GRadioButton(action); button.setText(name); button.setToolTipText(tooltip); button.setAlignmentX(Component.LEFT_ALIGNMENT); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionModeWidget.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionModeWidget.java index d2b516a6ed..edbfbdaaf2 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionModeWidget.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionModeWidget.java @@ -22,6 +22,7 @@ import java.util.List; import javax.swing.*; +import docking.widgets.button.GRadioButton; import ghidra.app.plugin.core.instructionsearch.util.InstructionSearchUtils; /** @@ -59,8 +60,8 @@ public class SelectionModeWidget extends ControlPanelWidget { @Override protected JPanel createContent() { JPanel rbPanel = new JPanel(); - hexRB = new JRadioButton("hex"); - binaryRB = new JRadioButton("binary"); + hexRB = new GRadioButton("hex"); + binaryRB = new GRadioButton("binary"); ButtonGroup inputGroup = new ButtonGroup(); inputGroup.add(hexRB); inputGroup.add(binaryRB); @@ -93,15 +94,17 @@ public class SelectionModeWidget extends ControlPanelWidget { // 1. Get the whitespace map so we can restore it after conversion. // 2. Get the group map so we can group bytes just as in the hex display. // 3. Convert and display. - List whitespaces = InstructionSearchUtils.getWhitespace(parent.getInputString().trim()); + List whitespaces = + InstructionSearchUtils.getWhitespace(parent.getInputString().trim()); List groups; try { - groups = - InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(), InputMode.BINARY); + groups = InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(), + InputMode.BINARY); // Now convert whatever is in the input box to binary. - String hexStr = InstructionSearchUtils.toHex(parent.getInputString().trim(), true); + String hexStr = + InstructionSearchUtils.toHex(parent.getInputString().trim(), true); // Restore grouping. hexStr = @@ -139,15 +142,17 @@ public class SelectionModeWidget extends ControlPanelWidget { // 1. Get the whitespace map so we can restore it after conversion. // 2. Get the group map so we can group bytes just as in the hex display. // 3. Convert and display. - List whitespaces = InstructionSearchUtils.getWhitespace(parent.getInputString().trim()); + List whitespaces = + InstructionSearchUtils.getWhitespace(parent.getInputString().trim()); List groups; try { - groups = - InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(), InputMode.HEX); + groups = InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(), + InputMode.HEX); // Now convert whatever is in the input box to binary. - String binaryStr = InstructionSearchUtils.toBinary(parent.getInputString().trim()); + String binaryStr = + InstructionSearchUtils.toBinary(parent.getInputString().trim()); // Restore grouping. binaryStr = restoreGroupingAndWhitespace(binaryStr, groups, whitespaces, @@ -176,9 +181,9 @@ public class SelectionModeWidget extends ControlPanelWidget { inputMode = InputMode.HEX; } else if (binaryRB.isSelected()) { - inputMode = InputMode.BINARY; + inputMode = InputMode.BINARY; } - + return inputMode; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionScopeWidget.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionScopeWidget.java index d880c7e92c..70ce48205a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionScopeWidget.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionScopeWidget.java @@ -21,6 +21,7 @@ import java.util.*; import javax.swing.*; +import docking.widgets.button.GRadioButton; import ghidra.app.plugin.core.instructionsearch.InstructionSearchPlugin; import ghidra.program.model.address.AddressRange; import ghidra.program.model.address.AddressRangeIterator; @@ -36,7 +37,7 @@ public class SelectionScopeWidget extends ControlPanelWidget { private JRadioButton searchSelectionRB; // Stores the current search range settings. - private List searchRanges = new ArrayList(); + private List searchRanges = new ArrayList<>(); private InstructionSearchDialog dialog; private InstructionSearchPlugin plugin; @@ -183,7 +184,7 @@ public class SelectionScopeWidget extends ControlPanelWidget { * @return */ private JRadioButton createSearchRB(AbstractAction action, String name, String tooltip) { - JRadioButton button = new JRadioButton(action); + GRadioButton button = new GRadioButton(action); button.setName(name); button.setText(name); button.setToolTipText(tooltip); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/AddBlockDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/AddBlockDialog.java index 99b87d2ac0..00ee426751 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/AddBlockDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/AddBlockDialog.java @@ -22,6 +22,7 @@ import javax.swing.*; import javax.swing.event.*; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; @@ -379,11 +380,11 @@ class AddBlockDialog extends DialogComponentProvider implements ChangeListener { panel.setLayout(bl); ButtonGroup radioGroup = new ButtonGroup(); - initializedRB = new JRadioButton("Initialized", false); + initializedRB = new GRadioButton("Initialized", false); initializedRB.setName(initializedRB.getText()); initializedRB.addActionListener(ev -> initializeRBChanged()); - uninitializedRB = new JRadioButton("Uninitialized", true); + uninitializedRB = new GRadioButton("Uninitialized", true); uninitializedRB.setName(uninitializedRB.getText()); uninitializedRB.addActionListener(ev -> uninitializedRBChanged()); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/printing/PrintOptionsDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/printing/PrintOptionsDialog.java index 2cde2fe378..6ea1b7ed7a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/printing/PrintOptionsDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/printing/PrintOptionsDialog.java @@ -21,6 +21,7 @@ import java.awt.event.*; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import ghidra.util.HelpLocation; @@ -85,16 +86,16 @@ public class PrintOptionsDialog extends DialogComponentProvider { group = new ButtonGroup(); - selection = new JRadioButton("Selected area(s)"); + selection = new GRadioButton("Selected area(s)"); selection.addKeyListener(key); rangePanel.add(selection); group.add(selection); selection.setEnabled(selectionEnabled); - visible = new JRadioButton("Code visible on screen"); + visible = new GRadioButton("Code visible on screen"); visible.addKeyListener(key); rangePanel.add(visible); group.add(visible); - view = new JRadioButton("Current view"); + view = new GRadioButton("Current view"); view.addKeyListener(key); rangePanel.add(view); group.add(view); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferenceDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferenceDialog.java index 44084b368d..b4a55f4b46 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferenceDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferenceDialog.java @@ -15,15 +15,6 @@ */ package ghidra.app.plugin.core.references; -import ghidra.framework.options.SaveState; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSetView; -import ghidra.program.model.listing.CodeUnit; -import ghidra.program.model.listing.Program; -import ghidra.program.model.symbol.Reference; -import ghidra.util.HelpLocation; -import ghidra.util.exception.AssertException; - import java.awt.*; import javax.swing.*; @@ -34,6 +25,15 @@ import javax.swing.event.ChangeListener; import org.jdom.Element; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; +import ghidra.framework.options.SaveState; +import ghidra.program.model.address.Address; +import ghidra.program.model.address.AddressSetView; +import ghidra.program.model.listing.CodeUnit; +import ghidra.program.model.listing.Program; +import ghidra.program.model.symbol.Reference; +import ghidra.util.HelpLocation; +import ghidra.util.exception.AssertException; public class EditReferenceDialog extends DialogComponentProvider { @@ -98,26 +98,24 @@ public class EditReferenceDialog extends DialogComponentProvider { JPanel topPanel = new JPanel(new BorderLayout()); - instrPanel = - new InstructionPanel(5, 5, 5, 5, null, plugin, - new InstructionPanelListener() { - @Override - public boolean dropSupported() { - return false; - } + instrPanel = new InstructionPanel(5, 5, 5, 5, null, plugin, new InstructionPanelListener() { + @Override + public boolean dropSupported() { + return false; + } - @Override - public void operandSelected(int opIndex, int subIndex) { - if (!initializing) { - setAddOpIndex(opIndex, subIndex); - } - } + @Override + public void operandSelected(int opIndex, int subIndex) { + if (!initializing) { + setAddOpIndex(opIndex, subIndex); + } + } - @Override - public void selectionDropped(AddressSetView set, CodeUnit cu, int opIndex) { - throw new UnsupportedOperationException(); - } - }); + @Override + public void selectionDropped(AddressSetView set, CodeUnit cu, int opIndex) { + throw new UnsupportedOperationException(); + } + }); topPanel.add(instrPanel, BorderLayout.NORTH); JPanel refTypePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5)); @@ -135,13 +133,13 @@ public class EditReferenceDialog extends DialogComponentProvider { } }; - memRefChoice = new JRadioButton("Memory"); + memRefChoice = new GRadioButton("Memory"); memRefChoice.addChangeListener(refChoiceListener); - extRefChoice = new JRadioButton("External"); + extRefChoice = new GRadioButton("External"); extRefChoice.addChangeListener(refChoiceListener); - stackRefChoice = new JRadioButton("Stack"); + stackRefChoice = new GRadioButton("Stack"); stackRefChoice.addChangeListener(refChoiceListener); - regRefChoice = new JRadioButton("Register"); + regRefChoice = new GRadioButton("Register"); regRefChoice.addChangeListener(refChoiceListener); ButtonGroup refChoices = new ButtonGroup(); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/scalartable/ScalarSearchDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/scalartable/ScalarSearchDialog.java index 85dbc20ec0..4aa0da11ba 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/scalartable/ScalarSearchDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/scalartable/ScalarSearchDialog.java @@ -24,6 +24,7 @@ import javax.swing.border.TitledBorder; import docking.DialogComponentProvider; import docking.DockingWindowManager; import docking.help.HelpService; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GLabel; import docking.widgets.textfield.IntegerTextField; import ghidra.app.plugin.core.scalartable.RangeFilterTextField.FilterType; @@ -143,8 +144,8 @@ public class ScalarSearchDialog extends DialogComponentProvider { panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.setBorder(new TitledBorder("Search Scope")); - searchSelectionRadioButton = new JRadioButton("Search Selection"); - searchAllRadioButton = new JRadioButton("Search All"); + searchSelectionRadioButton = new GRadioButton("Search Selection"); + searchAllRadioButton = new GRadioButton("Search All"); searchSelectionRadioButton.setToolTipText("Search only the current selection"); searchAllRadioButton.setToolTipText("Search the entire program"); @@ -258,8 +259,8 @@ public class ScalarSearchDialog extends DialogComponentProvider { setLayout(new BorderLayout()); setBorder(new TitledBorder("Search Type")); - searchAllScalars = new JRadioButton("Scalars in Range:"); - searchAScalar = new JRadioButton("Specific Scalar:"); + searchAllScalars = new GRadioButton("Scalars in Range:"); + searchAScalar = new GRadioButton("Specific Scalar:"); searchAllScalars.setToolTipText( "Search program (or selection) for scalar operands or defined scalar data types with values in the following range:"); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/DecimalSearchFormat.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/DecimalSearchFormat.java index cc97907a7b..7d07f69dd3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/DecimalSearchFormat.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/DecimalSearchFormat.java @@ -15,9 +15,6 @@ */ package ghidra.app.plugin.core.searchmem; -import ghidra.util.HTMLUtilities; -import ghidra.util.exception.AssertException; - import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -27,16 +24,20 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import docking.widgets.button.GRadioButton; +import ghidra.util.HTMLUtilities; +import ghidra.util.exception.AssertException; + public class DecimalSearchFormat extends SearchFormat { private static final String MINUS_SIGN = "-"; private static final int BYTE = 0; - private static final int WORD = 1; - private static final int DWORD = 2; - private static final int QWORD = 3; - private static final int FLOAT = 4; - private static final int DOUBLE = 5; - + private static final int WORD = 1; + private static final int DWORD = 2; + private static final int QWORD = 3; + private static final int FLOAT = 4; + private static final int DOUBLE = 5; + private int decimalFormat = WORD; public DecimalSearchFormat(ChangeListener listener) { @@ -44,53 +45,59 @@ public class DecimalSearchFormat extends SearchFormat { } @Override - public String getToolTip() { + public String getToolTip() { return HTMLUtilities.toHTML( - "Interpret values as a sequence of\n"+ - "decimal numbers, separated by spaces"); + "Interpret values as a sequence of\n" + "decimal numbers, separated by spaces"); } private void setDecimalFormat(int format) { decimalFormat = format; changeListener.stateChanged(new ChangeEvent(this)); } + @Override - public JPanel getOptionsPanel() { + public JPanel getOptionsPanel() { ButtonGroup decimalGroup = new ButtonGroup(); - JRadioButton decimalByte = new JRadioButton("Byte", false); - JRadioButton decimalWord = new JRadioButton("Word", true); - JRadioButton decimalDWord = new JRadioButton("DWord", false); - JRadioButton decimalQWord = new JRadioButton("QWord", false); - JRadioButton decimalFloat = new JRadioButton("Float", false); - JRadioButton decimalDouble = new JRadioButton("Double", false); + GRadioButton decimalByte = new GRadioButton("Byte", false); + GRadioButton decimalWord = new GRadioButton("Word", true); + GRadioButton decimalDWord = new GRadioButton("DWord", false); + GRadioButton decimalQWord = new GRadioButton("QWord", false); + GRadioButton decimalFloat = new GRadioButton("Float", false); + GRadioButton decimalDouble = new GRadioButton("Double", false); decimalByte.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent ev) { setDecimalFormat(BYTE); } }); decimalWord.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent ev) { setDecimalFormat(WORD); } }); decimalDWord.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent ev) { setDecimalFormat(DWORD); } }); decimalQWord.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent ev) { setDecimalFormat(QWORD); } }); decimalFloat.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent ev) { setDecimalFormat(FLOAT); } }); decimalDouble.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent ev) { setDecimalFormat(DOUBLE); } @@ -111,35 +118,37 @@ public class DecimalSearchFormat extends SearchFormat { decimalOptionsPanel.add(decimalQWord); decimalOptionsPanel.add(decimalFloat); decimalOptionsPanel.add(decimalDouble); - decimalOptionsPanel.setBorder(BorderFactory - .createTitledBorder("Format Options")); + decimalOptionsPanel.setBorder(BorderFactory.createTitledBorder("Format Options")); return decimalOptionsPanel; } @Override - public SearchData getSearchData( String input ) { - List bytesList = new ArrayList(); + public SearchData getSearchData(String input) { + List bytesList = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(input); - while (tokenizer.hasMoreTokens()) { - String tok = tokenizer.nextToken(); - if (tok.equals(MINUS_SIGN)) { - if ( !input.endsWith(MINUS_SIGN) ) { - return SearchData.createInvalidInputSearchData( "Cannot have space after a '-'" ); - } - return SearchData.createIncompleteSearchData( "" ); - } - try { - bytesList.addAll(getBytes(tok)); - } catch (NumberFormatException ex) { - return SearchData.createInvalidInputSearchData(""); - } catch ( RuntimeException re ) { - return SearchData.createInvalidInputSearchData(re.getMessage()); - } - } - return SearchData.createSearchData( input, getDataBytes(bytesList), null ); + while (tokenizer.hasMoreTokens()) { + String tok = tokenizer.nextToken(); + if (tok.equals(MINUS_SIGN)) { + if (!input.endsWith(MINUS_SIGN)) { + return SearchData.createInvalidInputSearchData("Cannot have space after a '-'"); + } + return SearchData.createIncompleteSearchData(""); + } + try { + bytesList.addAll(getBytes(tok)); + } + catch (NumberFormatException ex) { + return SearchData.createInvalidInputSearchData(""); + } + catch (RuntimeException re) { + return SearchData.createInvalidInputSearchData(re.getMessage()); + } + } + return SearchData.createSearchData(input, getDataBytes(bytesList), null); } + private byte[] getDataBytes(List bytesList) { byte[] bytes = new byte[bytesList.size()]; for (int i = 0; i < bytes.length; i++) { @@ -149,10 +158,10 @@ public class DecimalSearchFormat extends SearchFormat { } private List getBytes(long value, int n) { - List list = new ArrayList(); + List list = new ArrayList<>(); - for(int i=0;i>= 8; } @@ -161,68 +170,66 @@ public class DecimalSearchFormat extends SearchFormat { } return list; } - - private void checkValue(long value, long min, long max) { - if ( value < min || value > max ) { - // I know, icky - throw new RuntimeException( "Number must be in the range [" + min + "," + max + "]" ); - } - } - - private List getBytes(String tok) { - switch(decimalFormat) { - case BYTE: - long value = Short.parseShort(tok); - checkValue( value, Byte.MIN_VALUE, 255 ); - return getBytes(value, 1); - case WORD: - value = Integer.parseInt(tok); - checkValue( value, Short.MIN_VALUE, 65535 ); - return getBytes(value, 2); - case DWORD: - value = Long.parseLong(tok); - checkValue( value, Integer.MIN_VALUE, 4294967295l ); - return getBytes(value, 4); - case QWORD: - value = Long.parseLong(tok); - return getBytes(value, 8); - case FLOAT: - tok = preProcessFloat(tok); - float floatValue = Float.parseFloat(tok); - value = Float.floatToIntBits(floatValue); - return getBytes(value, 4); - case DOUBLE: - tok = preProcessFloat(tok); - double dvalue = Double.parseDouble(tok); - value = Double.doubleToLongBits(dvalue); - return getBytes(value, 8); - default: - throw new AssertException("Unexpected format type"); - } - } - - /** - * Checks for parsable characters that we don't want to allow (dDfF) and removes - * the start of an exponent expression (example 2.34e would become 2.34. So woudl 2.34-) - * @param the string that will be parsed into a float or double - * @return the parsable string - * @exception NumberFormatException thrown if the the tok contains any of "dDfF". - */ - private String preProcessFloat(String tok) { - if ((tok.indexOf('d') >= 0) || - (tok.indexOf('D') >= 0) || - (tok.indexOf('F') >= 0) || - (tok.indexOf('f') >= 0)) { - throw new NumberFormatException(); - } - if (tok.endsWith("E") || tok.endsWith("e")) { - tok = tok.substring(0,tok.length()-1); - } - if (tok.endsWith("E-") || tok.endsWith("e-")) { - tok = tok.substring(0,tok.length()-2); - } - return tok; - } - + private void checkValue(long value, long min, long max) { + if (value < min || value > max) { + // I know, icky + throw new RuntimeException("Number must be in the range [" + min + "," + max + "]"); + } + } + + private List getBytes(String tok) { + switch (decimalFormat) { + case BYTE: + long value = Short.parseShort(tok); + checkValue(value, Byte.MIN_VALUE, 255); + return getBytes(value, 1); + case WORD: + value = Integer.parseInt(tok); + checkValue(value, Short.MIN_VALUE, 65535); + return getBytes(value, 2); + case DWORD: + value = Long.parseLong(tok); + checkValue(value, Integer.MIN_VALUE, 4294967295l); + return getBytes(value, 4); + case QWORD: + value = Long.parseLong(tok); + return getBytes(value, 8); + case FLOAT: + tok = preProcessFloat(tok); + float floatValue = Float.parseFloat(tok); + value = Float.floatToIntBits(floatValue); + return getBytes(value, 4); + case DOUBLE: + tok = preProcessFloat(tok); + double dvalue = Double.parseDouble(tok); + value = Double.doubleToLongBits(dvalue); + return getBytes(value, 8); + default: + throw new AssertException("Unexpected format type"); + } + } + + /** + * Checks for parsable characters that we don't want to allow (dDfF) and removes + * the start of an exponent expression (example 2.34e would become 2.34. So woudl 2.34-) + * @param the string that will be parsed into a float or double + * @return the parsable string + * @exception NumberFormatException thrown if the the tok contains any of "dDfF". + */ + private String preProcessFloat(String tok) { + if ((tok.indexOf('d') >= 0) || (tok.indexOf('D') >= 0) || (tok.indexOf('F') >= 0) || + (tok.indexOf('f') >= 0)) { + throw new NumberFormatException(); + } + if (tok.endsWith("E") || tok.endsWith("e")) { + tok = tok.substring(0, tok.length() - 1); + } + if (tok.endsWith("E-") || tok.endsWith("e-")) { + tok = tok.substring(0, tok.length() - 2); + } + + return tok; + } + } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/MemSearchDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/MemSearchDialog.java index 7f461d2e3b..c835b73795 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/MemSearchDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/MemSearchDialog.java @@ -27,6 +27,7 @@ import javax.swing.event.ChangeListener; import javax.swing.text.*; import docking.*; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; @@ -396,8 +397,8 @@ class MemSearchDialog extends DialogComponentProvider { private Container buildEndienessPanel() { ButtonGroup endianGroup = new ButtonGroup(); - littleEndian = new JRadioButton("Little Endian", true); - bigEndian = new JRadioButton("Big Endian", false); + littleEndian = new GRadioButton("Little Endian", true); + bigEndian = new GRadioButton("Big Endian", false); endianGroup.add(bigEndian); endianGroup.add(littleEndian); @@ -450,8 +451,8 @@ class MemSearchDialog extends DialogComponentProvider { panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.setBorder(new TitledBorder("Selection Scope")); - searchSelectionRadioButton = new JRadioButton("Search Selection"); - searchAllRadioButton = new JRadioButton("Search All"); + searchSelectionRadioButton = new GRadioButton("Search Selection"); + searchAllRadioButton = new GRadioButton("Search All"); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(searchSelectionRadioButton); @@ -497,7 +498,7 @@ class MemSearchDialog extends DialogComponentProvider { }; for (SearchFormat element : allFormats) { - JRadioButton formatButton = new JRadioButton(element.getName(), true); + GRadioButton formatButton = new GRadioButton(element.getName(), true); formatButton.setToolTipText(element.getToolTip()); formatGroup.add(formatButton); @@ -574,8 +575,8 @@ class MemSearchDialog extends DialogComponentProvider { */ private JPanel buildExtrasPanel() { ButtonGroup memoryBlockGroup = new ButtonGroup(); - loadedBlocks = new JRadioButton("Loaded Blocks", true); - allBlocks = new JRadioButton("All Blocks", false); + loadedBlocks = new GRadioButton("Loaded Blocks", true); + allBlocks = new GRadioButton("All Blocks", false); memoryBlockGroup.add(loadedBlocks); memoryBlockGroup.add(allBlocks); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/SearchTextDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/SearchTextDialog.java index 4fc43c0ca1..e1eeb628c6 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/SearchTextDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/SearchTextDialog.java @@ -26,6 +26,7 @@ import javax.swing.border.Border; import javax.swing.text.*; import docking.*; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GLabel; @@ -345,14 +346,14 @@ class SearchTextDialog extends DialogComponentProvider { JPanel radioPanel = new JPanel(new VerticalLayout(10)); ButtonGroup bg = new ButtonGroup(); - searchFieldRB = new JRadioButton("Selected Fields", true); + searchFieldRB = new GRadioButton("Selected Fields", true); searchFieldRB.setToolTipText(HTMLUtilities.toHTML("Search for specific fields. Use the\n" + "checkboxes to mark which fields to search.\n" + "This option applies to either the Program Database Search\n" + "or the Listing Display Match Search.\n\n" + "NOTE: Selecting all of these fields is NOT the same as selecting \"All Fields\".\n")); - searchAllRB = new JRadioButton("All Fields", false); + searchAllRB = new GRadioButton("All Fields", false); searchAllRB.setToolTipText( HTMLUtilities.toHTML("Search all the fields displayed in the Code Browser.\n" + "The option applies only to the Listing Display Search.")); @@ -389,7 +390,7 @@ class SearchTextDialog extends DialogComponentProvider { ButtonGroup bg = new ButtonGroup(); - programDatabaseSearchRB = new JRadioButton("Program Database", true); + programDatabaseSearchRB = new GRadioButton("Program Database", true); programDatabaseSearchRB.setToolTipText(HTMLUtilities.toHTML( "Searches comments, labels, instructions, function signatures, and data stored in the" + " program database.\n This search is much faster, but does not search all text displayed in the Code Browser\n" + @@ -406,7 +407,7 @@ class SearchTextDialog extends DialogComponentProvider { changingState = false; }); - listingDisplaySearchRB = new JRadioButton("Listing Display", false); + listingDisplaySearchRB = new GRadioButton("Listing Display", false); listingDisplaySearchRB.setToolTipText( HTMLUtilities.toHTML("Searches the text displayed in the Code Browser\n" + "Listing Display. (Depending on which fields are selected)\n" + @@ -433,9 +434,9 @@ class SearchTextDialog extends DialogComponentProvider { directionPanel.setBorder(BorderFactory.createTitledBorder("Memory Block Types")); ButtonGroup directionGroup = new ButtonGroup(); - loadedBlocksButton = new JRadioButton("Loaded Blocks", true); + loadedBlocksButton = new GRadioButton("Loaded Blocks", true); - allBlocksButton = new JRadioButton("All Blocks", false); + allBlocksButton = new GRadioButton("All Blocks", false); loadedBlocksButton.setToolTipText(HTMLUtilities.toHTML( "Only searches memory blocks that are loaded in a running executable.\n " + "Ghidra now includes memory blocks for other data such as section headers.\n" + diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/select/SelectBlockDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/select/SelectBlockDialog.java index 9d0dfcecff..d27ae59515 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/select/SelectBlockDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/select/SelectBlockDialog.java @@ -24,6 +24,7 @@ import javax.swing.*; import docking.ComponentProvider; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GLabel; import docking.widgets.textfield.IntegerTextField; import ghidra.app.nav.Navigatable; @@ -116,7 +117,7 @@ class SelectBlockDialog extends DialogComponentProvider { gbc.insets = new Insets(2, 2, 2, 2); gbc.anchor = GridBagConstraints.WEST; - forwardButton = new JRadioButton("Select Forward", true); + forwardButton = new GRadioButton("Select Forward", true); forwardButton.setName("forwardButton"); forwardButton.addActionListener(new ActionListener() { @Override @@ -127,7 +128,7 @@ class SelectBlockDialog extends DialogComponentProvider { } }); buttonGroup.add(forwardButton); - backwardButton = new JRadioButton("Select Backward"); + backwardButton = new GRadioButton("Select Backward"); backwardButton.setName("backwardButton"); backwardButton.addActionListener(new ActionListener() { @Override @@ -138,7 +139,7 @@ class SelectBlockDialog extends DialogComponentProvider { } }); buttonGroup.add(backwardButton); - allButton = new JRadioButton("Select All"); + allButton = new GRadioButton("Select All"); allButton.setName("allButton"); allButton.addActionListener(new ActionListener() { @Override @@ -149,7 +150,7 @@ class SelectBlockDialog extends DialogComponentProvider { }); buttonGroup.add(allButton); - toButton = new JRadioButton("To Address"); + toButton = new GRadioButton("To Address"); toButton.setName("toButton"); toButton.addActionListener(new ActionListener() { @Override diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/SearchStringDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/SearchStringDialog.java index 9be56e1bc0..e15c7c2257 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/SearchStringDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/SearchStringDialog.java @@ -26,6 +26,7 @@ import javax.swing.border.TitledBorder; import docking.DialogComponentProvider; import docking.options.editor.ButtonPanelFactory; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.label.GLabel; @@ -267,8 +268,8 @@ public class SearchStringDialog extends DialogComponentProvider { panel.setBorder(BorderFactory.createTitledBorder("Memory Block Types")); ButtonGroup memoryBlockGroup = new ButtonGroup(); - loadedBlocksRB = new JRadioButton("Loaded Blocks", true); - allBlocksRB = new JRadioButton("All Blocks", false); + loadedBlocksRB = new GRadioButton("Loaded Blocks", true); + allBlocksRB = new GRadioButton("All Blocks", false); memoryBlockGroup.add(loadedBlocksRB); memoryBlockGroup.add(allBlocksRB); @@ -296,8 +297,8 @@ public class SearchStringDialog extends DialogComponentProvider { panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.setBorder(new TitledBorder("Selection Scope")); - searchSelectionRB = new JRadioButton("Search Selection"); - searchAllRB = new JRadioButton("Search All"); + searchSelectionRB = new GRadioButton("Search Selection"); + searchAllRB = new GRadioButton("Search All"); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(searchSelectionRB); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/SetEquateDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/SetEquateDialog.java index 8391ddc5a9..6ddb9fd2b5 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/SetEquateDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/SetEquateDialog.java @@ -28,6 +28,7 @@ import javax.swing.table.TableColumnModel; import org.apache.commons.lang3.StringUtils; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.filter.FilterListener; import docking.widgets.label.GDLabel; @@ -229,16 +230,16 @@ public class SetEquateDialog extends DialogComponentProvider { titleLabel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); //long value = scalar.getSignedValue(); - applyToCurrent = new JRadioButton("Current location", true); + applyToCurrent = new GRadioButton("Current location", true); applyToCurrent.setName("applyToCurrent"); applyToCurrent.setToolTipText("Apply to current scalar operand only"); - applyToSelection = new JRadioButton("Current selection", false); + applyToSelection = new GRadioButton("Current selection", false); applyToSelection.setName("applyToSelection"); applyToSelection.setToolTipText( "Apply to all matching, defined scalar code " + "units in current selection."); - applyToAll = new JRadioButton("Entire program", false); + applyToAll = new GRadioButton("Entire program", false); applyToAll.setName("applyToAll"); applyToAll.setToolTipText( "Apply to all matching, defined scalar code units " + "in entire program."); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/GhidraScriptSelectionDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/GhidraScriptSelectionDialog.java index 2171d04430..9dc5562200 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/GhidraScriptSelectionDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/GhidraScriptSelectionDialog.java @@ -21,6 +21,7 @@ import javax.swing.*; import javax.swing.border.Border; import docking.widgets.*; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GLabel; import docking.widgets.textfield.IntegerTextField; import generic.jar.ResourceFile; @@ -61,7 +62,7 @@ public class GhidraScriptSelectionDialog extends ListSelectionDialog tool.showDialog(ancillaryFilterDialog, component)); - ancillaryFilterButton.setIcon(FILTER_ICON); ancillaryFilterButton.setToolTipText("Filters Dialog"); parentPanel.add(ancillaryFilterButton, BorderLayout.EAST); 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 e65a92534e..2e98881e14 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 @@ -28,6 +28,7 @@ import javax.swing.border.TitledBorder; import docking.DockingWindowManager; import docking.help.HelpService; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GDLabel; @@ -843,7 +844,7 @@ public class ApplyMarkupPropertyEditor implements OptionsEditor { } private JRadioButton createRadioButton(final String optionName) { - final JRadioButton applyRadioButton = new JRadioButton(optionName); + final GRadioButton applyRadioButton = new GRadioButton(optionName); applyRadioButton.addActionListener(e -> changesMade(true)); return applyRadioButton; diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMatchTableProvider.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMatchTableProvider.java index f31499f45f..b2e5028145 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMatchTableProvider.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMatchTableProvider.java @@ -352,10 +352,9 @@ public class VTMatchTableProvider extends ComponentProviderAdapter JComponent lengthFilterPanel = createLengthFilterPanel(); innerPanel.add(lengthFilterPanel); - ancillaryFilterButton = new JButton(); + ancillaryFilterButton = new JButton(UNFILTERED_ICON); ancillaryFilterButton.addActionListener( e -> tool.showDialog(ancillaryFilterDialog, component)); - ancillaryFilterButton.setIcon(UNFILTERED_ICON); ancillaryFilterButton.setToolTipText("Filters Dialog"); HelpService helpService = DockingWindowManager.getHelpService(); HelpLocation filterHelpLocation = diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/ChooseAddressSetEditorPanel.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/ChooseAddressSetEditorPanel.java index 490cc9c457..7c17a8b6e5 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/ChooseAddressSetEditorPanel.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/ChooseAddressSetEditorPanel.java @@ -25,6 +25,7 @@ import javax.swing.*; import javax.swing.event.*; import docking.DockingUtils; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GLabel; import ghidra.framework.plugintool.PluginTool; import ghidra.program.model.address.*; @@ -119,9 +120,9 @@ public class ChooseAddressSetEditorPanel extends JPanel { JPanel chooseSourcePanel = new JPanel(new VerticalLayout(5)); ButtonGroup originGroup = new ButtonGroup(); - entireProgramButton = new JRadioButton("Use Entire " + name + " Program", false); - toolSelectionButton = new JRadioButton("Use " + name + " Tool's Selection", false); - myRangesButton = new JRadioButton("Specify My Own Address Ranges", false); + entireProgramButton = new GRadioButton("Use Entire " + name + " Program", false); + toolSelectionButton = new GRadioButton("Use " + name + " Tool's Selection", false); + myRangesButton = new GRadioButton("Specify My Own Address Ranges", false); originGroup.add(entireProgramButton); originGroup.add(toolSelectionButton); originGroup.add(myRangesButton); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/DockingUtils.java b/Ghidra/Framework/Docking/src/main/java/docking/DockingUtils.java index 0de27260cf..3723533e60 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/DockingUtils.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/DockingUtils.java @@ -27,6 +27,9 @@ import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeCellRenderer; import javax.swing.undo.UndoableEdit; +import org.apache.commons.lang3.StringUtils; + +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.checkbox.GHtmlCheckBox; import docking.widgets.combobox.GComboBox; @@ -38,7 +41,9 @@ import docking.widgets.table.GTableCellRenderer; import docking.widgets.tree.support.GTreeRenderer; import ghidra.docking.util.DockingWindowsLookAndFeelUtils; import ghidra.util.HTMLUtilities; +import ghidra.util.Msg; import resources.ResourceManager; +import utilities.util.reflection.ReflectionUtilities; /** *

Notes about how to use HTML safely:

@@ -87,6 +92,7 @@ import resources.ResourceManager; * {@link ListCellRenderer}
{@link DefaultListCellRenderer}{@link GListCellRenderer} * {@link TableCellRenderer}{@link GTableCellRenderer} * {@link TreeCellRenderer}
{@link DefaultTreeCellRenderer}{@link GTreeRenderer}
{@link DnDTreeCellRenderer} + * {@link JRadioButton}{@link GRadioButton} * {@link JButton}???tbd??? * */ @@ -133,6 +139,22 @@ public class DockingUtils { return separator; } + /** + * Helper function that logs a warning about a string text that looks like it has HTML text. + *

+ * Use this when working with a string in a label that has already disabled HTML rendering. + *

+ * @param text string to test for HTML and warn about + */ + public static void warnAboutHtmlText(String text) { + // #ifdef still_finding_html_labels_in_our_huge_codebase + if (StringUtils.startsWithIgnoreCase(text, "")) { + Msg.warn(GLabel.class, "HTML text detected in non-HTML component: " + text, + ReflectionUtilities.createJavaFilteredThrowable()); + } + // #endif + } + /** * Turns off the HTML rendering in the specified component. * diff --git a/Ghidra/Framework/Docking/src/main/java/docking/ErrLogDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/ErrLogDialog.java index 895be04697..5b036ed161 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/ErrLogDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/ErrLogDialog.java @@ -142,8 +142,7 @@ public class ErrLogDialog extends DialogComponentProvider { sendButton.addActionListener(e -> sendDetails()); detailsPanel = new ErrorDetailsPanel(); - String text = isShowingDetails ? CLOSE : DETAIL; - detailsButton = new JButton(text); + detailsButton = new JButton(isShowingDetails ? CLOSE : DETAIL); detailsButton.addActionListener(e -> { String label = detailsButton.getText(); showDetails(label.equals(DETAIL)); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/FontPropertyEditor.java b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/FontPropertyEditor.java index 07e1dc6f85..2d99913003 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/FontPropertyEditor.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/FontPropertyEditor.java @@ -37,25 +37,21 @@ import docking.widgets.label.GDLabel; public class FontPropertyEditor extends PropertyEditorSupport { private Font font; // private JLabel previewLabel = new GDLabel(); - private JButton previewButton = new JButton(); private final static String SAMPLE_STRING = "ABCabc \u00a9\u00ab\u00a7\u0429\u05d1\u062c\u4eb9"; + private JButton previewButton = new JButton(SAMPLE_STRING); /** * The default constructor. * */ public FontPropertyEditor() { - previewButton.setText(SAMPLE_STRING); - previewButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - // show the editor to get the user value - showDialog(); + previewButton.addActionListener(e -> { + // show the editor to get the user value + showDialog(); - // now set the new value - previewButton.setFont(font); - } + // now set the new value + previewButton.setFont(font); }); // previewLabel.addMouseListener( new MouseAdapter() { diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/FindDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/FindDialog.java index 267afb5a34..714fd9ea99 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/FindDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/FindDialog.java @@ -23,6 +23,7 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import docking.DialogComponentProvider; +import docking.widgets.button.GRadioButton; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GLabel; @@ -63,8 +64,8 @@ public class FindDialog extends DialogComponentProvider { private JPanel buildMainPanel() { ButtonGroup formatGroup = new ButtonGroup(); - stringRadioButton = new JRadioButton("String", true); - regexRadioButton = new JRadioButton("Regular Expression", false); + stringRadioButton = new GRadioButton("String", true); + regexRadioButton = new GRadioButton("Regular Expression", false); formatGroup.add(stringRadioButton); formatGroup.add(regexRadioButton); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/button/GRadioButton.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/button/GRadioButton.java new file mode 100644 index 0000000000..4c2620ede2 --- /dev/null +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/button/GRadioButton.java @@ -0,0 +1,118 @@ +/* ### + * IP: GHIDRA + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package docking.widgets.button; + +import javax.swing.*; + +import docking.DockingUtils; + +/** + * A {@link JRadioButton} that disables HTML rendering. + * + */ +public class GRadioButton extends JRadioButton { + + /** + * Creates a blank radio button with HTML rendering disabled. + */ + public GRadioButton() { + super(); + init(); + } + + /** + * Creates a radio button with the specified icon, with HTML rendering disabled. + * + * @param icon image to display + */ + public GRadioButton(Icon icon) { + super(icon); + init(); + } + + /** + * Creates a radio button with properties taken from the specified Action, with HTML rendering + * disabled. + * + * @param a {@link Action} + */ + public GRadioButton(Action a) { + super(a); + init(); + } + + /** + * Creates a radio button with the specified icon and selected state, with HTML rendering + * disabled. + * + * @param icon image to display + * @param selected initial selection state, true means selected + */ + public GRadioButton(Icon icon, boolean selected) { + super(icon, selected); + init(); + } + + /** + * Creates a radio button with the specified text, with HTML rendering disabled. + * + * @param text string to be displayed by the label + */ + public GRadioButton(String text) { + super(text); + init(); + } + + /** + * Creates a radio button with the specified text and selected state, with HTML rendering + * disabled. + * + * @param text string to be displayed by the label + * @param selected initial selection state, true means selected + */ + public GRadioButton(String text, boolean selected) { + super(text, selected); + init(); + } + + /** + * Creates a radio button that has the specified text and icon, with HTML rendering disabled. + * + * @param text string to be displayed by the label + * @param icon image to display + */ + public GRadioButton(String text, Icon icon) { + super(text, icon); + init(); + } + + /** + * Creates a radio button that has the specified text, icon, and selected state, with + * HTML rendering disabled. + * + * @param text string to be displayed by the label + * @param icon image to display + * @param selected initial selection state, true means selected + */ + public GRadioButton(String text, Icon icon, boolean selected) { + super(text, icon, selected); + init(); + } + + private void init() { + DockingUtils.turnOffHTMLRendering(this); + } +} diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/checkbox/GCheckBox.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/checkbox/GCheckBox.java index c257f8b2d0..d73361ed23 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/checkbox/GCheckBox.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/checkbox/GCheckBox.java @@ -136,4 +136,16 @@ public class GCheckBox extends JCheckBox { DockingUtils.turnOffHTMLRendering(this); } + /** + * See {@link JCheckBox#setText(String)}. + *

+ * Overridden to warn about HTML text in non-HTML enabled checkbox. + * + * @param text string this label will display + */ + @Override + public void setText(String text) { + DockingUtils.warnAboutHtmlText(text); + super.setText(text); + } } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptionsEditorDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptionsEditorDialog.java index d029295cb6..5e263d142e 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptionsEditorDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptionsEditorDialog.java @@ -27,6 +27,7 @@ import javax.swing.border.EmptyBorder; import docking.DialogComponentProvider; import docking.DisabledComponentLayerFactory; import docking.widgets.InlineComponentTitledPanel; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GIconLabel; @@ -148,10 +149,10 @@ public class FilterOptionsEditorDialog extends DialogComponentProvider { setLayout(new PairLayout(2, 2)); setBorder(BorderFactory.createTitledBorder("Text Filter Strategy")); ButtonGroup buttonGroup = new ButtonGroup(); - JRadioButton startsWithButton = new JRadioButton("Starts With"); - JRadioButton containsButton = new JRadioButton("Contains"); - JRadioButton matchesExactlyButton = new JRadioButton("Matches Exactly"); - JRadioButton regularExpressionButton = new JRadioButton("Regular Expression"); + GRadioButton startsWithButton = new GRadioButton("Starts With"); + GRadioButton containsButton = new GRadioButton("Contains"); + GRadioButton matchesExactlyButton = new GRadioButton("Matches Exactly"); + GRadioButton regularExpressionButton = new GRadioButton("Regular Expression"); startsWithButton.setToolTipText( "The filter will match all entries that start with the entered filter text."); @@ -437,7 +438,7 @@ public class FilterOptionsEditorDialog extends DialogComponentProvider { ButtonGroup modeBtnGroup = new ButtonGroup(); MultitermEvaluationMode[] modes = MultitermEvaluationMode.values(); for (MultitermEvaluationMode mode : modes) { - JRadioButton modeRB = new JRadioButton(mode.name()); + GRadioButton modeRB = new GRadioButton(mode.name()); modeRB.setToolTipText(mode.getDescription()); modeRB.addActionListener(e -> { evalMode = MultitermEvaluationMode.valueOf(mode.name()); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GDLabel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GDLabel.java index 707c266a38..a870fd4320 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GDLabel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GDLabel.java @@ -106,7 +106,7 @@ public class GDLabel extends JLabel { @Override public void setText(String text) { - GLabel.warnAboutHtmlText(text); + DockingUtils.warnAboutHtmlText(text); super.setText(text); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GLabel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GLabel.java index 4df8631f47..567a19d153 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GLabel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GLabel.java @@ -155,24 +155,8 @@ public class GLabel extends JLabel { ReflectionUtilities.createJavaFilteredThrowable()); return; } - warnAboutHtmlText(text); + DockingUtils.warnAboutHtmlText(text); super.setText(text); } - /** - * Helper function that logs a warning about a string text that looks like it has HTML text. - *

- * Use this when working with a string in a label that has already disabled HTML rendering. - *

- * @param text string to test for HTML and warn about - */ - public static void warnAboutHtmlText(String text) { - // #ifdef still_finding_html_labels_in_our_huge_codebase - if (StringUtils.startsWithIgnoreCase(text, "")) { - Msg.warn(GLabel.class, "HTML text detected in non-HTML component: " + text, - ReflectionUtilities.createJavaFilteredThrowable()); - } - // #endif - } - } diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/PropertyBoolean.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/PropertyBoolean.java index 247776c84d..c023038113 100644 --- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/PropertyBoolean.java +++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/PropertyBoolean.java @@ -1,6 +1,5 @@ /* ### * 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. @@ -29,48 +28,50 @@ import javax.swing.JCheckBox; */ public class PropertyBoolean extends JCheckBox implements ItemListener { - private PropertyEditor editor; - private boolean notifyEditorOfChanges = true; + private PropertyEditor editor; + private boolean notifyEditorOfChanges = true; /** * Constructor new PropertyText. * @param pe bean property editor that is used to get the value * to show in the text field */ - public PropertyBoolean(PropertyEditor pe) { - super(); - setSelected((Boolean)pe.getValue()); - - editor = pe; - addItemListener( this); - - editor.addPropertyChangeListener(new PropertyChangeListener() { + public PropertyBoolean(PropertyEditor pe) { + super(); + setSelected((Boolean) pe.getValue()); + + editor = pe; + addItemListener(this); + + editor.addPropertyChangeListener(new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { Object value = editor.getValue(); if ((value instanceof Boolean) && !value.equals(getText())) { notifyEditorOfChanges = false; try { - setSelected((Boolean)value); + setSelected((Boolean) value); } finally { notifyEditorOfChanges = true; } } } - }); - } + }); + } - - //---------------------------------------------------------------------- - // Change listener methods. - public void itemStateChanged(ItemEvent e) { - if (notifyEditorOfChanges) { - try { - editor.setValue(isSelected() ? Boolean.TRUE : Boolean.FALSE); - } catch (IllegalArgumentException ex) { - // Quietly ignore. + //---------------------------------------------------------------------- + // Change listener methods. + @Override + public void itemStateChanged(ItemEvent e) { + if (notifyEditorOfChanges) { + try { + editor.setValue(isSelected() ? Boolean.TRUE : Boolean.FALSE); } - } - } - + catch (IllegalArgumentException ex) { + // Quietly ignore. + } + } + } + } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectTypePanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectTypePanel.java index b30a015e10..3d4001c1c5 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectTypePanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectTypePanel.java @@ -1,6 +1,5 @@ /* ### * 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. @@ -21,10 +20,10 @@ import java.awt.event.ItemListener; import javax.swing.*; +import docking.widgets.button.GRadioButton; import docking.wizard.AbstractWizardJPanel; import docking.wizard.PanelManager; - -import ghidra.app.util.*; +import ghidra.app.util.GenericHelpTopics; import ghidra.util.HelpLocation; import ghidra.util.layout.VerticalLayout; @@ -47,29 +46,29 @@ class ProjectTypePanel extends AbstractWizardJPanel { buildPanel(); setBorder(NewProjectPanelManager.EMPTY_BORDER); } - private void buildPanel() { JPanel innerPanel = new JPanel(new VerticalLayout(10)); innerPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); ItemListener listener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { panelManager.getWizardManager().validityChanged(); } }; - nonSharedRB = new JRadioButton("Non-Shared Project", true); + nonSharedRB = new GRadioButton("Non-Shared Project", true); nonSharedRB.addItemListener(listener); nonSharedRB.setToolTipText("Create a project that is not shared with others"); - - sharedRB = new JRadioButton("Shared Project"); + + sharedRB = new GRadioButton("Shared Project"); sharedRB.addItemListener(listener); sharedRB.setToolTipText("Create a project that can be shared with others"); - + buttonGroup = new ButtonGroup(); buttonGroup.add(nonSharedRB); buttonGroup.add(sharedRB); - + innerPanel.add(nonSharedRB); innerPanel.add(sharedRB); JPanel outerPanel = new JPanel(); @@ -77,17 +76,19 @@ class ProjectTypePanel extends AbstractWizardJPanel { outerPanel.add(innerPanel); add(outerPanel); } - - + /* (non-Javadoc) * @see ghidra.util.bean.wizard.WizardPanel#getTitle() */ + @Override public String getTitle() { return "Select Project Type"; } + /* (non-Javadoc) * @see ghidra.util.bean.wizard.WizardPanel#initialize() */ + @Override public void initialize() { buttonGroup.remove(sharedRB); buttonGroup.remove(nonSharedRB); @@ -96,22 +97,23 @@ class ProjectTypePanel extends AbstractWizardJPanel { buttonGroup.add(nonSharedRB); buttonGroup.add(sharedRB); } + /** * Return true if the user has entered a valid project file - */ + */ + @Override public boolean isValidInformation() { return sharedRB.isSelected() || nonSharedRB.isSelected(); } - /* (non-Javadoc) * @see ghidra.util.bean.wizard.WizardPanel#getHelpLocation() */ @Override - public HelpLocation getHelpLocation() { + public HelpLocation getHelpLocation() { return new HelpLocation(GenericHelpTopics.FRONT_END, "SelectProjectType"); } - + boolean isSharedProject() { return sharedRB.isSelected(); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java index f6e502102e..fe04731510 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java @@ -27,6 +27,7 @@ import javax.swing.event.*; import docking.DialogComponentProvider; import docking.DockingUtils; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import ghidra.framework.client.*; @@ -190,12 +191,12 @@ class RepositoryChooser extends DialogComponentProvider { } }; - serverInfoChoice = new JRadioButton("Ghidra Server"); + serverInfoChoice = new GRadioButton("Ghidra Server"); serverInfoChoice.setSelected(true); serverInfoChoice.addChangeListener(choiceListener); radioButtonPanel.add(serverInfoChoice); - urlChoice = new JRadioButton("Ghidra URL"); + urlChoice = new GRadioButton("Ghidra URL"); urlChoice.addChangeListener(choiceListener); radioButtonPanel.add(urlChoice); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryPanel.java index 76abbb2591..c9544b7e29 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryPanel.java @@ -23,6 +23,7 @@ import javax.swing.*; import javax.swing.event.*; import docking.DockingUtils; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GDLabel; import docking.wizard.*; import ghidra.app.util.GenericHelpTopics; @@ -147,7 +148,7 @@ public class RepositoryPanel extends AbstractWizardJPanel { private JPanel createListPanel(String[] repositoryNames) { JPanel panel = new JPanel(new VerticalLayout(5)); panel.setBorder(BorderFactory.createTitledBorder("Choose Existing Repository")); - existingRepButton = new JRadioButton("Existing Repository", (repositoryNames.length > 0)); + existingRepButton = new GRadioButton("Existing Repository", (repositoryNames.length > 0)); existingRepButton.setEnabled(repositoryNames.length > 0); buttonGroup.add(existingRepButton); @@ -177,7 +178,7 @@ public class RepositoryPanel extends AbstractWizardJPanel { namePanel.setLayout(new VerticalLayout(5)); namePanel.setBorder(BorderFactory.createTitledBorder("Create Repository")); - createRepButton = new JRadioButton("Create Repository", !existingRepButton.isSelected()); + createRepButton = new GRadioButton("Create Repository", !existingRepButton.isSelected()); buttonGroup.add(createRepButton); nameLabel = new GDLabel("Repository Name:", SwingConstants.RIGHT); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/SelectChangedToolDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/SelectChangedToolDialog.java index 7503d3eea5..f6161c8048 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/SelectChangedToolDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/SelectChangedToolDialog.java @@ -25,6 +25,7 @@ import javax.swing.*; import docking.DialogComponentProvider; import docking.widgets.OptionDialog; +import docking.widgets.button.GRadioButton; import docking.widgets.label.GHtmlLabel; import ghidra.framework.model.Tool; import ghidra.util.HTMLUtilities; @@ -75,7 +76,7 @@ public class SelectChangedToolDialog extends DialogComponentProvider { ButtonGroup buttonGroup = new ButtonGroup(); - JRadioButton noneButton = new JRadioButton("None"); + GRadioButton noneButton = new GRadioButton("None"); ItemListener listener = new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { @@ -87,7 +88,7 @@ public class SelectChangedToolDialog extends DialogComponentProvider { panel.add(noneButton); for (final Tool tool : toolList) { - JRadioButton radioButton = new JRadioButton(tool.getName()); + GRadioButton radioButton = new GRadioButton(tool.getName()); radioButton.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { diff --git a/Ghidra/Framework/Project/src/test/java/ghidra/framework/task/TaskSimulator.java b/Ghidra/Framework/Project/src/test/java/ghidra/framework/task/TaskSimulator.java index 85eefa0699..a925f972c2 100644 --- a/Ghidra/Framework/Project/src/test/java/ghidra/framework/task/TaskSimulator.java +++ b/Ghidra/Framework/Project/src/test/java/ghidra/framework/task/TaskSimulator.java @@ -23,6 +23,7 @@ import java.io.IOException; import javax.swing.*; import docking.framework.DockingApplicationConfiguration; +import docking.widgets.button.GRadioButton; import docking.widgets.checkbox.GCheckBox; import generic.concurrent.GThreadPool; import ghidra.GhidraApplicationLayout; @@ -69,10 +70,10 @@ public class TaskSimulator { JButton addGroupButton = new JButton("Add Group"); JButton addTaskButton = new JButton("Add Task"); JButton showResultsButton = new JButton("Show Results"); - lowButton = new JRadioButton("Low"); - mediumButton = new JRadioButton("Medium"); - highButton = new JRadioButton("High"); - urgentButton = new JRadioButton("Urgent"); + lowButton = new GRadioButton("Low"); + mediumButton = new GRadioButton("Medium"); + highButton = new GRadioButton("High"); + urgentButton = new GRadioButton("Urgent"); ButtonGroup group = new ButtonGroup(); group.add(lowButton); group.add(mediumButton);