mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GT-2698 - convert JRadioButton to GRadioButton
This commit is contained in:
parent
3c0484cae3
commit
d7410690ff
54 changed files with 529 additions and 344 deletions
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,10 +20,10 @@ import java.awt.event.ItemListener;
|
|||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.widgets.button.GRadioButton;
|
||||
import docking.wizard.AbstractWizardJPanel;
|
||||
import docking.wizard.PanelManager;
|
||||
|
||||
import ghidra.app.util.*;
|
||||
import ghidra.app.util.GenericHelpTopics;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.layout.VerticalLayout;
|
||||
|
||||
|
@ -47,29 +46,29 @@ class ProjectTypePanel extends AbstractWizardJPanel {
|
|||
buildPanel();
|
||||
setBorder(NewProjectPanelManager.EMPTY_BORDER);
|
||||
}
|
||||
|
||||
|
||||
private void buildPanel() {
|
||||
JPanel innerPanel = new JPanel(new VerticalLayout(10));
|
||||
innerPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
|
||||
ItemListener listener = new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
panelManager.getWizardManager().validityChanged();
|
||||
}
|
||||
};
|
||||
|
||||
nonSharedRB = new JRadioButton("Non-Shared Project", true);
|
||||
nonSharedRB = new GRadioButton("Non-Shared Project", true);
|
||||
nonSharedRB.addItemListener(listener);
|
||||
nonSharedRB.setToolTipText("Create a project that is not shared with others");
|
||||
|
||||
sharedRB = new JRadioButton("Shared Project");
|
||||
|
||||
sharedRB = new GRadioButton("Shared Project");
|
||||
sharedRB.addItemListener(listener);
|
||||
sharedRB.setToolTipText("Create a project that can be shared with others");
|
||||
|
||||
|
||||
buttonGroup = new ButtonGroup();
|
||||
buttonGroup.add(nonSharedRB);
|
||||
buttonGroup.add(sharedRB);
|
||||
|
||||
|
||||
innerPanel.add(nonSharedRB);
|
||||
innerPanel.add(sharedRB);
|
||||
JPanel outerPanel = new JPanel();
|
||||
|
@ -77,17 +76,19 @@ class ProjectTypePanel extends AbstractWizardJPanel {
|
|||
outerPanel.add(innerPanel);
|
||||
add(outerPanel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.util.bean.wizard.WizardPanel#getTitle()
|
||||
*/
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Select Project Type";
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.util.bean.wizard.WizardPanel#initialize()
|
||||
*/
|
||||
@Override
|
||||
public void initialize() {
|
||||
buttonGroup.remove(sharedRB);
|
||||
buttonGroup.remove(nonSharedRB);
|
||||
|
@ -96,22 +97,23 @@ class ProjectTypePanel extends AbstractWizardJPanel {
|
|||
buttonGroup.add(nonSharedRB);
|
||||
buttonGroup.add(sharedRB);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the user has entered a valid project file
|
||||
*/
|
||||
*/
|
||||
@Override
|
||||
public boolean isValidInformation() {
|
||||
return sharedRB.isSelected() || nonSharedRB.isSelected();
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.util.bean.wizard.WizardPanel#getHelpLocation()
|
||||
*/
|
||||
@Override
|
||||
public HelpLocation getHelpLocation() {
|
||||
public HelpLocation getHelpLocation() {
|
||||
return new HelpLocation(GenericHelpTopics.FRONT_END, "SelectProjectType");
|
||||
}
|
||||
|
||||
|
||||
boolean isSharedProject() {
|
||||
return sharedRB.isSelected();
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.swing.event.*;
|
|||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.DockingUtils;
|
||||
import docking.widgets.button.GRadioButton;
|
||||
import docking.widgets.label.GDLabel;
|
||||
import docking.widgets.label.GLabel;
|
||||
import ghidra.framework.client.*;
|
||||
|
@ -190,12 +191,12 @@ class RepositoryChooser extends DialogComponentProvider {
|
|||
}
|
||||
};
|
||||
|
||||
serverInfoChoice = new JRadioButton("Ghidra Server");
|
||||
serverInfoChoice = new GRadioButton("Ghidra Server");
|
||||
serverInfoChoice.setSelected(true);
|
||||
serverInfoChoice.addChangeListener(choiceListener);
|
||||
radioButtonPanel.add(serverInfoChoice);
|
||||
|
||||
urlChoice = new JRadioButton("Ghidra URL");
|
||||
urlChoice = new GRadioButton("Ghidra URL");
|
||||
urlChoice.addChangeListener(choiceListener);
|
||||
radioButtonPanel.add(urlChoice);
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.swing.*;
|
|||
import javax.swing.event.*;
|
||||
|
||||
import docking.DockingUtils;
|
||||
import docking.widgets.button.GRadioButton;
|
||||
import docking.widgets.label.GDLabel;
|
||||
import docking.wizard.*;
|
||||
import ghidra.app.util.GenericHelpTopics;
|
||||
|
@ -147,7 +148,7 @@ public class RepositoryPanel extends AbstractWizardJPanel {
|
|||
private JPanel createListPanel(String[] repositoryNames) {
|
||||
JPanel panel = new JPanel(new VerticalLayout(5));
|
||||
panel.setBorder(BorderFactory.createTitledBorder("Choose Existing Repository"));
|
||||
existingRepButton = new JRadioButton("Existing Repository", (repositoryNames.length > 0));
|
||||
existingRepButton = new GRadioButton("Existing Repository", (repositoryNames.length > 0));
|
||||
existingRepButton.setEnabled(repositoryNames.length > 0);
|
||||
buttonGroup.add(existingRepButton);
|
||||
|
||||
|
@ -177,7 +178,7 @@ public class RepositoryPanel extends AbstractWizardJPanel {
|
|||
namePanel.setLayout(new VerticalLayout(5));
|
||||
namePanel.setBorder(BorderFactory.createTitledBorder("Create Repository"));
|
||||
|
||||
createRepButton = new JRadioButton("Create Repository", !existingRepButton.isSelected());
|
||||
createRepButton = new GRadioButton("Create Repository", !existingRepButton.isSelected());
|
||||
buttonGroup.add(createRepButton);
|
||||
|
||||
nameLabel = new GDLabel("Repository Name:", SwingConstants.RIGHT);
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.*;
|
|||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.button.GRadioButton;
|
||||
import docking.widgets.label.GHtmlLabel;
|
||||
import ghidra.framework.model.Tool;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
|
@ -75,7 +76,7 @@ public class SelectChangedToolDialog extends DialogComponentProvider {
|
|||
|
||||
ButtonGroup buttonGroup = new ButtonGroup();
|
||||
|
||||
JRadioButton noneButton = new JRadioButton("None");
|
||||
GRadioButton noneButton = new GRadioButton("None");
|
||||
ItemListener listener = new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
|
@ -87,7 +88,7 @@ public class SelectChangedToolDialog extends DialogComponentProvider {
|
|||
panel.add(noneButton);
|
||||
|
||||
for (final Tool tool : toolList) {
|
||||
JRadioButton radioButton = new JRadioButton(tool.getName());
|
||||
GRadioButton radioButton = new GRadioButton(tool.getName());
|
||||
radioButton.addItemListener(new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.io.IOException;
|
|||
import javax.swing.*;
|
||||
|
||||
import docking.framework.DockingApplicationConfiguration;
|
||||
import docking.widgets.button.GRadioButton;
|
||||
import docking.widgets.checkbox.GCheckBox;
|
||||
import generic.concurrent.GThreadPool;
|
||||
import ghidra.GhidraApplicationLayout;
|
||||
|
@ -69,10 +70,10 @@ public class TaskSimulator {
|
|||
JButton addGroupButton = new JButton("Add Group");
|
||||
JButton addTaskButton = new JButton("Add Task");
|
||||
JButton showResultsButton = new JButton("Show Results");
|
||||
lowButton = new JRadioButton("Low");
|
||||
mediumButton = new JRadioButton("Medium");
|
||||
highButton = new JRadioButton("High");
|
||||
urgentButton = new JRadioButton("Urgent");
|
||||
lowButton = new GRadioButton("Low");
|
||||
mediumButton = new GRadioButton("Medium");
|
||||
highButton = new GRadioButton("High");
|
||||
urgentButton = new GRadioButton("Urgent");
|
||||
ButtonGroup group = new ButtonGroup();
|
||||
group.add(lowButton);
|
||||
group.add(mediumButton);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue