mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
GT-2698 - convert JCheckBox to GCheckBox
This commit is contained in:
parent
40daea1a56
commit
3c0484cae3
93 changed files with 487 additions and 460 deletions
|
@ -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));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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<String> comboBox = new GComboBox<>();
|
||||
private JCheckBox checkBox = new JCheckBox();
|
||||
private GComboBox<String> comboBox = new GComboBox<>();
|
||||
private GCheckBox checkBox = new GCheckBox();
|
||||
|
||||
private final Runnable editStopped = new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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("<html>" +
|
||||
"Inverts the match. For example, <i>contains</i> becomes <i>does not contain</i>.");
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -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 + "]",
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<T extends Enum<T>> 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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue