GT-2698 - convert JCheckBox to GCheckBox

This commit is contained in:
dev747368 2019-04-16 17:01:51 -04:00
parent 40daea1a56
commit 3c0484cae3
93 changed files with 487 additions and 460 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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()));

View file

@ -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(
"<HTML>Comments <FONT SIZE=\"2\">(does not affect automatic comments)</FONT>");
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);

View file

@ -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);

View file

@ -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

View file

@ -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;

View file

@ -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) {

View file

@ -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

View file

@ -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);

View file

@ -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,

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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);

View file

@ -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<CodeCompletion> {
@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<? extends CodeCompletion> 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! */

View file

@ -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));

View file

@ -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);
}

View file

@ -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());

View file

@ -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

View file

@ -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);

View file

@ -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;
}

View file

@ -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).");

View file

@ -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();

View file

@ -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"));

View file

@ -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);

View file

@ -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());

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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(
"<html><b>Selected</b> causes filter to only consider the symbol's name.");

View file

@ -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

View file

@ -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<T> extends DialogComponentProvider {
private boolean isCanceled;
private JCheckBox[] selectOptions;
private GCheckBox[] selectOptions;
private List<T> actualChoices;
private List<String> stringChoices;
private List<T> chosenByUser;
@ -76,7 +77,7 @@ public class MultipleOptionsDialog<T> 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<T> 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);

View file

@ -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.");

View file

@ -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;

View file

@ -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 " +

View file

@ -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));

View file

@ -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

View file

@ -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));

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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());

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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:

View file

@ -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);