From 3c0484cae3bb730121726e66fd9ed47c3d541e1a Mon Sep 17 00:00:00 2001 From: dev747368 <48332326+dev747368@users.noreply.github.com> Date: Tue, 16 Apr 2019 17:01:51 -0400 Subject: [PATCH] GT-2698 - convert JCheckBox to GCheckBox --- .../ghidra/examples/SampleTableProvider.java | 7 +- .../Base/ghidra_scripts/SearchGuiSingle.java | 9 +- .../merge/datatypes/CategoryMergePanel.java | 13 +- .../merge/datatypes/DataTypeMergePanel.java | 3 +- .../datatypes/SourceArchiveMergePanel.java | 3 +- .../app/merge/listing/ConflictPanel.java | 5 +- .../merge/listing/VerticalChoicesPanel.java | 3 +- .../app/merge/memory/MemoryMergePanel.java | 13 +- .../app/merge/propertylist/ConflictPanel.java | 3 +- .../app/merge/tree/ProgramTreeMergePanel.java | 19 +- .../core/bookmark/CreateBookmarkDialog.java | 3 +- .../plugin/core/bookmark/FilterDialog.java | 7 +- .../app/plugin/core/clear/ClearDialog.java | 26 +-- .../plugin/core/clear/ClearFlowDialog.java | 7 +- .../plugin/core/comments/CommentsDialog.java | 3 +- .../core/compositeeditor/CompEditorPanel.java | 3 +- .../core/datamgr/DataOrganizationPanel.java | 3 +- .../datamgr/editor/DataTypeEditorManager.java | 8 +- .../plugin/core/datawindow/FilterAction.java | 3 +- .../core/disassembler/AddressTableDialog.java | 7 +- .../plugin/core/exporter/ExporterDialog.java | 3 +- .../function/EditFunctionSignatureDialog.java | 5 +- .../function/editor/FunctionEditorDialog.java | 9 +- .../interpreter/CodeCompletionWindow.java | 17 +- .../plugin/core/memory/AddBlockDialog.java | 9 +- .../core/printing/PrintOptionsDialog.java | 65 ++++--- .../processors/InstructionInfoProvider.java | 3 +- .../references/EditMemoryReferencePanel.java | 3 +- .../references/EditReferencesProvider.java | 3 +- .../core/references/OffsetTableDialog.java | 3 +- .../core/searchmem/AsciiSearchFormat.java | 5 +- .../core/searchmem/MemSearchDialog.java | 7 +- .../core/searchtext/SearchTextDialog.java | 19 +- .../core/string/SearchStringDialog.java | 5 +- .../core/string/StringTableProvider.java | 7 +- .../symboltree/EditExternalLocationPanel.java | 3 +- .../plugin/core/symtable/FilterDialog.java | 9 +- .../app/plugin/core/symtable/SymbolPanel.java | 3 +- .../plugin/core/totd/TipOfTheDayDialog.java | 3 +- .../app/script/MultipleOptionsDialog.java | 9 +- .../java/ghidra/app/util/AddEditDialog.java | 7 +- .../ghidra/app/util/OptionsEditorPanel.java | 5 +- .../ghidra/app/util/bean/SetEquateDialog.java | 3 +- .../app/util/datatype/ApplyEnumDialog.java | 3 +- .../app/util/dialog/CheckoutDialog.java | 3 +- .../app/util/exporter/IntelHexExporter.java | 5 +- .../navigation/GoToAddressLabelDialog.java | 5 +- .../AddressFieldOptionsPropertyEditor.java | 5 +- .../field/ArrayElementPropertyEditor.java | 3 +- .../viewer/field/NamespacePropertyEditor.java | 9 +- .../app/util/viewer/options/OptionsGui.java | 11 +- .../analysis/gui/AnalyzerListPanel.java | 13 +- .../framework/analysis/gui/AnalyzerPanel.java | 13 +- .../plugin/importer/NewLanguagePanel.java | 3 +- .../importer/batch/BatchImportDialog.java | 23 +-- .../byteviewer/ByteViewerOptionsDialog.java | 3 +- .../fid/plugin/ActiveFidConfigureDialog.java | 6 +- .../plugin/core/diff/DiffDetailsProvider.java | 5 +- .../plugin/core/diff/ExecuteDiffDialog.java | 166 +++++++----------- .../vt/gui/editors/TagEditorRenderer.java | 18 +- .../filters/AbstractAddressRangeFilter.java | 4 +- .../vt/gui/filters/TagFilterEditorDialog.java | 15 +- .../markuptable/MarkupStatusFilter.java | 3 +- .../markuptable/MarkupTypeFilter.java | 17 +- .../provider/matchtable/AlgorithmFilter.java | 18 +- .../matchtable/ApplyMarkupPropertyEditor.java | 9 +- .../matchtable/AssociationStatusFilter.java | 18 +- .../provider/matchtable/MatchTypeFilter.java | 16 +- .../provider/matchtable/SymbolTypeFilter.java | 19 +- .../vt/gui/wizard/AddressSetOptionsPanel.java | 50 +++--- .../java/docking/widgets/OptionDialog.java | 5 +- .../java/docking/widgets/PasswordDialog.java | 3 +- .../ConditionTestPanel.java | 3 +- .../widgets/dialogs/SettingsDialog.java | 5 +- .../GFileChooserOptionsDialog.java | 3 +- .../filter/FilterOptionsEditorDialog.java | 15 +- .../docking/widgets/label/GHtmlLabel.java | 2 +- .../widgets/table/GBooleanCellRenderer.java | 4 +- .../EnumConstraintEditor.java | 3 +- .../main/ImportGhidraToolsDialog.java | 9 +- .../framework/main/ProjectAccessPanel.java | 4 +- .../ghidra/framework/main/SaveDataDialog.java | 11 +- .../framework/main/SelectProjectPanel.java | 2 +- .../framework/main/ToolConnectionPanel.java | 7 +- .../main/datatree/CheckoutDialog.java | 3 +- .../main/datatree/DomainFilesPanel.java | 8 +- .../main/datatree/UndoActionDialog.java | 4 +- .../main/datatree/VersionControlDialog.java | 7 +- .../main/logviewer/ui/ReloadDialog.java | 3 +- .../dialog/PluginManagerComponent.java | 3 +- .../framework/task/gui/GTaskResultPanel.java | 21 ++- .../ghidra/framework/task/TaskSimulator.java | 3 +- .../data/DataTypeArchiveTransformerPanel.java | 3 +- 93 files changed, 487 insertions(+), 460 deletions(-) diff --git a/Ghidra/Extensions/SampleTablePlugin/src/main/java/ghidra/examples/SampleTableProvider.java b/Ghidra/Extensions/SampleTablePlugin/src/main/java/ghidra/examples/SampleTableProvider.java index fedbf2b8b2..6d071a29a7 100644 --- a/Ghidra/Extensions/SampleTablePlugin/src/main/java/ghidra/examples/SampleTableProvider.java +++ b/Ghidra/Extensions/SampleTablePlugin/src/main/java/ghidra/examples/SampleTableProvider.java @@ -24,6 +24,7 @@ import javax.swing.*; import docking.ActionContext; import docking.action.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.filechooser.GhidraFileChooserPanel; import docking.widgets.table.GFilterTable; import ghidra.framework.options.OptionsChangeListener; @@ -47,7 +48,7 @@ public class SampleTableProvider extends ComponentProviderAdapter implements Opt private SampleTableModel model; private List discoveredAlgorithms; - private JCheckBox[] checkBoxes; + private GCheckBox[] checkBoxes; private GhidraFileChooserPanel fileChooserPanel; @@ -94,9 +95,9 @@ public class SampleTableProvider extends ComponentProviderAdapter implements Opt JPanel checkBoxPanel = new JPanel(new GridLayout(0, 1)); checkBoxPanel.setBorder(BorderFactory.createTitledBorder("Discovered Algorithms")); - checkBoxes = new JCheckBox[discoveredAlgorithms.size()]; + checkBoxes = new GCheckBox[discoveredAlgorithms.size()]; for (int i = 0; i < discoveredAlgorithms.size(); i++) { - checkBoxes[i] = new JCheckBox(discoveredAlgorithms.get(i).getName()); + checkBoxes[i] = new GCheckBox(discoveredAlgorithms.get(i).getName()); checkBoxPanel.add(checkBoxes[i]); } diff --git a/Ghidra/Features/Base/ghidra_scripts/SearchGuiSingle.java b/Ghidra/Features/Base/ghidra_scripts/SearchGuiSingle.java index b6db6b15ad..3c9126bf60 100644 --- a/Ghidra/Features/Base/ghidra_scripts/SearchGuiSingle.java +++ b/Ghidra/Features/Base/ghidra_scripts/SearchGuiSingle.java @@ -23,6 +23,7 @@ import java.awt.event.ActionListener; import javax.swing.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; public class SearchGuiSingle extends SearchBaseExtended { @@ -45,10 +46,10 @@ public class SearchGuiSingle extends SearchBaseExtended { frame = new JFrame(); jPanel1 = new JPanel(); - mnemonicCheckBox = new JCheckBox("Mnemonics", true); - opOneCheckBox = new JCheckBox("Operand 1", false); - opTwoCheckBox = new JCheckBox("Operand 2", false); - constCheckBox = new JCheckBox("Constants", false); + mnemonicCheckBox = new GCheckBox("Mnemonics", true); + opOneCheckBox = new GCheckBox("Operand 1", false); + opTwoCheckBox = new GCheckBox("Operand 2", false); + constCheckBox = new GCheckBox("Constants", false); searchButton = new JButton(); jLabel1 = new GDLabel(); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryMergePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryMergePanel.java index d6e98fdad6..bae46eb0b2 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryMergePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/CategoryMergePanel.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,16 +15,17 @@ */ package ghidra.app.merge.datatypes; -import ghidra.app.merge.MergeConstants; -import ghidra.app.merge.util.ConflictCountPanel; -import ghidra.framework.data.DomainObjectMergeManager; - import java.awt.BorderLayout; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import docking.widgets.checkbox.GCheckBox; +import ghidra.app.merge.MergeConstants; +import ghidra.app.merge.util.ConflictCountPanel; +import ghidra.framework.data.DomainObjectMergeManager; + /** * Panel that shows a conflict for a category; gets user input to resolve * the conflict. @@ -86,6 +86,7 @@ class CategoryMergePanel extends JPanel { private void create() { countPanel = new ConflictCountPanel(); resolvePanel = new CategoryConflictPanel("Resolve Conflict", new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { mergeManager.clearStatusText(); mergeManager.setApplyEnabled(true); @@ -112,7 +113,7 @@ class CategoryMergePanel extends JPanel { } private JCheckBox createUseForAllCheckBox() { - useForAllCB = new JCheckBox(getUseAllString("Category")); + useForAllCB = new GCheckBox(getUseAllString("Category")); useForAllCB.setName(USE_FOR_ALL_CHECKBOX); return useForAllCB; } 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 6a3b7e55ab..bf21253f6e 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.checkbox.GCheckBox; import docking.widgets.label.GIconLabel; import ghidra.app.merge.MergeConstants; import ghidra.app.merge.util.ConflictCountPanel; @@ -200,7 +201,7 @@ class DataTypeMergePanel extends JPanel { } private JCheckBox createUseForAllCheckBox() { - useForAllCB = new JCheckBox(getUseAllString("Data Type")); + useForAllCB = new GCheckBox(getUseAllString("Data Type")); useForAllCB.setName(USE_FOR_ALL_CHECKBOX); return useForAllCB; } 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 cc31a12d3a..294f978ea8 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.checkbox.GCheckBox; import docking.widgets.label.GIconLabel; import ghidra.app.merge.MergeConstants; import ghidra.app.merge.util.ConflictCountPanel; @@ -195,7 +196,7 @@ class SourceArchiveMergePanel extends JPanel { } private JCheckBox createUseForAllCheckBox() { - useForAllCB = new JCheckBox(getUseAllString("Source Archive")); + useForAllCB = new GCheckBox(getUseAllString("Source Archive")); useForAllCB.setName(USE_FOR_ALL_CHECKBOX); return useForAllCB; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ConflictPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ConflictPanel.java index f710b35832..d2a6fbbbc5 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ConflictPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ConflictPanel.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. @@ -20,6 +19,8 @@ import java.awt.LayoutManager; import javax.swing.JCheckBox; +import docking.widgets.checkbox.GCheckBox; + /** * Abstract class that should be implemented by the conflict panel that appears * below the 4 listings in the merge window. @@ -76,7 +77,7 @@ public abstract class ConflictPanel extends ChoiceComponent { public abstract void clear(); protected JCheckBox createUseForAllCheckBox() { - useForAllCB = new JCheckBox(getUseAllString("unknown")); + useForAllCB = new GCheckBox(getUseAllString("unknown")); useForAllCB.setName(USE_FOR_ALL_CHECKBOX); return useForAllCB; } 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 beac858a04..01f466386d 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.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import ghidra.app.merge.util.ConflictUtility; @@ -105,7 +106,7 @@ public class VerticalChoicesPanel extends ConflictPanel { rowPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JRadioButton rb = new JRadioButton(); - JCheckBox cb = new JCheckBox(); + JCheckBox cb = new GCheckBox(); indent = Math.max(rb.getPreferredSize().width, cb.getPreferredSize().width); defaultInsets = new Insets(DEFAULT_TOP, DEFAULT_LEFT, DEFAULT_BOTTOM, DEFAULT_RIGHT); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/MemoryMergePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/MemoryMergePanel.java index 6d961a9d35..02f21b53fe 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/MemoryMergePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/memory/MemoryMergePanel.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,10 +15,6 @@ */ package ghidra.app.merge.memory; -import ghidra.app.merge.MergeConstants; -import ghidra.app.merge.ProgramMultiUserMergeManager; -import ghidra.app.merge.util.ConflictCountPanel; - import java.awt.BorderLayout; import java.awt.CardLayout; @@ -27,6 +22,11 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import docking.widgets.checkbox.GCheckBox; +import ghidra.app.merge.MergeConstants; +import ghidra.app.merge.ProgramMultiUserMergeManager; +import ghidra.app.merge.util.ConflictCountPanel; + /** * * Panel to resolve conflicts on memory blocks. @@ -111,6 +111,7 @@ class MemoryMergePanel extends JPanel { cardPanel = new JPanel(cardLayout); cardPanel.setBorder(BorderFactory.createTitledBorder("Resolve Block Conflict")); ChangeListener listener = new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { mergeManager.setApplyEnabled(true); } @@ -133,7 +134,7 @@ class MemoryMergePanel extends JPanel { } private JCheckBox createUseForAllCheckBox() { - useForAllCB = new JCheckBox(getUseAllString("Memory Block")); + useForAllCB = new GCheckBox(getUseAllString("Memory Block")); useForAllCB.setName(USE_FOR_ALL_CHECKBOX); return useForAllCB; } 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 a4c020a326..c2c639ca7c 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.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import ghidra.app.merge.MergeConstants; @@ -178,7 +179,7 @@ class ConflictPanel extends JPanel { } protected JCheckBox createUseForAllCheckBox() { - useForAllCB = new JCheckBox(getUseAllString("Property")); + useForAllCB = new GCheckBox(getUseAllString("Property")); useForAllCB.setName(USE_FOR_ALL_CHECKBOX); return useForAllCB; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/ProgramTreeMergePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/ProgramTreeMergePanel.java index 95d898b96a..cd98b8a8f3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/ProgramTreeMergePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/tree/ProgramTreeMergePanel.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,11 +15,6 @@ */ package ghidra.app.merge.tree; -import ghidra.app.merge.MergeConstants; -import ghidra.app.merge.ProgramMultiUserMergeManager; -import ghidra.app.merge.util.ConflictCountPanel; -import ghidra.program.model.listing.Program; - import java.awt.CardLayout; import java.awt.Dimension; @@ -28,6 +22,12 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import docking.widgets.checkbox.GCheckBox; +import ghidra.app.merge.MergeConstants; +import ghidra.app.merge.ProgramMultiUserMergeManager; +import ghidra.app.merge.util.ConflictCountPanel; +import ghidra.program.model.listing.Program; + /** * Panel for getting user input to resolve tree conflicts. * @@ -95,8 +95,8 @@ class ProgramTreeMergePanel extends JPanel { } else { currentPanel = conflictsPanel; - conflictsPanel.setNames(resultProgram, name1, name2, origName, !structure1Changed && - !structure2Changed); + conflictsPanel.setNames(resultProgram, name1, name2, origName, + !structure1Changed && !structure2Changed); } countPanel.updateCount(conflictIndex, totalConflicts); @@ -137,6 +137,7 @@ class ProgramTreeMergePanel extends JPanel { private JPanel createConflictPanel() { ChangeListener changeListener = new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { mergeManager.clearStatusText(); mergeManager.setApplyEnabled(true); @@ -155,7 +156,7 @@ class ProgramTreeMergePanel extends JPanel { } private JCheckBox createUseForAllCheckBox() { - useForAllCB = new JCheckBox(getUseAllString("")); + useForAllCB = new GCheckBox(getUseAllString("")); useForAllCB.setName(USE_FOR_ALL_CHECKBOX); return useForAllCB; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/CreateBookmarkDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/CreateBookmarkDialog.java index 249b867639..ec815e7a67 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/CreateBookmarkDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/CreateBookmarkDialog.java @@ -29,6 +29,7 @@ import javax.swing.*; import docking.DialogComponentProvider; import docking.DockingUtils; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GIconLabel; import docking.widgets.label.GLabel; @@ -143,7 +144,7 @@ public class CreateBookmarkDialog extends DialogComponentProvider { commentTextField = new JTextField(20); commentTextField.addKeyListener(listener); - selectionCB = new JCheckBox("Bookmark Top of Each Selection", hasSelection); + selectionCB = new GCheckBox("Bookmark Top of Each Selection", hasSelection); selectionCB.setEnabled(false); if (hasSelection) { selectionCB.setEnabled(ranges > 1); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/FilterDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/FilterDialog.java index 513dab033c..dd527cf387 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/FilterDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/FilterDialog.java @@ -22,6 +22,7 @@ import java.util.List; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.app.util.HelpTopics; import ghidra.program.model.listing.*; @@ -31,7 +32,7 @@ import ghidra.util.layout.VerticalLayout; class FilterDialog extends DialogComponentProvider { private BookmarkProvider provider; - private JCheckBox[] buttons; + private GCheckBox[] buttons; private BookmarkType[] types; FilterDialog(BookmarkProvider provider, Program p) { @@ -52,11 +53,11 @@ class FilterDialog extends DialogComponentProvider { private JPanel getTypesPanel(Program program) { BookmarkManager bmMgr = program.getBookmarkManager(); types = bmMgr.getBookmarkTypes(); - buttons = new JCheckBox[types.length]; + buttons = new GCheckBox[types.length]; JPanel panel = new JPanel(new PairLayout(5, 20)); panel.setBorder(BorderFactory.createTitledBorder("Include Bookmark Types")); for (int i = 0; i < types.length; i++) { - buttons[i] = new JCheckBox(); + buttons[i] = new GCheckBox(); JPanel p = new JPanel(new BorderLayout()); p.add(buttons[i], BorderLayout.WEST); buttons[i].setSelected(provider.isShowingType(types[i].getTypeString())); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java index c1198cb3fb..09c61c7481 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java @@ -24,6 +24,8 @@ import java.util.List; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; +import docking.widgets.checkbox.GHtmlCheckBox; import docking.widgets.label.GLabel; import ghidra.app.context.ListingActionContext; import ghidra.util.HelpLocation; @@ -120,20 +122,20 @@ public class ClearDialog extends DialogComponentProvider { BoxLayout bl = new BoxLayout(cbPanel, BoxLayout.Y_AXIS); cbPanel.setLayout(bl); - symbolsCb = new JCheckBox("Symbols"); - commentsCb = new JCheckBox( + symbolsCb = new GCheckBox("Symbols"); + commentsCb = new GHtmlCheckBox( "Comments (does not affect automatic comments)"); commentsCb.setVerticalTextPosition(SwingConstants.TOP); - propertiesCb = new JCheckBox("Properties"); - codeCb = new JCheckBox("Code"); - functionsCb = new JCheckBox("Functions"); - registersCb = new JCheckBox("Registers"); - equatesCb = new JCheckBox("Equates"); - userReferencesCb = new JCheckBox("User-defined References"); - analysisReferencesCb = new JCheckBox("Analysis References"); - importReferencesCb = new JCheckBox("Import References"); - systemReferencesCb = new JCheckBox("Default References"); - bookmarksCb = new JCheckBox("Bookmarks"); + propertiesCb = new GCheckBox("Properties"); + codeCb = new GCheckBox("Code"); + functionsCb = new GCheckBox("Functions"); + registersCb = new GCheckBox("Registers"); + equatesCb = new GCheckBox("Equates"); + userReferencesCb = new GCheckBox("User-defined References"); + analysisReferencesCb = new GCheckBox("Analysis References"); + importReferencesCb = new GCheckBox("Import References"); + systemReferencesCb = new GCheckBox("Default References"); + bookmarksCb = new GCheckBox("Bookmarks"); symbolsCb.setSelected(true); symbolsCb.addKeyListener(listener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearFlowDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearFlowDialog.java index 234ffb3b2f..fea1e2a758 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearFlowDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearFlowDialog.java @@ -22,6 +22,7 @@ import java.awt.event.*; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.app.context.ListingActionContext; import ghidra.util.HelpLocation; @@ -97,9 +98,9 @@ public class ClearFlowDialog extends DialogComponentProvider { BoxLayout bl = new BoxLayout(cbPanel, BoxLayout.Y_AXIS); cbPanel.setLayout(bl); - symbolsCb = new JCheckBox("Clear Symbols"); - dataCb = new JCheckBox("Clear Data"); - repairCb = new JCheckBox("Repair Flow"); + symbolsCb = new GCheckBox("Clear Symbols"); + dataCb = new GCheckBox("Clear Data"); + repairCb = new GCheckBox("Repair Flow"); symbolsCb.setSelected(false); symbolsCb.addKeyListener(listener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/comments/CommentsDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/comments/CommentsDialog.java index a82a8317f7..d71b0fc6d1 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/comments/CommentsDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/comments/CommentsDialog.java @@ -26,6 +26,7 @@ import javax.swing.text.JTextComponent; import docking.*; import docking.widgets.OptionDialog; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import ghidra.app.util.viewer.field.AnnotatedStringHandler; import ghidra.app.util.viewer.field.Annotation; @@ -60,7 +61,7 @@ public class CommentsDialog extends DialogComponentProvider implements KeyListen private boolean wasChanged; private boolean enterMode = false; - private JCheckBox enterBox = new JCheckBox("Enter accepts comment", enterMode); + private JCheckBox enterBox = new GCheckBox("Enter accepts comment", enterMode); { enterBox.addChangeListener(new ChangeListener() { @Override 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 841574f20c..5c39bcfefd 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.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import ghidra.program.model.data.Category; import ghidra.program.model.data.Composite; @@ -275,7 +276,7 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupInternallyAligned() { GridBagConstraints gridBagConstraints = new GridBagConstraints(); - internalAlignmentCheckBox = new JCheckBox("Align"); + internalAlignmentCheckBox = new GCheckBox("Align"); gridBagConstraints.anchor = GridBagConstraints.LINE_END; gridBagConstraints.fill = GridBagConstraints.NONE; gridBagConstraints.gridx = 4; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataOrganizationPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataOrganizationPanel.java index 06e3d3ad59..4e1213e488 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataOrganizationPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataOrganizationPanel.java @@ -21,6 +21,7 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.program.model.data.DataOrganizationImpl; import ghidra.util.layout.PairLayout; @@ -136,7 +137,7 @@ public class DataOrganizationPanel extends JPanel { } private void setUpSignedChar() { - charIsSignedCheckbox = new JCheckBox(); + charIsSignedCheckbox = new GCheckBox(); charIsSignedCheckbox.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java index 02d290937c..03e5651960 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java @@ -18,9 +18,11 @@ package ghidra.app.plugin.core.datamgr.editor; import java.util.ArrayList; import java.util.List; -import javax.swing.*; +import javax.swing.ComboBoxModel; +import javax.swing.JPanel; import docking.ComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GLabel; import ghidra.app.plugin.core.compositeeditor.*; @@ -581,12 +583,12 @@ public class DataTypeEditorManager @Override protected void installInlineWidget(JPanel parentPanel) { - inlineCheckBox = new JCheckBox("Inline"); + inlineCheckBox = new GCheckBox("Inline"); } @Override protected void installNoReturnWidget(JPanel parentPanel) { - noReturnCheckBox = new JCheckBox("No Return"); + noReturnCheckBox = new GCheckBox("No Return"); } @Override 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 6ec0719d7b..dfb36aa7c4 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.checkbox.GHtmlCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.filter.FilterListener; import docking.widgets.filter.FilterTextField; @@ -389,7 +390,7 @@ class FilterAction extends ToggleDockingAction { } private void createCheckBox(String curTypeHtml, String curType, Boolean lEnabled) { - JCheckBox newCheckbox = new JCheckBox(curTypeHtml, lEnabled.booleanValue()); + JCheckBox newCheckbox = new GHtmlCheckBox(curTypeHtml, lEnabled.booleanValue()); newCheckbox.setName(curType); newCheckbox.addKeyListener(listener); newCheckbox.addItemListener(itemListener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableDialog.java index b9a4a83482..9acbd77902 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableDialog.java @@ -27,6 +27,7 @@ import docking.ActionContext; import docking.DialogComponentProvider; import docking.ToolTipManager; import docking.action.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import ghidra.app.events.ProgramSelectionPluginEvent; @@ -192,14 +193,14 @@ public class AddressTableDialog extends DialogComponentProvider { optPanel.add(alignPanel); optPanel.add(skipPanel); - selectionButton = new JCheckBox("Search Selection"); + selectionButton = new GCheckBox("Search Selection"); selectionButton.setSelected(false); ToolTipManager.setToolTipText(selectionButton, "If checked, search only the current selection."); JPanel searchOptionsWestPanel = new JPanel(new GridLayout(2, 1)); searchOptionsWestPanel.add(selectionButton); - shiftedAddressButton = new JCheckBox("Shifted Addresses"); + shiftedAddressButton = new GCheckBox("Shifted Addresses"); boolean allowShiftedAddresses = plugin.getProgram().getDataTypeManager().getDataOrganization().getPointerShift() != 0; @@ -226,7 +227,7 @@ public class AddressTableDialog extends DialogComponentProvider { JPanel makeOptionsPanel = new JPanel(new BorderLayout()); makeOptionsPanel.setBorder(BorderFactory.createTitledBorder("Make Table Options")); - autoLabelCB = new JCheckBox("Auto Label"); + autoLabelCB = new GCheckBox("Auto Label"); autoLabelCB.setSelected(true); autoLabelCB.setEnabled(false); ToolTipManager.setToolTipText(autoLabelCB, diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/exporter/ExporterDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/exporter/ExporterDialog.java index dccb45cf8e..0cd1004ef6 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/exporter/ExporterDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/exporter/ExporterDialog.java @@ -29,6 +29,7 @@ import javax.swing.event.DocumentListener; import docking.DialogComponentProvider; import docking.options.editor.ButtonPanelFactory; import docking.widgets.OptionDialog; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.filechooser.GhidraFileChooserMode; @@ -200,7 +201,7 @@ public class ExporterDialog extends DialogComponentProvider implements AddressFa } private Component buildSelectionCheckbox() { - selectionCheckBox = new JCheckBox(""); + selectionCheckBox = new GCheckBox(""); updateSelectionCheckbox(); return selectionCheckBox; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditFunctionSignatureDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditFunctionSignatureDialog.java index 4c0f3cde36..3a61db9340 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditFunctionSignatureDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditFunctionSignatureDialog.java @@ -22,6 +22,7 @@ import java.util.List; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -171,7 +172,7 @@ public class EditFunctionSignatureDialog extends DialogComponentProvider { } protected void installInlineWidget(JPanel parentPanel) { - inlineCheckBox = new JCheckBox("Inline"); + inlineCheckBox = new GCheckBox("Inline"); inlineCheckBox.addChangeListener(e -> { if (inlineCheckBox.isSelected() && callFixupComboBox != null) { callFixupComboBox.setSelectedItem(NONE_CHOICE); @@ -181,7 +182,7 @@ public class EditFunctionSignatureDialog extends DialogComponentProvider { } protected void installNoReturnWidget(JPanel parentPanel) { - noReturnCheckBox = new JCheckBox("No Return"); + noReturnCheckBox = new GCheckBox("No Return"); parentPanel.add(noReturnCheckBox); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java index bca909c863..4d79539db5 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java @@ -30,6 +30,7 @@ import javax.swing.table.TableCellEditor; import docking.DialogComponentProvider; import docking.DockingUtils; import docking.widgets.OptionDialog; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GLabel; import docking.widgets.table.*; @@ -305,18 +306,18 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod private Component buildTogglePanel() { JPanel panel = new JPanel(new PairLayout()); - varArgsCheckBox = new JCheckBox("Varargs"); + varArgsCheckBox = new GCheckBox("Varargs"); varArgsCheckBox.addItemListener(e -> model.setHasVarArgs(varArgsCheckBox.isSelected())); panel.add(varArgsCheckBox); - inLineCheckBox = new JCheckBox("In Line"); + inLineCheckBox = new GCheckBox("In Line"); panel.add(inLineCheckBox); inLineCheckBox.addItemListener(e -> model.setIsInLine(inLineCheckBox.isSelected())); inLineCheckBox.setEnabled(model.isInlineAllowed()); - noReturnCheckBox = new JCheckBox("No Return"); + noReturnCheckBox = new GCheckBox("No Return"); noReturnCheckBox.addItemListener(e -> model.setNoReturn(noReturnCheckBox.isSelected())); - storageCheckBox = new JCheckBox("Use Custom Storage"); + storageCheckBox = new GCheckBox("Use Custom Storage"); storageCheckBox.addItemListener( e -> model.setUseCustomizeStorage(storageCheckBox.isSelected())); panel.add(noReturnCheckBox); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/interpreter/CodeCompletionWindow.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/interpreter/CodeCompletionWindow.java index 81b17c735e..ae2ff6e252 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/interpreter/CodeCompletionWindow.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/interpreter/CodeCompletionWindow.java @@ -24,6 +24,7 @@ import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import javax.swing.event.ListDataListener; +import docking.widgets.list.GListCellRenderer; import generic.util.WindowUtilities; import ghidra.app.plugin.core.console.CodeCompletion; @@ -407,7 +408,12 @@ class CodeCompletionListSelectionModel extends DefaultListSelectionModel { * * */ -class CodeCompletionListCellRenderer extends DefaultListCellRenderer { +class CodeCompletionListCellRenderer extends GListCellRenderer { + + @Override + protected String getItemText(CodeCompletion value) { + return value.getDescription(); + } /** * Render either a default list cell, or use the one provided. @@ -416,12 +422,11 @@ class CodeCompletionListCellRenderer extends DefaultListCellRenderer { * Otherwise, we use the DefaultListCellRenderer routine. */ @Override - public Component getListCellRendererComponent(JList list, Object completion, int index, - boolean isSelected, boolean cellHasFocus) { - CodeCompletion codeCompletion = (CodeCompletion) completion; + public Component getListCellRendererComponent(JList list, + CodeCompletion codeCompletion, int index, boolean isSelected, boolean cellHasFocus) { if (null == codeCompletion.getComponent()) { - return super.getListCellRendererComponent(list, codeCompletion.getDescription(), index, - isSelected, cellHasFocus); + return super.getListCellRendererComponent(list, codeCompletion, index, isSelected, + cellHasFocus); } /* ooh, we have a fancy component! */ 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 48d8e48687..99b87d2ac0 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.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -146,16 +147,16 @@ class AddBlockDialog extends DialogComponentProvider implements ChangeListener { lengthField.setChangeListener(e -> lengthChanged()); addrField.addChangeListener(ev -> addrChanged()); - readCB = new JCheckBox(); + readCB = new GCheckBox(); readCB.setName("Read"); - writeCB = new JCheckBox(); + writeCB = new GCheckBox(); writeCB.setName("Write"); - executeCB = new JCheckBox(); + executeCB = new GCheckBox(); executeCB.setName("Execute"); - volatileCB = new JCheckBox(); + volatileCB = new GCheckBox(); volatileCB.setName("Volatile"); JPanel topPanel = new JPanel(new PairLayout(4, 10, 150)); 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 6f4b0257b4..2cde2fe378 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 @@ -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,14 @@ */ package ghidra.app.plugin.core.printing; -import ghidra.util.HelpLocation; - import java.awt.*; import java.awt.event.*; import javax.swing.*; import docking.DialogComponentProvider; - +import docking.widgets.checkbox.GCheckBox; +import ghidra.util.HelpLocation; public class PrintOptionsDialog extends DialogComponentProvider { @@ -33,18 +31,18 @@ public class PrintOptionsDialog extends DialogComponentProvider { private boolean selectionEnabled; private boolean cancelled = false; - + private JRadioButton selection; private JRadioButton visible; private JRadioButton view; private JCheckBox monochrome; - + private JCheckBox title; private JCheckBox date; private JCheckBox pageNum; - + private ButtonGroup group; - + protected PrintOptionsDialog(boolean selectionEnabled) { super("Print Options", true, false, true, false); setResizable(false); @@ -57,13 +55,13 @@ public class PrintOptionsDialog extends DialogComponentProvider { } @Override - protected void cancelCallback() { + protected void cancelCallback() { close(); cancelled = true; } @Override - protected void okCallback() { + protected void okCallback() { close(); cancelled = false; } @@ -77,9 +75,9 @@ public class PrintOptionsDialog extends DialogComponentProvider { KeyListener key = new KeyAdapter() { @Override - public void keyPressed(KeyEvent e) { + public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { - ((AbstractButton)e.getSource()).setSelected(true); + ((AbstractButton) e.getSource()).setSelected(true); okCallback(); } } @@ -105,33 +103,31 @@ public class PrintOptionsDialog extends DialogComponentProvider { headerPanel.setLayout(new BoxLayout(headerPanel, BoxLayout.X_AXIS)); headerPanel.setBorder(BorderFactory.createTitledBorder("Header and Footer")); - title = new JCheckBox("Title"); + title = new GCheckBox("Title"); title.setSelected(true); title.addKeyListener(key); headerPanel.add(title); - date = new JCheckBox("Date/Time"); + date = new GCheckBox("Date/Time"); date.setSelected(true); date.addKeyListener(key); headerPanel.add(date); - pageNum = new JCheckBox("Page Numbers"); + pageNum = new GCheckBox("Page Numbers"); pageNum.setSelected(true); pageNum.addKeyListener(key); headerPanel.add(pageNum); - JPanel optionsPanel = new JPanel(); optionsPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); optionsPanel.setBorder(BorderFactory.createTitledBorder("Other Print Options")); - monochrome = new JCheckBox("Use Monochrome", true); + monochrome = new GCheckBox("Use Monochrome", true); monochrome.addKeyListener(key); optionsPanel.add(monochrome); - outerPanel.add(rangePanel, BorderLayout.NORTH); outerPanel.add(headerPanel, BorderLayout.CENTER); outerPanel.add(optionsPanel, BorderLayout.SOUTH); - + setFocusComponent(); return outerPanel; @@ -144,28 +140,27 @@ public class PrintOptionsDialog extends DialogComponentProvider { public boolean getVisible() { return visible.isSelected(); } - + public boolean getView() { return view.isSelected(); } - + public boolean getPrintTitle() { return title.isSelected(); } - + public boolean getPrintDate() { return date.isSelected(); } - + public boolean getPrintPageNum() { return pageNum.isSelected(); } - public boolean isCancelled() { return cancelled; } - + public Font getHeaderFont() { return HEADER_FONT; } @@ -173,37 +168,39 @@ public class PrintOptionsDialog extends DialogComponentProvider { public FontMetrics getHeaderMetrics() { return HEADER_METRICS; } - + public boolean showHeader() { return getPrintTitle(); } - + public boolean showFooter() { - return getPrintDate() || getPrintPageNum(); + return getPrintDate() || getPrintPageNum(); } - + public boolean getMonochrome() { return monochrome.isSelected(); } - + public int getHeaderHeight() { return HEADER_METRICS.getMaxAscent() + HEADER_METRICS.getMaxDescent(); } - + public void setSelectionEnabled(boolean selectionEnabled) { this.selectionEnabled = selectionEnabled; selection.setEnabled(selectionEnabled); selection.setSelected(selectionEnabled); - if (!selectionEnabled) + if (!selectionEnabled) { view.setSelected(true); + } setFocusComponent(); } - + public void setFocusComponent() { if (selectionEnabled) { group.setSelected(selection.getModel(), true); setFocusComponent(selection); - } else { + } + else { group.setSelected(view.getModel(), true); setFocusComponent(view); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/processors/InstructionInfoProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/processors/InstructionInfoProvider.java index fceed75f94..71d15fc0e5 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/processors/InstructionInfoProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/processors/InstructionInfoProvider.java @@ -20,6 +20,7 @@ import java.awt.*; import javax.swing.*; import javax.swing.table.DefaultTableModel; +import docking.widgets.checkbox.GCheckBox; import ghidra.app.plugin.processors.sleigh.SleighDebugLogger; import ghidra.app.plugin.processors.sleigh.SleighDebugLogger.SleighDebugMode; import ghidra.framework.model.DomainObjectChangedEvent; @@ -115,7 +116,7 @@ class InstructionInfoProvider extends ComponentProviderAdapter implements Domain pane.setResizeWeight(.25); mainPanel.add(pane, BorderLayout.CENTER); - dynamicUpdateCB = new JCheckBox("Dynamic Update", isDynamic); + dynamicUpdateCB = new GCheckBox("Dynamic Update", isDynamic); dynamicUpdateCB.setAlignmentX(Component.CENTER_ALIGNMENT); dynamicUpdateCB.addItemListener(e -> dynamicStateChanged()); 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 554727d6ea..6ef6161875 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 @@ -30,6 +30,7 @@ import javax.swing.table.AbstractTableModel; import org.jdom.Element; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -94,7 +95,7 @@ class EditMemoryReferencePanel extends EditReferencePanel { private void buildPanel() { setLayout(new PairLayout(10, 10, 160)); - offsetCheckbox = new JCheckBox("Offset:"); + offsetCheckbox = new GCheckBox("Offset:"); offsetCheckbox.setHorizontalAlignment(SwingConstants.RIGHT); offsetCheckbox.addChangeListener(new ChangeListener() { @Override diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferencesProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferencesProvider.java index f444d908af..29e06b5a6d 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferencesProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditReferencesProvider.java @@ -33,6 +33,7 @@ import docking.ActionContext; import docking.action.*; import docking.dnd.DropTgtAdapter; import docking.dnd.Droppable; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.table.*; import ghidra.app.events.ProgramSelectionPluginEvent; import ghidra.app.util.SelectionTransferData; @@ -976,7 +977,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter private JCheckBox checkbox; RefCellBooleanEditor() { - super(new JCheckBox()); + super(new GCheckBox()); setClickCountToStart(1); checkbox = (JCheckBox) editorComponent; checkbox.setOpaque(false); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/OffsetTableDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/OffsetTableDialog.java index 7dd05ec2d0..1ce2c350bb 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/OffsetTableDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/OffsetTableDialog.java @@ -23,6 +23,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GLabel; import ghidra.app.util.AddressInput; @@ -156,7 +157,7 @@ public class OffsetTableDialog extends DialogComponentProvider { panel.add(new GLabel("Select Data Size (Bytes):", SwingConstants.RIGHT)); panel.add(comboBox); - signedCheckBox = new JCheckBox("Signed Data Value(s)", true); + signedCheckBox = new GCheckBox("Signed Data Value(s)", true); panel.add(signedCheckBox); return panel; } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/AsciiSearchFormat.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/AsciiSearchFormat.java index 6334cf6d15..15b6643937 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/AsciiSearchFormat.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchmem/AsciiSearchFormat.java @@ -27,6 +27,7 @@ import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GDLabel; import ghidra.util.StringUtilities; @@ -63,11 +64,11 @@ public class AsciiSearchFormat extends SearchFormat { encodingCB.setSelectedIndex(0); encodingCB.addActionListener(al); - caseSensitiveCkB = new JCheckBox("Case Sensitive"); + caseSensitiveCkB = new GCheckBox("Case Sensitive"); caseSensitiveCkB.setToolTipText("Allows for case sensitive searching."); caseSensitiveCkB.addActionListener(al); - escapeSequencesCkB = new JCheckBox("Escape Sequences"); + escapeSequencesCkB = new GCheckBox("Escape Sequences"); escapeSequencesCkB.setToolTipText( "Allows specifying control characters using escape sequences " + "(i.e., allows \\n to be searched for as a single line feed character)."); 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 a46098ca1f..7f461d2e3b 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.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -419,9 +420,9 @@ class MemSearchDialog extends DialogComponentProvider { } private Container buildCodeUnitTypesPanel() { - final JCheckBox instructionsCheckBox = new JCheckBox("Instructions", true); - final JCheckBox definedCheckBox = new JCheckBox("Defined Data", true); - final JCheckBox undefinedCheckBox = new JCheckBox("Undefined Data", true); + final JCheckBox instructionsCheckBox = new GCheckBox("Instructions", true); + final JCheckBox definedCheckBox = new GCheckBox("Defined Data", true); + final JCheckBox undefinedCheckBox = new GCheckBox("Undefined Data", true); ItemListener stateListener = e -> validate(); 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 cbef2b66dc..4fc43c0ca1 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.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GLabel; import ghidra.app.util.HelpTopics; @@ -282,12 +283,12 @@ class SearchTextDialog extends DialogComponentProvider { private JPanel createOptionsPanel() { JPanel panel = new JPanel(new VerticalLayout(3)); - caseSensitiveCB = new JCheckBox("Case Sensitive"); + caseSensitiveCB = new GCheckBox("Case Sensitive"); caseSensitiveCB.setToolTipText( HTMLUtilities.toHTML("Select this if the search\n should be case sensitive.")); panel.add(caseSensitiveCB); - searchSelectionCB = new JCheckBox("Search Selection"); + searchSelectionCB = new GCheckBox("Search Selection"); panel.add(searchSelectionCB); panel.setBorder(BorderFactory.createTitledBorder("Options")); @@ -304,27 +305,27 @@ class SearchTextDialog extends DialogComponentProvider { BoxLayout bl = new BoxLayout(optionsPanel, BoxLayout.Y_AXIS); optionsPanel.setLayout(bl); - functionsCB = new JCheckBox("Functions"); + functionsCB = new GCheckBox("Functions"); functionsCB.setToolTipText(HTMLUtilities.toHTML("Search in the Function Header fields")); - commentsCB = new JCheckBox("Comments", true); + commentsCB = new GCheckBox("Comments", true); commentsCB.setToolTipText(HTMLUtilities.toHTML("Search in any of the comment fields")); - labelsCB = new JCheckBox("Labels"); + labelsCB = new GCheckBox("Labels"); labelsCB.setToolTipText(HTMLUtilities.toHTML("Search in the Lable field")); - mnemonicsCB = new JCheckBox("Instruction Mnemonics"); + mnemonicsCB = new GCheckBox("Instruction Mnemonics"); mnemonicsCB.setToolTipText( HTMLUtilities.toHTML("Search in the Instruction Mnemonic field")); - operandsCB = new JCheckBox("Instruction Operands"); + operandsCB = new GCheckBox("Instruction Operands"); operandsCB.setToolTipText(HTMLUtilities.toHTML("Search in the Instruction Operand fields")); - dataMnemonicsCB = new JCheckBox("Defined Data Mnemonics"); + dataMnemonicsCB = new GCheckBox("Defined Data Mnemonics"); dataMnemonicsCB.setToolTipText( HTMLUtilities.toHTML("Search in the Data Mnemonic and Value fields")); - dataOperandsCB = new JCheckBox("Defined Data Values"); + dataOperandsCB = new GCheckBox("Defined Data Values"); dataOperandsCB.setToolTipText( HTMLUtilities.toHTML("Search in the Data Mnemonic and Value fields")); 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 e8128003e8..9be56e1bc0 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.checkbox.GCheckBox; import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.label.GLabel; import docking.widgets.textfield.IntegerTextField; @@ -158,8 +159,8 @@ public class SearchStringDialog extends DialogComponentProvider { JPanel panel = new JPanel(new GridLayout(3, 1, 10, 14)); - nullTerminateCheckbox = new JCheckBox("Require Null Termination"); - pascalStringsCheckbox = new JCheckBox("Pascal Strings"); + nullTerminateCheckbox = new GCheckBox("Require Null Termination"); + pascalStringsCheckbox = new GCheckBox("Pascal Strings"); nullTerminateCheckbox.setSelected(true); panel.add(nullTerminateCheckbox); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/StringTableProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/StringTableProvider.java index 6e25919796..e2ba844ced 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/StringTableProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/StringTableProvider.java @@ -25,6 +25,7 @@ import javax.swing.*; import docking.ActionContext; import docking.DockingUtils; import docking.action.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import docking.widgets.table.*; import docking.widgets.table.threaded.ThreadedTableModel; @@ -385,9 +386,9 @@ public class StringTableProvider extends ComponentProviderAdapter implements Dom preview = new JTextField(5); preview.setEditable(false); preview.setEnabled(false); - autoLabelCheckbox = new JCheckBox("Auto Label"); - addAlignmentBytesCheckbox = new JCheckBox("Include Alignment Nulls"); - allowTruncationCheckbox = new JCheckBox("Truncate If Needed"); + autoLabelCheckbox = new GCheckBox("Auto Label"); + addAlignmentBytesCheckbox = new GCheckBox("Include Alignment Nulls"); + allowTruncationCheckbox = new GCheckBox("Truncate If Needed"); autoLabelCheckbox.setSelected(false); // discourage labeling since dynamic labels are preferred JPanel panel = new JPanel(new GridBagLayout()); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symboltree/EditExternalLocationPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symboltree/EditExternalLocationPanel.java index f2140b3147..6770d1ba47 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symboltree/EditExternalLocationPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symboltree/EditExternalLocationPanel.java @@ -28,6 +28,7 @@ import javax.swing.event.DocumentListener; import docking.DockingWindowManager; import docking.ToolTipManager; import docking.widgets.OptionDialog; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -199,7 +200,7 @@ class EditExternalLocationPanel extends JPanel { add(bottomPanel); if (externalLocation == null) { - functionCheckBox = new JCheckBox("Make External Function"); + functionCheckBox = new GCheckBox("Make External Function"); add(functionCheckBox); } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/FilterDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/FilterDialog.java index 52ed97852b..cb83b9219c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/FilterDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/FilterDialog.java @@ -26,6 +26,7 @@ import org.jdom.Element; import docking.ComponentProvider; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GHtmlLabel; import docking.widgets.label.GIconLabel; import ghidra.app.util.HelpTopics; @@ -97,7 +98,7 @@ public class FilterDialog extends DialogComponentProvider { } private JComponent buildWorkPanel() { - advancedFilterCheckbox = new JCheckBox("Use Advanced Filters"); + advancedFilterCheckbox = new GCheckBox("Use Advanced Filters"); advancedFilterCheckbox.setToolTipText(HTMLUtilities.toHTML( "Show advance filters. Advanced filters eliminate all appropriate\n" + "symbols that don't match the filter. Selecting mutually exclusive filters\n" + @@ -147,7 +148,7 @@ public class FilterDialog extends DialogComponentProvider { String[] sourceNames = filter.getSourceFilterNames(); JPanel panel = new JPanel(new GridLayout(0, 2)); for (String sourceName : sourceNames) { - JCheckBox cb = new JCheckBox(sourceName); + JCheckBox cb = new GCheckBox(sourceName); checkBoxMap.put(sourceName, cb); cb.addItemListener(sourceItemListener); cb.setToolTipText(HTMLUtilities.toHTML(filter.getFilterDescription(sourceName))); @@ -179,7 +180,7 @@ public class FilterDialog extends DialogComponentProvider { filtersPanel.setBorder(BorderFactory.createEmptyBorder(0, 40, 0, 0)); String[] filterNames = filter.getAdvancedFilterNames(); for (String filterName : filterNames) { - JCheckBox cb = new JCheckBox(filterName); + JCheckBox cb = new GCheckBox(filterName); checkBoxMap.put(filterName, cb); cb.addItemListener(checkboxListener); cb.setToolTipText(HTMLUtilities.toHTML(filter.getFilterDescription(filterName))); @@ -207,7 +208,7 @@ public class FilterDialog extends DialogComponentProvider { JPanel panel = new JPanel(new VerticalLayout(0)); panel.setBorder(BorderFactory.createTitledBorder(title)); for (String filterName : filterNames) { - JCheckBox cb = new JCheckBox(filterName); + JCheckBox cb = new GCheckBox(filterName); cb.setName(filterName); checkBoxMap.put(filterName, cb); cb.addItemListener(checkboxListener); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/SymbolPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/SymbolPanel.java index d5c5e6654d..dcfb12b93f 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/SymbolPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symtable/SymbolPanel.java @@ -25,6 +25,7 @@ import javax.swing.table.TableColumn; import org.jdom.Element; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.table.DefaultRowFilterTransformer; import docking.widgets.table.RowFilterTransformer; import ghidra.app.services.GoToService; @@ -98,7 +99,7 @@ class SymbolPanel extends JPanel { tableFilterPanel.add(Box.createHorizontalStrut(5)); - final JCheckBox nameColumnOnlyCheckbox = new JCheckBox("Name Only"); + final JCheckBox nameColumnOnlyCheckbox = new GCheckBox("Name Only"); nameColumnOnlyCheckbox.setName("NameOnly"); // used by JUnit nameColumnOnlyCheckbox.setToolTipText( "Selected causes filter to only consider the symbol's name."); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayDialog.java index 884d8f6c35..799af68a53 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayDialog.java @@ -24,6 +24,7 @@ import javax.swing.border.Border; import docking.DialogComponentProvider; import docking.DockingWindowManager; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import resources.ResourceManager; @@ -62,7 +63,7 @@ class TipOfTheDayDialog extends DialogComponentProvider { tipScroll.setBorder(null); tipScroll.setPreferredSize(tipArea.getPreferredSize()); - showTipsCheckbox = new JCheckBox("Show Tips on Startup?"); + showTipsCheckbox = new GCheckBox("Show Tips on Startup?"); showTipsCheckbox.setSelected(true); // TODO (FixMe) Moved this before its listener to prevent project save for now. showTipsCheckbox.addItemListener(new ItemListener() { @Override diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/script/MultipleOptionsDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/script/MultipleOptionsDialog.java index 3f6c161f0e..83438fa00f 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/script/MultipleOptionsDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/script/MultipleOptionsDialog.java @@ -26,6 +26,7 @@ import javax.swing.*; import docking.DialogComponentProvider; import docking.DockingWindowManager; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.util.Msg; @@ -33,7 +34,7 @@ public class MultipleOptionsDialog extends DialogComponentProvider { private boolean isCanceled; - private JCheckBox[] selectOptions; + private GCheckBox[] selectOptions; private List actualChoices; private List stringChoices; private List chosenByUser; @@ -76,7 +77,7 @@ public class MultipleOptionsDialog extends DialogComponentProvider { if (includeSelectAll) { selectAllGroup = new SelectAllCheckBox(); - JCheckBox selectAllCheckBox = new JCheckBox("[ Select All ]", false); + GCheckBox selectAllCheckBox = new GCheckBox("[ Select All ]", false); selectAllCheckBox.setName("select.all.check.box"); panel.add(selectAllCheckBox); panel.add(new JSeparator()); @@ -84,10 +85,10 @@ public class MultipleOptionsDialog extends DialogComponentProvider { selectAllGroup.setSelectAllCheckBox(selectAllCheckBox); } - selectOptions = new JCheckBox[stringChoices.size()]; + selectOptions = new GCheckBox[stringChoices.size()]; for (int i = 0; i < selectOptions.length; i++) { - JCheckBox newCheckBox = new JCheckBox(stringChoices.get(i)); + GCheckBox newCheckBox = new GCheckBox(stringChoices.get(i)); newCheckBox.setActionCommand(Integer.toString(i)); newCheckBox.setName("choice.check.box." + (i + 1)); newCheckBox.setSelected(false); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddEditDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddEditDialog.java index 8dadf81ea7..f42980ba6c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddEditDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/AddEditDialog.java @@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils; import docking.ComponentProvider; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import ghidra.app.cmd.label.*; import ghidra.framework.cmd.CompoundCmd; @@ -432,14 +433,14 @@ public class AddEditDialog extends DialogComponentProvider { comboBox.setEnterKeyForwarding(true); namespaceChoices = comboBox; - primaryCheckBox = new JCheckBox("Primary"); + primaryCheckBox = new GCheckBox("Primary"); primaryCheckBox.setMnemonic('P'); primaryCheckBox.setToolTipText( "Make this label be the one that shows up in references to this location."); - entryPointCheckBox = new JCheckBox("Entry Point "); + entryPointCheckBox = new GCheckBox("Entry Point "); entryPointCheckBox.setMnemonic('E'); entryPointCheckBox.setToolTipText("Mark this location as an external entry point."); - pinnedCheckBox = new JCheckBox("Pinned"); + pinnedCheckBox = new GCheckBox("Pinned"); pinnedCheckBox.setMnemonic('A'); pinnedCheckBox.setToolTipText( "Do not allow this label to move when the image base changes or a memory block is moved."); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/OptionsEditorPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/OptionsEditorPanel.java index d8d11a4b0f..380359d337 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/OptionsEditorPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/OptionsEditorPanel.java @@ -28,6 +28,7 @@ import javax.swing.event.DocumentListener; import org.apache.commons.collections4.map.LazyMap; import docking.DockingWindowManager; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GLabel; import docking.widgets.textfield.IntegerTextField; @@ -222,7 +223,7 @@ public class OptionsEditorPanel extends JPanel { e -> DockingWindowManager.showDialog(panel, new LibraryPathsDialog())); Boolean value = (Boolean) option.getValue(); boolean initialState = value != null ? value : false; - JCheckBox jCheckBox = new JCheckBox("", initialState); + GCheckBox jCheckBox = new GCheckBox("", initialState); button.setEnabled(initialState); jCheckBox.addActionListener(e -> { boolean b = jCheckBox.isSelected(); @@ -292,7 +293,7 @@ public class OptionsEditorPanel extends JPanel { } private Component getBooleanEditorComponent(Option option) { - JCheckBox cb = new JCheckBox(); + GCheckBox cb = new GCheckBox(); cb.setName(option.getName()); Boolean b = (Boolean) option.getValue(); boolean initialState = b != null ? b : false; 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 190b1d9ace..8391ddc5a9 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.checkbox.GCheckBox; import docking.widgets.filter.FilterListener; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -247,7 +248,7 @@ public class SetEquateDialog extends DialogComponentProvider { group.add(applyToSelection); group.add(applyToAll); - overwriteExistingEquates = new JCheckBox("Overwrite existing equates", false); + overwriteExistingEquates = new GCheckBox("Overwrite existing equates", false); overwriteExistingEquates.setName("Overwrite"); overwriteExistingEquates.setEnabled(false); overwriteExistingEquates.setToolTipText("If checked, apply equates to all unmarked " + diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/ApplyEnumDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/ApplyEnumDialog.java index 4988021548..dd82eef761 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/ApplyEnumDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/ApplyEnumDialog.java @@ -17,6 +17,7 @@ package ghidra.app.util.datatype; import javax.swing.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.framework.plugintool.PluginTool; import ghidra.program.model.data.DataTypeManager; @@ -38,7 +39,7 @@ public class ApplyEnumDialog extends DataTypeSelectionDialog { updatedPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 0)); updatedPanel.setLayout(new VerticalLayout(5)); - JCheckBox subOpCB = new JCheckBox("Apply to sub-operands", shouldApplyOnSubOps); + JCheckBox subOpCB = new GCheckBox("Apply to sub-operands", shouldApplyOnSubOps); subOpCB.setName("subOpCB"); subOpCB.setToolTipText("Applies this enum to the 'nested scalars'."); subOpCB.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/dialog/CheckoutDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/dialog/CheckoutDialog.java index 0e41c8b2ad..5004960bc3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/dialog/CheckoutDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/dialog/CheckoutDialog.java @@ -25,6 +25,7 @@ import docking.DialogComponentProvider; import docking.DockingWindowManager; import docking.widgets.MultiLineLabel; import docking.widgets.OptionDialog; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GIconLabel; import ghidra.app.util.HelpTopics; import ghidra.framework.model.DomainFile; @@ -124,7 +125,7 @@ public class CheckoutDialog extends DialogComponentProvider { if (user != null) { exclusiveCheckout = false; if (user.hasWritePermission()) { - final JCheckBox exclusiveCB = new JCheckBox("Request exclusive check out"); + final JCheckBox exclusiveCB = new GCheckBox("Request exclusive check out"); exclusiveCB.setSelected(false); exclusiveCB.addActionListener(new ActionListener() { @Override diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java index 4fc1110390..9db2f3fc2d 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java @@ -23,6 +23,7 @@ import java.util.List; import javax.swing.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.textfield.HintTextField; import ghidra.app.util.*; import ghidra.app.util.opinion.IntelHexRecord; @@ -296,14 +297,14 @@ public class IntelHexExporter extends Exporter { private class RecordSizeComponent extends JPanel { private HintTextField input; - private JCheckBox dropCb; + private GCheckBox dropCb; public RecordSizeComponent(int recordSize) { setLayout(new BorderLayout()); input = new HintTextField(Integer.toString(recordSize), false, new BoundedIntegerVerifier()); - dropCb = new JCheckBox("Align To Record Size"); + dropCb = new GCheckBox("Align To Record Size"); input.setText(Integer.toString(recordSize)); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/navigation/GoToAddressLabelDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/navigation/GoToAddressLabelDialog.java index 30f86f80bd..23f1a9d325 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/navigation/GoToAddressLabelDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/navigation/GoToAddressLabelDialog.java @@ -29,6 +29,7 @@ import javax.swing.event.HyperlinkListener; import docking.DialogComponentProvider; import docking.DockingWindowManager; import docking.widgets.HyperlinkComponent; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import ghidra.GhidraOptions; import ghidra.app.nav.Navigatable; @@ -211,12 +212,12 @@ public class GoToAddressLabelDialog extends DialogComponentProvider implements G gbc.gridwidth = 2; inner.add(comboBox, gbc); - caseSensitiveBox = new JCheckBox("Case sensitive", false); + caseSensitiveBox = new GCheckBox("Case sensitive", false); gbc.gridy = 2; gbc.gridwidth = 1; inner.add(caseSensitiveBox, gbc); - includeDynamicBox = new JCheckBox("Dynamic labels", true); + includeDynamicBox = new GCheckBox("Dynamic labels", true); includeDynamicBox.setToolTipText("Include dynamic lables in the search (slower)"); gbc.gridx = 1; inner.add(includeDynamicBox, gbc); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/AddressFieldOptionsPropertyEditor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/AddressFieldOptionsPropertyEditor.java index d5a39118ce..a445d37095 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/AddressFieldOptionsPropertyEditor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/AddressFieldOptionsPropertyEditor.java @@ -22,6 +22,7 @@ import java.math.BigInteger; import javax.swing.*; import docking.ToolTipManager; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.textfield.IntegerTextField; @@ -78,7 +79,7 @@ public class AddressFieldOptionsPropertyEditor extends PropertyEditorSupport JLabel label = new GDLabel(SHOW_BLOCK_NAME_LABEL, SwingConstants.RIGHT); ToolTipManager.setToolTipText(label, SHOW_BLOCKNAME_TOOLTIP); panel.add(label); - showBlocknameCheckbox = new JCheckBox(); + showBlocknameCheckbox = new GCheckBox(); ToolTipManager.setToolTipText(showBlocknameCheckbox, SHOW_BLOCKNAME_TOOLTIP); panel.add(showBlocknameCheckbox); @@ -86,7 +87,7 @@ public class AddressFieldOptionsPropertyEditor extends PropertyEditorSupport label = new GDLabel(PADDING_LABEL, SwingConstants.RIGHT); ToolTipManager.setToolTipText(label, ADDRESS_PADDING_TOOLTIP); panel.add(label); - padCheckBox = new JCheckBox(); + padCheckBox = new GCheckBox(); panel.add(padCheckBox); padCheckBox.setSelected(false); ToolTipManager.setToolTipText(padCheckBox, ADDRESS_PADDING_TOOLTIP); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ArrayElementPropertyEditor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ArrayElementPropertyEditor.java index a560dee40b..e2993f191d 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ArrayElementPropertyEditor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ArrayElementPropertyEditor.java @@ -27,6 +27,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import docking.ToolTipManager; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import docking.widgets.textfield.IntegerTextField; import ghidra.framework.options.CustomOptionsEditor; @@ -66,7 +67,7 @@ public class ArrayElementPropertyEditor extends PropertyEditorSupport JPanel panel = new JPanel(new VerticalLayout(3)); // the namespace checkbox will disable the text field options when it is not used - groupElementsCheckBox = new JCheckBox(SHOW_MULTI_ELEMENTS_LABEL); + groupElementsCheckBox = new GCheckBox(SHOW_MULTI_ELEMENTS_LABEL); groupElementsCheckBox.setSelected(true); ToolTipManager.setToolTipText(groupElementsCheckBox, SHOW_MULTI_ELEMENTS_TOOLTIP); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/NamespacePropertyEditor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/NamespacePropertyEditor.java index 6cb9d81551..62db359cc6 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/NamespacePropertyEditor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/NamespacePropertyEditor.java @@ -25,6 +25,7 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import docking.ToolTipManager; +import docking.widgets.checkbox.GCheckBox; import ghidra.framework.options.CustomOptionsEditor; import ghidra.util.HTMLUtilities; import ghidra.util.layout.VerticalLayout; @@ -73,15 +74,15 @@ public class NamespacePropertyEditor extends PropertyEditorSupport implements Cu JPanel panel = new JPanel(new VerticalLayout(3)); // the namespace checkbox will disable the text field options when it is not used - showNonLocalCheckBox = new JCheckBox(DISPLAY_NON_LOCAL_NAMESPACE_LABEL); + showNonLocalCheckBox = new GCheckBox(DISPLAY_NON_LOCAL_NAMESPACE_LABEL); showNonLocalCheckBox.setSelected(false); ToolTipManager.setToolTipText(showNonLocalCheckBox, SHOW_NON_LOCAL_NAMESPACE_TOOLTIP); - showLocalCheckBox = new JCheckBox(DISPLAY_LOCAL_NAMESPACE_LABEL); + showLocalCheckBox = new GCheckBox(DISPLAY_LOCAL_NAMESPACE_LABEL); showLocalCheckBox.setSelected(false); ToolTipManager.setToolTipText(showLocalCheckBox, SHOW_LOCAL_NAMESPACE_TOOLTIP); - showLibraryInNamespaceCheckBox = new JCheckBox(DISPLAY_LIBRARY_IN_NAMESPACE_LABEL); + showLibraryInNamespaceCheckBox = new GCheckBox(DISPLAY_LIBRARY_IN_NAMESPACE_LABEL); showLibraryInNamespaceCheckBox.setSelected(true); ToolTipManager.setToolTipText(showLocalCheckBox, SHOW_LIBRARY_IN_NAMESPACE_TOOLTIP); @@ -116,7 +117,7 @@ public class NamespacePropertyEditor extends PropertyEditorSupport implements Cu JPanel textFieldPanel = new JPanel(); textFieldPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); - useLocalPrefixCheckBox = new JCheckBox("Use Local Namespace Override"); + useLocalPrefixCheckBox = new GCheckBox("Use Local Namespace Override"); ToolTipManager.setToolTipText(useLocalPrefixCheckBox, tooltipText); useLocalPrefixCheckBox.addItemListener(e -> { textField.setEnabled(useLocalPrefixCheckBox.isSelected()); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/options/OptionsGui.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/options/OptionsGui.java index 598159674c..3d6fb66205 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/options/OptionsGui.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/options/OptionsGui.java @@ -26,6 +26,7 @@ import java.util.List; import javax.swing.*; import javax.swing.border.Border; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.fieldpanel.*; import docking.widgets.fieldpanel.field.*; @@ -352,8 +353,8 @@ public class OptionsGui extends JPanel { JPanel panel2 = new JPanel(new FlowLayout()); JPanel subPanel = new JPanel(new GridLayout(1, 2, 2, 4)); - globalBoldCheckbox = new JCheckBox("Bold"); - globalItalicsCheckbox = new JCheckBox("Italics"); + globalBoldCheckbox = new GCheckBox("Bold"); + globalItalicsCheckbox = new GCheckBox("Italics"); subPanel.add(globalBoldCheckbox); subPanel.add(globalItalicsCheckbox); panel2.add(subPanel); @@ -396,9 +397,9 @@ public class OptionsGui extends JPanel { JPanel subPanel = new JPanel(new GridLayout(1, 3, 2, 4)); subPanel.setBorder(BorderFactory.createTitledBorder(border, "Style Settings")); - boldCheckbox = new JCheckBox("Bold"); - italicsCheckbox = new JCheckBox("Italics"); - customCheckbox = new JCheckBox("Custom"); + boldCheckbox = new GCheckBox("Bold"); + italicsCheckbox = new GCheckBox("Italics"); + customCheckbox = new GCheckBox("Custom"); subPanel.add(customCheckbox); subPanel.add(boldCheckbox); subPanel.add(italicsCheckbox); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerListPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerListPanel.java index 152cbf7bdc..e3ac7a2364 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerListPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerListPanel.java @@ -24,6 +24,7 @@ import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.app.services.Analyzer; import ghidra.framework.analysis.*; @@ -51,15 +52,9 @@ public class AnalyzerListPanel extends JPanel { // jScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); add(jScrollPane, BorderLayout.CENTER); if (phase != null) { - final JCheckBox checkbox = new JCheckBox("Create Checkpoint When Phase Completed"); - checkbox.setSelected(phase.isCheckPoint()); - checkbox.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - relevantPhase.setIsCheckPoint(checkbox.isSelected()); - } - }); + GCheckBox checkbox = + new GCheckBox("Create Checkpoint When Phase Completed", phase.isCheckPoint()); + checkbox.addActionListener(e -> relevantPhase.setIsCheckPoint(checkbox.isSelected())); add(checkbox, BorderLayout.SOUTH); if (phase == recipe.getLastPhase()) { checkbox.setEnabled(false); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerPanel.java index 2346de911c..e110cec6ec 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/framework/analysis/gui/AnalyzerPanel.java @@ -16,14 +16,13 @@ package ghidra.framework.analysis.gui; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.List; import javax.swing.*; import javax.swing.border.BevelBorder; import javax.swing.border.Border; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import ghidra.app.services.Analyzer; import ghidra.app.services.AnalyzerType; @@ -91,13 +90,9 @@ public class AnalyzerPanel extends JPanel { JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.setBorder(BorderFactory.createEmptyBorder(2, 10, 2, 10)); - enabledCheckbox = new JCheckBox(); - enabledCheckbox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - recipe.setAnalyzerEnablement(analyzer, enabledCheckbox.isSelected()); - } - }); + enabledCheckbox = new GCheckBox(); + enabledCheckbox.addActionListener( + e -> recipe.setAnalyzerEnablement(analyzer, enabledCheckbox.isSelected())); enabledCheckbox.setSelected(recipe.isAnalyzerEnabled(analyzer)); panel.add(enabledCheckbox, BorderLayout.WEST); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/NewLanguagePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/NewLanguagePanel.java index 91b42e2098..5358005492 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/NewLanguagePanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/NewLanguagePanel.java @@ -23,6 +23,7 @@ import java.util.List; import javax.swing.*; import javax.swing.border.Border; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import ghidra.program.model.lang.*; import ghidra.program.util.DefaultLanguageService; @@ -67,7 +68,7 @@ public class NewLanguagePanel extends JPanel { descriptionLabel = new GDLabel(DEFAULT_DESCRIPTION_TEXT); descriptionLabel.setFont(descriptionLabel.getFont().deriveFont(Font.ITALIC)); - recommendedCheckbox = new JCheckBox("Show Only Recommended Language/Compiler Specs"); + recommendedCheckbox = new GCheckBox("Show Only Recommended Language/Compiler Specs"); recommendedCheckbox.addItemListener(e -> { switch (e.getStateChange()) { case ItemEvent.SELECTED: diff --git a/Ghidra/Features/Base/src/main/java/ghidra/plugins/importer/batch/BatchImportDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/plugins/importer/batch/BatchImportDialog.java index 68e9909c2c..356b7dfc6a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/plugins/importer/batch/BatchImportDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/plugins/importer/batch/BatchImportDialog.java @@ -32,6 +32,7 @@ import javax.swing.table.*; import docking.DialogComponentProvider; import docking.widgets.ListSelectionTableDialog; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.filechooser.GhidraFileChooserMode; @@ -288,27 +289,19 @@ public class BatchImportDialog extends DialogComponentProvider { JPanel outputChoicesPanel = new JPanel(); outputChoicesPanel.setLayout(new BoxLayout(outputChoicesPanel, BoxLayout.LINE_AXIS)); - JCheckBox stripLeadingCb = new JCheckBox("Strip leading path"); - stripLeadingCb.setSelected(stripLeading); - stripLeadingCb.addChangeListener(e -> { - setStripLeading(stripLeadingCb.isSelected()); - }); + GCheckBox stripLeadingCb = new GCheckBox("Strip leading path", stripLeading); + stripLeadingCb.addChangeListener(e -> setStripLeading(stripLeadingCb.isSelected())); stripLeadingCb.setToolTipText("The destination folder for imported files will not " + "include the source file's leading path"); - JCheckBox stripContainerCb = new JCheckBox("Strip container paths"); - stripContainerCb.setSelected(stripContainer); - stripContainerCb.addChangeListener(e -> { - setStripContainer(stripContainerCb.isSelected()); - }); + GCheckBox stripContainerCb = new GCheckBox("Strip container paths", stripContainer); + stripContainerCb.addChangeListener(e -> setStripContainer(stripContainerCb.isSelected())); stripContainerCb.setToolTipText( "The destination folder for imported files will not include any source path names"); - JCheckBox openAfterImportCb = new JCheckBox("Open after import"); - openAfterImportCb.setSelected(openAfterImporting); - openAfterImportCb.addChangeListener(e -> { - setOpenAfterImporting(openAfterImportCb.isSelected()); - }); + GCheckBox openAfterImportCb = new GCheckBox("Open after import", openAfterImporting); + openAfterImportCb.addChangeListener( + e -> setOpenAfterImporting(openAfterImportCb.isSelected())); openAfterImportCb.setToolTipText("Open imported binaries in Code Browser"); outputChoicesPanel.add(stripLeadingCb); diff --git a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerOptionsDialog.java b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerOptionsDialog.java index b3635431fb..f6c9f7e581 100644 --- a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerOptionsDialog.java +++ b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerOptionsDialog.java @@ -29,6 +29,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.app.plugin.core.format.ByteBlockSelection; import ghidra.app.plugin.core.format.DataFormatModel; @@ -115,7 +116,7 @@ public class ByteViewerOptionsDialog extends DialogComponentProvider Set currentViews = provider.getCurrentViews(); List dataModelNames = provider.getDataFormatNames(); for (String formatName : dataModelNames) { - JCheckBox checkBox = new JCheckBox(formatName); + GCheckBox checkBox = new GCheckBox(formatName); checkBox.addActionListener(this); checkboxMap.put(formatName, checkBox); if (currentViews.contains(formatName)) { diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/plugin/ActiveFidConfigureDialog.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/plugin/ActiveFidConfigureDialog.java index ea6a393d76..e9530bb460 100644 --- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/plugin/ActiveFidConfigureDialog.java +++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/plugin/ActiveFidConfigureDialog.java @@ -23,6 +23,7 @@ import java.util.List; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import ghidra.feature.fid.db.FidFile; import ghidra.util.HelpLocation; import ghidra.util.layout.VerticalLayout; @@ -39,7 +40,7 @@ public class ActiveFidConfigureDialog extends DialogComponentProvider { public ActiveFidConfigureDialog(List fidFiles) { super("Select Active Fid Databases", true, false, true, false); - this.fidFiles = new ArrayList(fidFiles); + this.fidFiles = new ArrayList<>(fidFiles); Collections.sort(fidFiles); addWorkPanel(buildMainPanel()); @@ -91,10 +92,9 @@ public class ActiveFidConfigureDialog extends DialogComponentProvider { panel.setBackground(Color.WHITE); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); for (FidFile fidFile : fidFiles) { - JCheckBox checkbox = new JCheckBox(fidFile.getName()); + GCheckBox checkbox = new GCheckBox(fidFile.getName(), fidFile.isActive()); checkbox.setToolTipText(fidFile.getPath()); checkboxes.add(checkbox); - checkbox.setSelected(fidFile.isActive()); checkbox.addItemListener(e -> fidFile.setActive(checkbox.isSelected())); panel.add(checkbox); } diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java index 140055b228..4450d1687f 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java @@ -28,6 +28,7 @@ import docking.ActionContext; import docking.WindowPosition; import docking.action.DockingAction; import docking.action.ToolBarData; +import docking.widgets.checkbox.GCheckBox; import ghidra.app.util.HelpTopics; import ghidra.framework.plugintool.ComponentProviderAdapter; import ghidra.framework.plugintool.Plugin; @@ -131,7 +132,7 @@ public class DiffDetailsProvider extends ComponentProviderAdapter { */ private void createAutoUpdateCheckBox() { - autoUpdateCB = new JCheckBox("Automatically Update Details", false); + autoUpdateCB = new GCheckBox("Automatically Update Details", false); autoUpdateCB.setName(AUTO_UPDATE_CHECK_BOX); autoUpdateCB.addActionListener(e -> { autoUpdate = autoUpdateCB.isSelected(); @@ -147,7 +148,7 @@ public class DiffDetailsProvider extends ComponentProviderAdapter { */ private void createFilterDiffsCheckBox() { - filterDiffsCB = new JCheckBox("Only Show Expected Difference Types", false); + filterDiffsCB = new GCheckBox("Only Show Expected Difference Types", false); filterDiffsCB.setName(FILTER_DIFFS_CHECK_BOX); filterDiffsCB.addActionListener(e -> { filterDiffs = filterDiffsCB.isSelected(); diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ExecuteDiffDialog.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ExecuteDiffDialog.java index e08d579114..ce9e39eefc 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ExecuteDiffDialog.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ExecuteDiffDialog.java @@ -15,12 +15,6 @@ */ package ghidra.app.plugin.core.diff; -import ghidra.program.model.address.*; -import ghidra.program.model.listing.Program; -import ghidra.program.util.ProgramDiffFilter; -import ghidra.program.util.ProgramMemoryComparator; -import ghidra.util.HelpLocation; - import java.awt.*; import java.awt.event.*; import java.util.ArrayList; @@ -32,6 +26,12 @@ import javax.swing.border.TitledBorder; import docking.DialogComponentProvider; import docking.DockingUtils; import docking.ToolTipManager; +import docking.widgets.checkbox.GCheckBox; +import ghidra.program.model.address.*; +import ghidra.program.model.listing.Program; +import ghidra.program.util.ProgramDiffFilter; +import ghidra.program.util.ProgramMemoryComparator; +import ghidra.util.HelpLocation; /** * The ExecuteDiffDialog is used whenever initiating a Program Diff. @@ -70,7 +70,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider { private ProgramDiffFilter diffFilter; private JPanel diffPanel; - private ArrayList listenerList = new ArrayList(); + private ArrayList listenerList = new ArrayList<>(); private boolean limitToSelection; private AddressSetView pgm1MemorySet; private AddressSetView pgm1SelectionSet; @@ -178,16 +178,13 @@ public class ExecuteDiffDialog extends DialogComponentProvider { private JPanel createLimitPanel() { JPanel panel = new JPanel(); - limitToSelectionCB = new JCheckBox("Limit To Selection"); + limitToSelectionCB = new GCheckBox("Limit To Selection"); limitToSelectionCB.setName("LimitToSelectionDiffCB"); ToolTipManager.setToolTipText(limitToSelectionCB, "Limits the Diff to the selection."); - limitToSelectionCB.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent ev) { - limitToSelection = limitToSelectionCB.isSelected(); - updateDiffSetText(); - clearStatusText(); - } + limitToSelectionCB.addActionListener(ev -> { + limitToSelection = limitToSelectionCB.isSelected(); + updateDiffSetText(); + clearStatusText(); }); panel.add(limitToSelectionCB); @@ -201,8 +198,8 @@ public class ExecuteDiffDialog extends DialogComponentProvider { private JPanel createDiffFilterPanel() { JPanel checkBoxPanel = new JPanel(); ToolTipManager.setToolTipText(checkBoxPanel, - "Check the types of differences between the two " - + "programs that you want detected and highlighted."); + "Check the types of differences between the two " + + "programs that you want detected and highlighted."); createBytesCheckBox(); createLabelsCheckBox(); @@ -239,136 +236,109 @@ public class ExecuteDiffDialog extends DialogComponentProvider { } private void createBytesCheckBox() { - diffBytesCB = new JCheckBox("Bytes", diffBytes); + diffBytesCB = new GCheckBox("Bytes", diffBytes); diffBytesCB.setName("BytesDiffCB"); ToolTipManager.setToolTipText(diffBytesCB, "Highlight byte differences."); - diffBytesCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffBytes = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.BYTE_DIFFS, diffBytes); - clearStatusText(); - } + diffBytesCB.addItemListener(event -> { + diffBytes = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.BYTE_DIFFS, diffBytes); + clearStatusText(); }); } private void createLabelsCheckBox() { - diffLabelsCB = new JCheckBox("Labels", diffLabels); + diffLabelsCB = new GCheckBox("Labels", diffLabels); diffLabelsCB.setName("LabelsDiffCB"); ToolTipManager.setToolTipText(diffLabelsCB, "Highlight label differences."); - diffLabelsCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffLabels = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.SYMBOL_DIFFS, diffLabels); - clearStatusText(); - } + diffLabelsCB.addItemListener(event -> { + diffLabels = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.SYMBOL_DIFFS, diffLabels); + clearStatusText(); }); } private void createCodeUnitsCheckBox() { - diffCodeUnitsCB = new JCheckBox("Code Units", diffCodeUnits); + diffCodeUnitsCB = new GCheckBox("Code Units", diffCodeUnits); diffCodeUnitsCB.setName("CodeUnitsDiffCB"); - ToolTipManager.setToolTipText(diffCodeUnitsCB, "Highlight the instruction, data, " - + "and equate differences."); - diffCodeUnitsCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffCodeUnits = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.CODE_UNIT_DIFFS, diffCodeUnits); - diffFilter.setFilter(ProgramDiffFilter.EQUATE_DIFFS, diffCodeUnits); - clearStatusText(); - } + ToolTipManager.setToolTipText(diffCodeUnitsCB, + "Highlight the instruction, data, " + "and equate differences."); + diffCodeUnitsCB.addItemListener(event -> { + diffCodeUnits = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.CODE_UNIT_DIFFS, diffCodeUnits); + diffFilter.setFilter(ProgramDiffFilter.EQUATE_DIFFS, diffCodeUnits); + clearStatusText(); }); } private void createReferencesCheckBox() { - diffReferencesCB = new JCheckBox("References", diffReferences); + diffReferencesCB = new GCheckBox("References", diffReferences); diffReferencesCB.setName("ReferencesDiffCB"); ToolTipManager.setToolTipText(diffReferencesCB, "Highlight the reference differences."); - diffReferencesCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffReferences = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.REFERENCE_DIFFS, diffReferences); - clearStatusText(); - } + diffReferencesCB.addItemListener(event -> { + diffReferences = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.REFERENCE_DIFFS, diffReferences); + clearStatusText(); }); } private void createProgramContextCheckBox() { - diffProgramContextCB = new JCheckBox("Program Context", diffProgramContext); + diffProgramContextCB = new GCheckBox("Program Context", diffProgramContext); diffProgramContextCB.setName("ProgramContextDiffCB"); ToolTipManager.setToolTipText(diffProgramContextCB, "Highlight the program context register differences."); - diffProgramContextCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffProgramContext = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.PROGRAM_CONTEXT_DIFFS, diffProgramContext); - clearStatusText(); - } + diffProgramContextCB.addItemListener(event -> { + diffProgramContext = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.PROGRAM_CONTEXT_DIFFS, diffProgramContext); + clearStatusText(); }); } private void createCommentsCheckBox() { - diffCommentsCB = new JCheckBox("Comments", diffComments); + diffCommentsCB = new GCheckBox("Comments", diffComments); diffCommentsCB.setName("CommentsDiffCB"); ToolTipManager.setToolTipText(diffCommentsCB, "Highlight comment differences."); - diffCommentsCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffComments = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.COMMENT_DIFFS, diffComments); - clearStatusText(); - } + diffCommentsCB.addItemListener(event -> { + diffComments = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.COMMENT_DIFFS, diffComments); + clearStatusText(); }); } private void createBookmarksCheckBox() { - diffBookmarksCB = new JCheckBox("Bookmarks", diffBookmarks); + diffBookmarksCB = new GCheckBox("Bookmarks", diffBookmarks); diffBookmarksCB.setName("BookmarksDiffCB"); - ToolTipManager.setToolTipText(diffBookmarksCB, "Highlight bookmark differences. " - + "(for example, bookmark differences)"); - diffBookmarksCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffBookmarks = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.BOOKMARK_DIFFS, diffBookmarks); - clearStatusText(); - } + ToolTipManager.setToolTipText(diffBookmarksCB, + "Highlight bookmark differences. " + "(for example, bookmark differences)"); + diffBookmarksCB.addItemListener(event -> { + diffBookmarks = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.BOOKMARK_DIFFS, diffBookmarks); + clearStatusText(); }); } private void createPropertiesCheckBox() { - diffPropertiesCB = new JCheckBox("Properties", diffProperties); + diffPropertiesCB = new GCheckBox("Properties", diffProperties); diffPropertiesCB.setName("PropertiesDiffCB"); ToolTipManager.setToolTipText(diffPropertiesCB, - "Highlight user defined property differences. " - + "(for example, Format (space) differences)"); - diffPropertiesCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffProperties = (event.getStateChange() == ItemEvent.SELECTED); - diffFilter.setFilter(ProgramDiffFilter.USER_DEFINED_DIFFS, diffProperties); - clearStatusText(); - } + "Highlight user defined property differences. " + + "(for example, Format (space) differences)"); + diffPropertiesCB.addItemListener(event -> { + diffProperties = (event.getStateChange() == ItemEvent.SELECTED); + diffFilter.setFilter(ProgramDiffFilter.USER_DEFINED_DIFFS, diffProperties); + clearStatusText(); }); } private void createFunctionsCheckBox() { - diffFunctionsCB = new JCheckBox("Functions", diffFunctions); + diffFunctionsCB = new GCheckBox("Functions", diffFunctions); diffFunctionsCB.setName("FunctionsDiffCB"); ToolTipManager.setToolTipText(diffFunctionsCB, "Highlight function differences."); - diffFunctionsCB.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent event) { - diffFunctions = (event.getStateChange() == ItemEvent.SELECTED); - // Functions check box controls both functions and function tags. - diffFilter.setFilter(ProgramDiffFilter.FUNCTION_DIFFS, diffFunctions); - diffFilter.setFilter(ProgramDiffFilter.FUNCTION_TAG_DIFFS, diffFunctions); - clearStatusText(); - } + diffFunctionsCB.addItemListener(event -> { + diffFunctions = (event.getStateChange() == ItemEvent.SELECTED); + // Functions check box controls both functions and function tags. + diffFilter.setFilter(ProgramDiffFilter.FUNCTION_DIFFS, diffFunctions); + diffFilter.setFilter(ProgramDiffFilter.FUNCTION_TAG_DIFFS, diffFunctions); + clearStatusText(); }); } diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/editors/TagEditorRenderer.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/editors/TagEditorRenderer.java index 401211a9d8..870f93b6f3 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/editors/TagEditorRenderer.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/editors/TagEditorRenderer.java @@ -24,12 +24,13 @@ import java.awt.event.MouseEvent; import javax.swing.*; import docking.widgets.label.GDLabel; +import docking.widgets.list.GListCellRenderer; import ghidra.feature.vt.gui.editors.TagEditorDialog.TagState; import ghidra.feature.vt.gui.editors.TagEditorDialog.TagStateListModel; import ghidra.util.exception.AssertException; import resources.ResourceManager; -public class TagEditorRenderer extends DefaultListCellRenderer { +public class TagEditorRenderer extends GListCellRenderer { private static final Icon NEW_TAG_ICON = ResourceManager.loadImage("images/tag_blue_add.png"); private static final Icon DELETED_TAG_ICON = @@ -156,19 +157,20 @@ public class TagEditorRenderer extends DefaultListCellRenderer { } @Override - public Component getListCellRendererComponent(JList jList, Object value, int index, - boolean isSelected, boolean cellHasFocus) { - JLabel renderer = (JLabel) super.getListCellRendererComponent(jList, value, index, + protected String getItemText(TagState value) { + return value.getTagName(); + } + + @Override + public Component getListCellRendererComponent(JList jList, TagState state, + int index, boolean isSelected, boolean cellHasFocus) { + JLabel renderer = (JLabel) super.getListCellRendererComponent(jList, state, index, isSelected, cellHasFocus); initializePanel(renderer); - TagState state = (TagState) value; - tagIconLabel.setIcon(getIcon(state)); - renderer.setText(state.getTagName()); - if (!isSelected) { state.setMousePressed(false); } diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java index ebb87c19eb..5474428836 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java @@ -25,6 +25,7 @@ import javax.swing.event.EventListenerList; import org.apache.commons.lang3.StringUtils; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GHtmlLabel; @@ -77,8 +78,7 @@ public abstract class AbstractAddressRangeFilter extends AncillaryFilter // Enable panel // check box for enabled/disabled, so the user can keep previous values // - enableCheckBox = new JCheckBox("enable"); - enableCheckBox.setSelected(true); + enableCheckBox = new GCheckBox("enable", true); enableCheckBox.addItemListener(e -> enableFilter(enableCheckBox.isSelected())); enableCheckBox.setSelected(true); JPanel enablePanel = new JPanel(new BorderLayout()); diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/TagFilterEditorDialog.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/TagFilterEditorDialog.java index 0c647a3838..1b7a8449fb 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/TagFilterEditorDialog.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/TagFilterEditorDialog.java @@ -22,6 +22,8 @@ import java.util.*; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; +import docking.widgets.list.GListCellRenderer; import ghidra.feature.vt.api.main.VTMatchTag; import ghidra.feature.vt.api.main.VTSession; import ghidra.feature.vt.gui.editors.TagEditorDialog; @@ -191,21 +193,20 @@ public class TagFilterEditorDialog extends DialogComponentProvider implements Ta } } - private class TagRenderer extends DefaultListCellRenderer { + private class TagRenderer extends GListCellRenderer { private JPanel panel; - private JCheckBox checkBox = new JCheckBox(); + private GCheckBox checkBox = new GCheckBox(); @Override - public Component getListCellRendererComponent(JList list, Object value, int index, - boolean isSelected, boolean cellHasFocus) { + public Component getListCellRendererComponent(JList list, TagInfo value, + int index, boolean isSelected, boolean cellHasFocus) { JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - TagInfo info = (TagInfo) value; - checkBox.setSelected(info.isIncluded); + checkBox.setSelected(value.isIncluded); - renderer.setText(info.getDisplayText()); + renderer.setText(value.getDisplayText()); return getPanel(renderer); } diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupStatusFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupStatusFilter.java index 109ad750f0..a9c0c32a76 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupStatusFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupStatusFilter.java @@ -19,6 +19,7 @@ import java.awt.event.ItemListener; import javax.swing.JCheckBox; +import docking.widgets.checkbox.GCheckBox; import ghidra.feature.vt.api.main.VTMarkupItem; import ghidra.feature.vt.api.main.VTMarkupItemStatus; import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; @@ -36,7 +37,7 @@ public class MarkupStatusFilter extends CheckBoxBasedAncillaryFilter info = new MatchStatusCheckBoxInfo(checkBox, status); diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupTypeFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupTypeFilter.java index f3821333af..fc0efe59d8 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupTypeFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/markuptable/MarkupTypeFilter.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,18 +15,19 @@ */ package ghidra.feature.vt.gui.provider.markuptable; -import ghidra.feature.vt.api.main.VTMarkupItem; -import ghidra.feature.vt.api.markuptype.VTMarkupType; -import ghidra.feature.vt.api.markuptype.VTMarkupTypeFactory; -import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; -import ghidra.feature.vt.gui.filters.CheckBoxInfo; - import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.List; import javax.swing.JCheckBox; +import docking.widgets.checkbox.GCheckBox; +import ghidra.feature.vt.api.main.VTMarkupItem; +import ghidra.feature.vt.api.markuptype.VTMarkupType; +import ghidra.feature.vt.api.markuptype.VTMarkupTypeFactory; +import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; +import ghidra.feature.vt.gui.filters.CheckBoxInfo; + public class MarkupTypeFilter extends CheckBoxBasedAncillaryFilter { public MarkupTypeFilter() { @@ -37,6 +37,7 @@ public class MarkupTypeFilter extends CheckBoxBasedAncillaryFilter @Override protected void createCheckBoxInfos() { ItemListener listener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { fireStatusChanged(getFilterStatus()); } @@ -44,7 +45,7 @@ public class MarkupTypeFilter extends CheckBoxBasedAncillaryFilter List markupTypes = VTMarkupTypeFactory.getMarkupTypes(); for (VTMarkupType markupType : markupTypes) { - JCheckBox checkBox = new JCheckBox(markupType.getDisplayName()); + GCheckBox checkBox = new GCheckBox(markupType.getDisplayName()); checkBox.setSelected(true); checkBox.addItemListener(listener); CheckBoxInfo info = new MarkupTypeCheckBoxInfo(checkBox, markupType); diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java index e0ec6200c7..6eceff8a83 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java @@ -15,6 +15,13 @@ */ package ghidra.feature.vt.gui.provider.matchtable; +import java.awt.BorderLayout; +import java.awt.event.*; +import java.util.*; + +import javax.swing.*; + +import docking.widgets.checkbox.GCheckBox; import ghidra.feature.vt.api.correlator.program.ImpliedMatchProgramCorrelator; import ghidra.feature.vt.api.correlator.program.ManualMatchProgramCorrelator; import ghidra.feature.vt.api.impl.VTProgramCorrelatorInfo; @@ -25,12 +32,6 @@ import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; import ghidra.feature.vt.gui.filters.CheckBoxInfo; import ghidra.util.classfinder.ClassSearcher; -import java.awt.BorderLayout; -import java.awt.event.*; -import java.util.*; - -import javax.swing.*; - public class AlgorithmFilter extends CheckBoxBasedAncillaryFilter { public AlgorithmFilter() { @@ -83,8 +84,7 @@ public class AlgorithmFilter extends CheckBoxBasedAncillaryFilter { }; for (String name : algorithmNames) { - JCheckBox checkBox = new JCheckBox(name); - checkBox.setSelected(true); + GCheckBox checkBox = new GCheckBox(name, true); checkBox.addItemListener(listener); CheckBoxInfo info = new AlgorithmNameCheckBoxInfo(checkBox, name); checkBoxInfos.add(info); @@ -92,7 +92,7 @@ public class AlgorithmFilter extends CheckBoxBasedAncillaryFilter { } private List getKnowAlgorithms() { - List list = new ArrayList(); + List list = new ArrayList<>(); // add the manual match correlator, which doesn't have a factory, since it is only through an action. list.add(ManualMatchProgramCorrelator.NAME); 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 1993e1ea24..e65a92534e 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.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; @@ -230,10 +231,10 @@ public class ApplyMarkupPropertyEditor implements OptionsEditor { } private void createIgnoreCheckBoxes() { - ignoreIncompleteCheckBox = new JCheckBox("Set Incomplete Markup Items To Ignored"); + ignoreIncompleteCheckBox = new GCheckBox("Set Incomplete Markup Items To Ignored"); ignoreIncompleteCheckBox.setToolTipText(IGNORE_INCOMPLETE_TOOLTIP); - ignoreExcludedCheckBox = new JCheckBox("Set Excluded Markup Items To Ignored"); + ignoreExcludedCheckBox = new GCheckBox("Set Excluded Markup Items To Ignored"); ignoreExcludedCheckBox.setToolTipText(IGNORE_EXCLUDED_TOOLTIP); } @@ -834,8 +835,8 @@ public class ApplyMarkupPropertyEditor implements OptionsEditor { return applyComboBox; } - private JCheckBox createCheckBox(final String optionName) { - final JCheckBox applyCheckBox = new JCheckBox(optionName); + private JCheckBox createCheckBox(String optionName) { + JCheckBox applyCheckBox = new GCheckBox(optionName); applyCheckBox.addChangeListener(e -> changesMade(true)); return applyCheckBox; diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AssociationStatusFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AssociationStatusFilter.java index 50c89326fa..83912acb19 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AssociationStatusFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AssociationStatusFilter.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,13 +15,16 @@ */ package ghidra.feature.vt.gui.provider.matchtable; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +import javax.swing.JCheckBox; + +import docking.widgets.checkbox.GCheckBox; import ghidra.feature.vt.api.main.VTAssociationStatus; import ghidra.feature.vt.api.main.VTMatch; -import ghidra.feature.vt.gui.filters.*; - -import java.awt.event.*; - -import javax.swing.*; +import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; +import ghidra.feature.vt.gui.filters.CheckBoxInfo; public class AssociationStatusFilter extends CheckBoxBasedAncillaryFilter { @@ -33,6 +35,7 @@ public class AssociationStatusFilter extends CheckBoxBasedAncillaryFilter info = new AssociationStatusCheckBoxInfo(checkBox, status); checkBoxInfos.add(info); diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchTypeFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchTypeFilter.java index b7019caac9..51f79ec14e 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchTypeFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchTypeFilter.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,16 +15,17 @@ */ package ghidra.feature.vt.gui.provider.matchtable; -import ghidra.feature.vt.api.main.VTAssociationType; -import ghidra.feature.vt.api.main.VTMatch; -import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; -import ghidra.feature.vt.gui.filters.CheckBoxInfo; - import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.JCheckBox; +import docking.widgets.checkbox.GCheckBox; +import ghidra.feature.vt.api.main.VTAssociationType; +import ghidra.feature.vt.api.main.VTMatch; +import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; +import ghidra.feature.vt.gui.filters.CheckBoxInfo; + public class MatchTypeFilter extends CheckBoxBasedAncillaryFilter { public MatchTypeFilter() { @@ -35,6 +35,7 @@ public class MatchTypeFilter extends CheckBoxBasedAncillaryFilter { @Override protected void createCheckBoxInfos() { ItemListener listener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { fireStatusChanged(getFilterStatus()); } @@ -42,8 +43,7 @@ public class MatchTypeFilter extends CheckBoxBasedAncillaryFilter { VTAssociationType[] values = VTAssociationType.values(); for (VTAssociationType status : values) { - JCheckBox checkBox = new JCheckBox(status.toString()); - checkBox.setSelected(true); + GCheckBox checkBox = new GCheckBox(status.toString(), true); checkBox.addItemListener(listener); CheckBoxInfo info = new AssociationTypeCheckBoxInfo(checkBox, status); checkBoxInfos.add(info); diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/SymbolTypeFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/SymbolTypeFilter.java index 2a1d6fe6e1..8d84929394 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/SymbolTypeFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/SymbolTypeFilter.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,6 +15,12 @@ */ package ghidra.feature.vt.gui.provider.matchtable; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +import javax.swing.JCheckBox; + +import docking.widgets.checkbox.GCheckBox; import ghidra.feature.vt.api.main.*; import ghidra.feature.vt.gui.filters.CheckBoxBasedAncillaryFilter; import ghidra.feature.vt.gui.filters.CheckBoxInfo; @@ -23,11 +28,6 @@ import ghidra.program.model.address.Address; import ghidra.program.model.listing.Program; import ghidra.program.model.symbol.*; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; - -import javax.swing.JCheckBox; - /** * This filter allows through any match that has a source *or* destination symbol type matches * the selected source types. @@ -41,6 +41,7 @@ public class SymbolTypeFilter extends CheckBoxBasedAncillaryFilter { @Override protected void createCheckBoxInfos() { ItemListener listener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { fireStatusChanged(getFilterStatus()); } @@ -48,15 +49,13 @@ public class SymbolTypeFilter extends CheckBoxBasedAncillaryFilter { SourceType[] values = SourceType.values(); for (SourceType type : values) { - JCheckBox checkBox = new JCheckBox(type.getDisplayString()); - checkBox.setSelected(true); + GCheckBox checkBox = new GCheckBox(type.getDisplayString(), true); checkBox.addItemListener(listener); CheckBoxInfo info = new SymbolTypeCheckBoxInfo(checkBox, type); checkBoxInfos.add(info); } - JCheckBox nullSymbolCheckbox = new JCheckBox(""); - nullSymbolCheckbox.setSelected(true); + GCheckBox nullSymbolCheckbox = new GCheckBox("", true); nullSymbolCheckbox.addItemListener(listener); checkBoxInfos.add(new NullSymbolCheckBoxInfo(nullSymbolCheckbox)); } diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/AddressSetOptionsPanel.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/AddressSetOptionsPanel.java index 7c43b1e9ef..4c919164ec 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/AddressSetOptionsPanel.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/AddressSetOptionsPanel.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,6 +15,13 @@ */ package ghidra.feature.vt.gui.wizard; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.JCheckBox; + +import docking.widgets.checkbox.GCheckBox; +import docking.wizard.*; import ghidra.feature.vt.api.main.VTProgramCorrelatorAddressRestrictionPreference; import ghidra.feature.vt.api.main.VTProgramCorrelatorFactory; import ghidra.program.model.address.AddressSetView; @@ -23,13 +29,6 @@ import ghidra.util.HTMLUtilities; import ghidra.util.HelpLocation; import ghidra.util.layout.VerticalLayout; -import java.util.List; - -import javax.swing.BorderFactory; -import javax.swing.JCheckBox; - -import docking.wizard.*; - public class AddressSetOptionsPanel extends AbstractMageJPanel { private JCheckBox excludeCheckbox; @@ -38,23 +37,21 @@ public class AddressSetOptionsPanel extends AbstractMageJPanel public AddressSetOptionsPanel() { // setBorder(BorderFactory.createEmptyBorder(40, 40, 0, 0)); - excludeCheckbox = new JCheckBox("Exclude accepted matches"); - String excludeAcceptedTooltip = - "This option will cause the correlator algorithm " - + "to not consider any functions or data that have already been " - + "accepted. Using this option can greatly speed up the processing time " - + "of the correlator algorithm; however, this options should only be " - + "used when you trust that your accepted matches are correct."; + excludeCheckbox = new GCheckBox("Exclude accepted matches", false); + String excludeAcceptedTooltip = "This option will cause the correlator algorithm " + + "to not consider any functions or data that have already been " + + "accepted. Using this option can greatly speed up the processing time " + + "of the correlator algorithm; however, this options should only be " + + "used when you trust that your accepted matches are correct."; excludeCheckbox.setToolTipText(HTMLUtilities.toWrappedHTML(excludeAcceptedTooltip)); - excludeCheckbox.setEnabled(false); - showAddressSetPanelsCheckbox = new JCheckBox("Limit source and destination address sets"); - String manuallyLimitTooltip = - "Selecting this checkbox will trigger additional wizard " - + " panels allowing you to customize the address sets used " - + " by the selected algorithm. When not selected, the entire address space is used."; + showAddressSetPanelsCheckbox = new GCheckBox("Limit source and destination address sets"); + String manuallyLimitTooltip = "Selecting this checkbox will trigger additional wizard " + + " panels allowing you to customize the address sets used " + + " by the selected algorithm. When not selected, the entire address space is used."; - showAddressSetPanelsCheckbox.setToolTipText(HTMLUtilities.toWrappedHTML(manuallyLimitTooltip)); + showAddressSetPanelsCheckbox.setToolTipText( + HTMLUtilities.toWrappedHTML(manuallyLimitTooltip)); add(excludeCheckbox); add(showAddressSetPanelsCheckbox); @@ -74,8 +71,8 @@ public class AddressSetOptionsPanel extends AbstractMageJPanel @Override public void enterPanel(WizardState state) { @SuppressWarnings("unchecked") - List list = - (List) state.get(VTWizardStateKey.PROGRAM_CORRELATOR_FACTORY_LIST); + List list = (List) state.get( + VTWizardStateKey.PROGRAM_CORRELATOR_FACTORY_LIST); Boolean value = (Boolean) state.get(VTWizardStateKey.EXCLUDE_ACCEPTED_MATCHES); if (value != null) { @@ -90,9 +87,8 @@ public class AddressSetOptionsPanel extends AbstractMageJPanel (AddressSetView) state.get(VTWizardStateKey.SOURCE_SELECTION); AddressSetView destinationSelection = (AddressSetView) state.get(VTWizardStateKey.DESTINATION_SELECTION); - boolean somethingSelected = - (sourceSelection != null && !sourceSelection.isEmpty()) || - (destinationSelection != null && !destinationSelection.isEmpty()); + boolean somethingSelected = (sourceSelection != null && !sourceSelection.isEmpty()) || + (destinationSelection != null && !destinationSelection.isEmpty()); showAddressSetPanelsCheckbox.setSelected(somethingSelected); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/OptionDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/OptionDialog.java index ccfa83cc60..296ecbb540 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/OptionDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/OptionDialog.java @@ -24,6 +24,7 @@ import javax.swing.*; import docking.DialogComponentProvider; import docking.DockingWindowManager; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.dialogs.*; import docking.widgets.label.GHtmlLabel; import docking.widgets.label.GIconLabel; @@ -264,11 +265,11 @@ public class OptionDialog extends DialogComponentProvider { private JPanel buildRememberOptionChoicePanel(DialogRememberOption rememberOptionChoice) { if (rememberOptionChoice == null) { this.rememberOption = new DoNothingDialogRememberOption(); - rememberOptionCheckBox = new JCheckBox(); // to prevent null checks, create dummy checkbox + rememberOptionCheckBox = new GCheckBox(); // to prevent null checks, create dummy checkbox return null; } this.rememberOption = rememberOptionChoice; - rememberOptionCheckBox = new JCheckBox(rememberOptionChoice.getDescription()); + rememberOptionCheckBox = new GCheckBox(rememberOptionChoice.getDescription()); JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/PasswordDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/PasswordDialog.java index 0f26b0e22d..c5fc3277c8 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/PasswordDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/PasswordDialog.java @@ -21,6 +21,7 @@ import java.awt.event.*; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GLabel; import ghidra.util.MessageType; @@ -65,7 +66,7 @@ public class PasswordDialog extends DialogComponentProvider { workPanel.add(choiceCB); } if (includeAnonymousOption) { - anonymousAccess = new JCheckBox("Request Anonymous Access"); + anonymousAccess = new GCheckBox("Request Anonymous Access"); anonymousAccess.setName("ANONYMOUS-COMPONENT"); anonymousAccess.addChangeListener(e -> { boolean anonymousAccessRequested = anonymousAccess.isSelected(); 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 a872487eff..b3d0966fc9 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 @@ -27,6 +27,7 @@ import javax.swing.border.BevelBorder; import javax.swing.border.Border; import docking.widgets.EmptyBorderButton; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDHtmlLabel; import docking.widgets.label.GDLabel; import ghidra.util.HTMLUtilities; @@ -365,7 +366,7 @@ public class ConditionTestPanel extends JPanel { backgroundColor = getBackground(); selectedColor = Color.LIGHT_GRAY; this.test = conditionTest; - checkbox = new JCheckBox(); + checkbox = new GCheckBox(); checkbox.setSelected(true); add(checkbox); label = new GDLabel(test.getName()); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/dialogs/SettingsDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/dialogs/SettingsDialog.java index c1e5e8ed81..4c48d96061 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/dialogs/SettingsDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/dialogs/SettingsDialog.java @@ -25,6 +25,7 @@ import javax.swing.table.*; import docking.DialogComponentProvider; import docking.DockingWindowManager; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.table.DefaultSortedTableModel; import docking.widgets.table.GTable; @@ -231,8 +232,8 @@ public class SettingsDialog extends DialogComponentProvider { final static int BOOLEAN = 1; private int mode; - private JComboBox comboBox = new GComboBox<>(); - private JCheckBox checkBox = new JCheckBox(); + private GComboBox comboBox = new GComboBox<>(); + private GCheckBox checkBox = new GCheckBox(); private final Runnable editStopped = new Runnable() { @Override diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GFileChooserOptionsDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GFileChooserOptionsDialog.java index 3756186107..552fb522d4 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GFileChooserOptionsDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GFileChooserOptionsDialog.java @@ -18,6 +18,7 @@ package docking.widgets.filechooser; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GLabel; import ghidra.framework.preferences.Preferences; import ghidra.util.layout.PairLayout; @@ -48,7 +49,7 @@ class GFileChooserOptionsDialog extends DialogComponentProvider { private JComponent buildComponent() { JPanel panel = new JPanel(new PairLayout()); - showDotFilesCheckBox = new JCheckBox(); + showDotFilesCheckBox = new GCheckBox(); showDotFilesCheckBox.setSelected(true); JLabel label = new GLabel("Show '.' files"); 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 9cd58aeb0d..d029295cb6 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.checkbox.GCheckBox; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GIconLabel; import docking.widgets.label.GLabel; @@ -266,14 +267,14 @@ public class FilterOptionsEditorDialog extends DialogComponentProvider { this.setLayout(new HorizontalLayout(6)); setBorder(BorderFactory.createEmptyBorder(10, 4, 0, 4)); - caseSensitiveCheckbox = new JCheckBox("Case Sensitive"); + caseSensitiveCheckbox = new GCheckBox("Case Sensitive"); caseSensitiveCheckbox.setToolTipText( "Toggles whether the case of the filter text matters in the match. NOTE: does not apply to regular expressons."); if (initialFilterOptions.isCaseSensitive()) { caseSensitiveCheckbox.setSelected(true); } - globbingCheckbox = new JCheckBox("Allow Globbing"); + globbingCheckbox = new GCheckBox("Allow Globbing"); globbingCheckbox.setToolTipText( "Toggles whether globbing chars (?*) are literal or wildcards"); if (initialFilterOptions.isGlobbingAllowed()) { @@ -308,7 +309,7 @@ public class FilterOptionsEditorDialog extends DialogComponentProvider { this.setLayout(new HorizontalLayout(6)); setBorder(BorderFactory.createEmptyBorder(10, 4, 10, 4)); - invertCheckbox = new JCheckBox("Invert Filter"); + invertCheckbox = new GCheckBox("Invert Filter"); invertCheckbox.setToolTipText("" + "Inverts the match. For example, contains becomes does not contain."); if (initialFilterOptions.isInverted()) { @@ -337,13 +338,11 @@ public class FilterOptionsEditorDialog extends DialogComponentProvider { public MultiTermPanel() { - super(new JCheckBox("Enable Multi-Term Filtering"), BorderFactory.createEtchedBorder()); + super(new GCheckBox("Enable Multi-Term Filtering", true), + BorderFactory.createEtchedBorder()); enableCheckbox = (JCheckBox) getTitleComponent(); - enableCheckbox.setSelected(true); - enableCheckbox.addActionListener(e -> { - setOptionsEnabled(enableCheckbox.isSelected()); - }); + enableCheckbox.addActionListener(e -> setOptionsEnabled(enableCheckbox.isSelected())); createPanel(); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GHtmlLabel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GHtmlLabel.java index 16fbc62320..33be4ebf4e 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GHtmlLabel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/label/GHtmlLabel.java @@ -116,7 +116,7 @@ public class GHtmlLabel extends JLabel { @Deprecated @Override public void setText(String text) { - if (StringUtils.isEmpty(getText())) { + if (!StringUtils.isEmpty(getText())) { Msg.warn(this, "Trying to set text on an immutable label! Current text: [" + getText() + "], new text: [" + text + "]", diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GBooleanCellRenderer.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GBooleanCellRenderer.java index e07f1a9e95..9722093a52 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GBooleanCellRenderer.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GBooleanCellRenderer.java @@ -17,11 +17,11 @@ package docking.widgets.table; import java.awt.*; -import javax.swing.JCheckBox; +import docking.widgets.checkbox.GCheckBox; public class GBooleanCellRenderer extends GTableCellRenderer { - protected JCheckBox cb = new JCheckBox(); + protected GCheckBox cb = new GCheckBox(); public GBooleanCellRenderer() { super(); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/EnumConstraintEditor.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/EnumConstraintEditor.java index f42ce804b7..a6402af288 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/EnumConstraintEditor.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/EnumConstraintEditor.java @@ -21,6 +21,7 @@ import java.util.*; import javax.swing.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDHtmlLabel; import docking.widgets.table.constraint.ColumnConstraint; import docking.widgets.table.constraint.EnumColumnConstraint; @@ -57,7 +58,7 @@ public class EnumConstraintEditor> extends AbstractColumnConst panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 10)); for (T t : allValues) { - JCheckBox jCheckBox = new JCheckBox(getElementDisplayName(t)); + GCheckBox jCheckBox = new GCheckBox(getElementDisplayName(t)); enumCheckboxMap.put(t, jCheckBox); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ImportGhidraToolsDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ImportGhidraToolsDialog.java index 1c595d01a1..e94c7d5d5b 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ImportGhidraToolsDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ImportGhidraToolsDialog.java @@ -28,6 +28,7 @@ import com.google.common.collect.Iterables; import docking.DialogComponentProvider; import docking.options.editor.ButtonPanelFactory; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.list.ListPanel; import ghidra.framework.ToolUtils; import ghidra.framework.model.ToolTemplate; @@ -40,7 +41,7 @@ class ImportGhidraToolsDialog extends DialogComponentProvider { private ListPanel listPanel; private JPanel mainPanel; - private JCheckBox[] checkboxes; + private GCheckBox[] checkboxes; private String[] tools; private JButton selectAllButton; private JButton deselectAllButton; @@ -167,13 +168,13 @@ class ImportGhidraToolsDialog extends DialogComponentProvider { int elementCount = defaultTools.size() + extraTools.size(); tools = new String[elementCount]; - checkboxes = new JCheckBox[elementCount]; + checkboxes = new GCheckBox[elementCount]; Iterator itr = defaultToolNames.iterator(); int count = 0; while (itr.hasNext()) { tools[count] = itr.next(); - checkboxes[count] = new JCheckBox(tools[count], false); + checkboxes[count] = new GCheckBox(tools[count], false); checkboxes[count].setBackground(Color.WHITE); count++; } @@ -181,7 +182,7 @@ class ImportGhidraToolsDialog extends DialogComponentProvider { itr = extraToolNames.iterator(); while (itr.hasNext()) { tools[count] = itr.next(); - checkboxes[count] = new JCheckBox(tools[count], false); + checkboxes[count] = new GCheckBox(tools[count], false); checkboxes[count].setBackground(Color.LIGHT_GRAY); count++; } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java index 7a89bcbfb2..565f65ec7f 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java @@ -24,6 +24,7 @@ import java.util.List; import javax.swing.*; import docking.options.editor.ButtonPanelFactory; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.list.GListCellRenderer; import docking.widgets.table.GTable; import docking.wizard.AbstractWizardJPanel; @@ -192,8 +193,7 @@ public class ProjectAccessPanel extends AbstractWizardJPanel { add(mainPanel, BorderLayout.CENTER); if (anonymousServerAccessAllowed) { - anonymousAccessCB = new JCheckBox("Allow Anonymous Access"); - anonymousAccessCB.setSelected(origAnonymousAccessEnabled); + anonymousAccessCB = new GCheckBox("Allow Anonymous Access", origAnonymousAccessEnabled); anonymousAccessCB.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); add(anonymousAccessCB, BorderLayout.SOUTH); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SaveDataDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SaveDataDialog.java index 831061565e..125c130d92 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SaveDataDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SaveDataDialog.java @@ -24,8 +24,10 @@ import java.util.List; import javax.swing.*; import javax.swing.border.TitledBorder; -import docking.*; +import docking.DialogComponentProvider; +import docking.DockingWindowManager; import docking.options.editor.ButtonPanelFactory; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.list.ListPanel; import ghidra.framework.model.DomainFile; import ghidra.framework.model.ProjectLocator; @@ -51,7 +53,7 @@ public class SaveDataDialog extends DialogComponentProvider { private ListPanel listPanel; private JPanel mainPanel; - private JCheckBox[] checkboxes; + private GCheckBox[] checkboxes; private List files; private boolean[] saveable; private JButton selectAllButton; @@ -258,13 +260,12 @@ public class SaveDataDialog extends DialogComponentProvider { // initList() may be called multiple times within one dialog showing, // and some files may have been changed, so we need to update the list files = checkForUnsavedFiles(files); - checkboxes = new JCheckBox[files.size()]; + checkboxes = new GCheckBox[files.size()]; saveable = new boolean[files.size()]; String readOnlyString = " (Read-Only)"; yesButton.setEnabled(false); for (int i = 0; i < files.size(); i++) { - checkboxes[i] = new JCheckBox(files.get(i).getName()); - DockingUtils.turnOffHTMLRendering(checkboxes[i]); + checkboxes[i] = new GCheckBox(files.get(i).getName()); checkboxes[i].setBackground(Color.white); saveable[i] = files.get(i).canSave(); if (!saveable[i]) { diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SelectProjectPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SelectProjectPanel.java index 90f5268596..a04dd571f0 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SelectProjectPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SelectProjectPanel.java @@ -185,7 +185,7 @@ class SelectProjectPanel extends AbstractWizardJPanel { } }); -// sharedProjectCB = new JCheckBox("Project can be Shared with Others"); +// sharedProjectCB = new GCheckBox("Project can be Shared with Others"); // sharedProjectCB.addItemListener(new ItemListener() { // public void itemStateChanged(ItemEvent e) { // panelManager.getWizardManager().validityChanged(); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ToolConnectionPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ToolConnectionPanel.java index c1402a93f1..196e65a807 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ToolConnectionPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ToolConnectionPanel.java @@ -24,6 +24,7 @@ import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDLabel; import docking.widgets.list.GListCellRenderer; import ghidra.framework.model.*; @@ -45,7 +46,7 @@ class ToolConnectionPanel extends JPanel implements ListSelectionListener { private JList eventList; // names of events generated by source private DefaultListModel producerModel; private DefaultListModel consumerModel; - private JCheckBox[] checkboxes; + private GCheckBox[] checkboxes; private String[] eventNames; private final static String msgSource = "Tool Connection"; @@ -345,13 +346,13 @@ class ToolConnectionPanel extends JPanel implements ListSelectionListener { ToolConnection tc = toolManager.getConnection(producer, consumer); eventNames = tc.getEvents(); - checkboxes = new JCheckBox[eventNames.length]; + checkboxes = new GCheckBox[eventNames.length]; int connectedCount = 0; for (int i = 0; i < checkboxes.length; i++) { - checkboxes[i] = new JCheckBox(eventNames[i]); + checkboxes[i] = new GCheckBox(eventNames[i]); checkboxes[i].setBackground(Color.white); boolean isConnected = tc.isConnected(eventNames[i]); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/CheckoutDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/CheckoutDialog.java index 6e92b5d6e7..d82c360b98 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/CheckoutDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/CheckoutDialog.java @@ -22,6 +22,7 @@ import javax.swing.*; import docking.DialogComponentProvider; import docking.widgets.MultiLineLabel; import docking.widgets.OptionDialog; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GIconLabel; import ghidra.app.util.GenericHelpTopics; import ghidra.framework.plugintool.PluginTool; @@ -88,7 +89,7 @@ public class CheckoutDialog extends DialogComponentProvider { innerPanel.add(msgPanel, BorderLayout.CENTER); - exclusiveCB = new JCheckBox("Request exclusive check out"); + exclusiveCB = new GCheckBox("Request exclusive check out"); JPanel cbPanel = new JPanel(new BorderLayout()); cbPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFilesPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFilesPanel.java index 03f47fddab..897eaaffac 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFilesPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFilesPanel.java @@ -23,6 +23,7 @@ import java.util.List; import javax.swing.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.list.ListPanel; import ghidra.framework.model.DomainFile; @@ -33,7 +34,7 @@ import ghidra.framework.model.DomainFile; class DomainFilesPanel extends JPanel { private List fileList; - private JCheckBox[] checkboxes; + private GCheckBox[] checkboxes; private ListPanel listPanel; /** @@ -47,12 +48,11 @@ class DomainFilesPanel extends JPanel { setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5)); JPanel innerPanel = new JPanel(new BorderLayout()); - checkboxes = new JCheckBox[fileList.size()]; + checkboxes = new GCheckBox[fileList.size()]; for (int i = 0; i < fileList.size(); i++) { DomainFile df = fileList.get(i); - checkboxes[i] = new JCheckBox(df.getPathname()); + checkboxes[i] = new GCheckBox(df.getPathname(), true); checkboxes[i].setBackground(Color.white); - checkboxes[i].setSelected(true); } // diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/UndoActionDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/UndoActionDialog.java index 86430e1845..dada79b1f4 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/UndoActionDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/UndoActionDialog.java @@ -21,6 +21,7 @@ import java.util.List; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GIconLabel; import docking.widgets.label.GLabel; import ghidra.app.util.GenericHelpTopics; @@ -98,8 +99,7 @@ public class UndoActionDialog extends DialogComponentProvider { innerPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); filePanel = new DomainFilesPanel(fileList, null); - saveCopyCB = new JCheckBox("Save copy of the file with a .keep extension"); - saveCopyCB.setSelected(true); + saveCopyCB = new GCheckBox("Save copy of the file with a .keep extension", true); JPanel cbPanel = new JPanel(new BorderLayout()); cbPanel.add(saveCopyCB); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java index ed53333973..d14c3f3281 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java @@ -21,6 +21,7 @@ import java.awt.Component; import javax.swing.*; import docking.DialogComponentProvider; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.*; import ghidra.app.util.GenericHelpTopics; import ghidra.framework.plugintool.PluginTool; @@ -158,8 +159,7 @@ public class VersionControlDialog extends DialogComponentProvider { commentsTextArea = new JTextArea(4, 20); JScrollPane sp = new JScrollPane(commentsTextArea); - keepCB = new JCheckBox("Keep File Checked Out"); - keepCB.setSelected(true); + keepCB = new GCheckBox("Keep File Checked Out", true); JPanel kPanel = new JPanel(new BorderLayout()); kPanel.add(keepCB, BorderLayout.WEST); @@ -172,8 +172,7 @@ public class VersionControlDialog extends DialogComponentProvider { innerPanel.add(kPanel); if (!addToVersionControl) { - keepFileCB = new JCheckBox("Create \".keep\" file"); - keepFileCB.setSelected(false); + keepFileCB = new GCheckBox("Create \".keep\" file", false); JPanel kpPanel = new JPanel(new BorderLayout()); kpPanel.add(keepFileCB, BorderLayout.WEST); innerPanel.add(kpPanel); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/ReloadDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/ReloadDialog.java index 14ee738244..ff2d6fc31a 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/ReloadDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/ReloadDialog.java @@ -21,6 +21,7 @@ import java.awt.event.ActionListener; import javax.swing.*; +import docking.widgets.checkbox.GCheckBox; import ghidra.framework.main.logviewer.event.FVEvent; import ghidra.framework.main.logviewer.event.FVEvent.EventType; import ghidra.framework.main.logviewer.event.FVEventListener; @@ -74,7 +75,7 @@ public class ReloadDialog extends JDialog { buttonPanel.add(noBtn); contentPane.add(buttonPanel, BorderLayout.CENTER); - JCheckBox checkbox = new JCheckBox("Do not show this message again."); + JCheckBox checkbox = new GCheckBox("Do not show this message again."); contentPane.add(checkbox, BorderLayout.SOUTH); // When the user selects the YES button they're indicating they want to reload the file, so diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java index d24a4f07e2..7787e82abe 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java @@ -27,6 +27,7 @@ import javax.swing.event.HyperlinkEvent.EventType; import docking.EmptyBorderToggleButton; import docking.widgets.HyperlinkComponent; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.*; import ghidra.framework.plugintool.PluginConfigurationModel; import ghidra.framework.plugintool.PluginTool; @@ -87,7 +88,7 @@ public class PluginManagerComponent extends JPanel implements ChangeListener, Sc this.pluginPackage = pluginPackage; JPanel panel = new JPanel(new HorizontalLayout(0)); panel.setBackground(BG); - jCheckBox = new JCheckBox(); + jCheckBox = new GCheckBox(); jCheckBox.addActionListener(e -> checkBoxClicked()); if (!pluginPackage.isfullyAddable()) { jCheckBox.setEnabled(false); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java index bcc56f5a6e..c532be2b31 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java @@ -19,26 +19,27 @@ import java.awt.*; import javax.swing.*; +import docking.widgets.list.GListCellRenderer; import ghidra.framework.task.GTaskManager; import ghidra.framework.task.GTaskResult; import resources.Icons; import resources.ResourceManager; public class GTaskResultPanel extends JPanel { - private JList jList; + private JList jList; private CompletedTaskListModel model; public GTaskResultPanel(GTaskManager taskMgr) { super(new BorderLayout()); model = new CompletedTaskListModel(taskMgr); - jList = new JList(model); + jList = new JList<>(model); jList.setCellRenderer(new GTaskResultCellRenderer()); JScrollPane scroll = new JScrollPane(jList); add(scroll); setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); } - static class GTaskResultCellRenderer extends DefaultListCellRenderer { + static class GTaskResultCellRenderer extends GListCellRenderer { private static final Icon CANCELLED_ICON = ResourceManager.loadImage("images/dialog-cancel.png"); private static final Icon EXCEPTION_ICON = Icons.ERROR_ICON; @@ -46,12 +47,14 @@ public class GTaskResultPanel extends JPanel { ResourceManager.loadImage("images/checkmark_green.gif"); @Override - public Component getListCellRendererComponent(JList list, Object value, int index, - boolean isSelected, boolean cellHasFocus) { - GTaskResultInfo element = (GTaskResultInfo) value; - GTaskResult result = element.getResult(); - setText(value.toString()); - setIcon(getIcon(result)); + protected String getItemText(GTaskResultInfo value) { + return value.toString(); + } + + @Override + public Component getListCellRendererComponent(JList list, + GTaskResultInfo value, int index, boolean isSelected, boolean cellHasFocus) { + setIcon(getIcon(value.getResult())); setBackground(Color.white); return this; } 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 7cd90ce0da..85eefa0699 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.checkbox.GCheckBox; import generic.concurrent.GThreadPool; import ghidra.GhidraApplicationLayout; import ghidra.framework.Application; @@ -79,7 +80,7 @@ public class TaskSimulator { group.add(urgentButton); mediumButton.setSelected(true); - yieldingCheckbox = new JCheckBox("Yielding"); + yieldingCheckbox = new GCheckBox("Yielding"); addGroupButton.addActionListener(new ActionListener() { diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java index 64f562ffe8..67b14972b1 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java @@ -23,6 +23,7 @@ import java.io.IOException; import javax.swing.*; +import docking.widgets.checkbox.GCheckBox; import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.label.GHtmlLabel; import docking.widgets.label.GLabel; @@ -103,7 +104,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel { gbc.gridx = 3; gbc.gridwidth = 1; - useOldFileIDCheckBox = new JCheckBox(" Use Old File ID"); + useOldFileIDCheckBox = new GCheckBox(" Use Old File ID"); filePanel.add(useOldFileIDCheckBox, gbc); }