mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/GP-2795-dragonmacher-button-disabled-icons'
This commit is contained in:
commit
e100c84085
16 changed files with 123 additions and 114 deletions
|
@ -23,6 +23,7 @@ import javax.swing.event.DocumentEvent;
|
||||||
import javax.swing.event.DocumentListener;
|
import javax.swing.event.DocumentListener;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
import ghidra.trace.model.Trace;
|
import ghidra.trace.model.Trace;
|
||||||
|
@ -72,11 +73,11 @@ public class DebuggerTimeSelectionDialog extends DialogComponentProvider {
|
||||||
scheduleText = new JTextField();
|
scheduleText = new JTextField();
|
||||||
hbox.add(scheduleText);
|
hbox.add(scheduleText);
|
||||||
hbox.add(new JLabel("Ticks: "));
|
hbox.add(new JLabel("Ticks: "));
|
||||||
hbox.add(tickBack = new JButton(DebuggerResources.ICON_STEP_BACK));
|
hbox.add(tickBack = new GButton(DebuggerResources.ICON_STEP_BACK));
|
||||||
hbox.add(tickStep = new JButton(DebuggerResources.ICON_STEP_INTO));
|
hbox.add(tickStep = new GButton(DebuggerResources.ICON_STEP_INTO));
|
||||||
hbox.add(new JLabel("Ops: "));
|
hbox.add(new JLabel("Ops: "));
|
||||||
hbox.add(opBack = new JButton(DebuggerResources.ICON_STEP_BACK));
|
hbox.add(opBack = new GButton(DebuggerResources.ICON_STEP_BACK));
|
||||||
hbox.add(opStep = new JButton(DebuggerResources.ICON_STEP_INTO));
|
hbox.add(opStep = new GButton(DebuggerResources.ICON_STEP_INTO));
|
||||||
workPanel.add(hbox, BorderLayout.NORTH);
|
workPanel.add(hbox, BorderLayout.NORTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import com.google.common.base.Predicate;
|
||||||
import docking.ActionContext;
|
import docking.ActionContext;
|
||||||
import docking.widgets.DropDownSelectionTextField;
|
import docking.widgets.DropDownSelectionTextField;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import generic.theme.GIcon;
|
import generic.theme.GIcon;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors;
|
||||||
|
@ -126,13 +127,13 @@ public class BitFieldEditorPanel extends JPanel {
|
||||||
|
|
||||||
JPanel panel = new JPanel(new HorizontalLayout(5));
|
JPanel panel = new JPanel(new HorizontalLayout(5));
|
||||||
|
|
||||||
decrementButton = new JButton(DECREMENT_ICON);
|
decrementButton = new GButton(DECREMENT_ICON);
|
||||||
decrementButton.setFocusable(false);
|
decrementButton.setFocusable(false);
|
||||||
decrementButton.setToolTipText("Decrement allocation unit offset");
|
decrementButton.setToolTipText("Decrement allocation unit offset");
|
||||||
decrementButton.addActionListener(e -> adjustAllocationOffset(-1));
|
decrementButton.addActionListener(e -> adjustAllocationOffset(-1));
|
||||||
panel.add(decrementButton);
|
panel.add(decrementButton);
|
||||||
|
|
||||||
incrementButton = new JButton(INCREMENT_ICON);
|
incrementButton = new GButton(INCREMENT_ICON);
|
||||||
incrementButton.setFocusable(false);
|
incrementButton.setFocusable(false);
|
||||||
incrementButton.setToolTipText("Increment allocation unit offset");
|
incrementButton.setToolTipText("Increment allocation unit offset");
|
||||||
incrementButton.addActionListener(e -> adjustAllocationOffset(1));
|
incrementButton.addActionListener(e -> adjustAllocationOffset(1));
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import docking.*;
|
import docking.*;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.combobox.GComboBox;
|
import docking.widgets.combobox.GComboBox;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
|
@ -440,10 +441,10 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
|
||||||
private Component buildButtonPanel() {
|
private Component buildButtonPanel() {
|
||||||
JPanel panel = new JPanel(new VerticalLayout(5));
|
JPanel panel = new JPanel(new VerticalLayout(5));
|
||||||
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
||||||
addButton = new JButton(Icons.ADD_ICON);
|
addButton = new GButton(Icons.ADD_ICON);
|
||||||
removeButton = new JButton(Icons.DELETE_ICON);
|
removeButton = new GButton(Icons.DELETE_ICON);
|
||||||
upButton = new JButton(new GIcon("icon.up"));
|
upButton = new GButton(new GIcon("icon.up"));
|
||||||
downButton = new JButton(new GIcon("icon.down"));
|
downButton = new GButton(new GIcon("icon.down"));
|
||||||
addButton.setToolTipText("Add parameter");
|
addButton.setToolTipText("Add parameter");
|
||||||
removeButton.setToolTipText("Delete selected parameters");
|
removeButton.setToolTipText("Delete selected parameters");
|
||||||
upButton.setToolTipText("Move selected parameter up");
|
upButton.setToolTipText("Move selected parameter up");
|
||||||
|
|
|
@ -20,6 +20,7 @@ import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import generic.theme.GIcon;
|
import generic.theme.GIcon;
|
||||||
import resources.Icons;
|
import resources.Icons;
|
||||||
|
|
||||||
|
@ -128,6 +129,10 @@ public class FunctionTagButtonPanel extends JPanel {
|
||||||
|
|
||||||
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||||
setMaximumSize(new Dimension(30, 300));
|
setMaximumSize(new Dimension(30, 300));
|
||||||
|
|
||||||
|
addBtn.setEnabled(false);
|
||||||
|
removeBtn.setEnabled(false);
|
||||||
|
deleteBtn.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,7 +145,7 @@ public class FunctionTagButtonPanel extends JPanel {
|
||||||
* @return the new button
|
* @return the new button
|
||||||
*/
|
*/
|
||||||
private JButton createButton(String name, Icon icon, String tooltip, ActionListener action) {
|
private JButton createButton(String name, Icon icon, String tooltip, ActionListener action) {
|
||||||
JButton button = new JButton(name);
|
JButton button = new GButton(name);
|
||||||
button.setName(name);
|
button.setName(name);
|
||||||
button.setToolTipText(tooltip);
|
button.setToolTipText(tooltip);
|
||||||
button.setIcon(icon);
|
button.setIcon(icon);
|
||||||
|
|
|
@ -29,6 +29,7 @@ import javax.swing.table.AbstractTableModel;
|
||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
|
|
||||||
import docking.DropDownMenuIcon;
|
import docking.DropDownMenuIcon;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.combobox.GhidraComboBox;
|
import docking.widgets.combobox.GhidraComboBox;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
|
@ -104,7 +105,7 @@ class EditMemoryReferencePanel extends EditReferencePanel {
|
||||||
|
|
||||||
toAddressField = new AddressInput();
|
toAddressField = new AddressInput();
|
||||||
|
|
||||||
addrHistoryButton = new JButton(MENU_ICON);
|
addrHistoryButton = new GButton(MENU_ICON);
|
||||||
addrHistoryButton.addMouseListener(new MouseAdapter() {
|
addrHistoryButton.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
|
|
|
@ -20,8 +20,10 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.*;
|
import javax.swing.event.ChangeEvent;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import generic.theme.GIcon;
|
import generic.theme.GIcon;
|
||||||
import ghidra.program.model.address.*;
|
import ghidra.program.model.address.*;
|
||||||
|
@ -81,10 +83,10 @@ public class AddressSetEditorPanel extends JPanel {
|
||||||
maxAddressField.addChangeListener(listener);
|
maxAddressField.addChangeListener(listener);
|
||||||
maxAddressPanel.add(maxAddressField, BorderLayout.CENTER);
|
maxAddressPanel.add(maxAddressField, BorderLayout.CENTER);
|
||||||
maxAddressPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
|
maxAddressPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
|
||||||
addRangeButton = new JButton(ADD_ICON);
|
addRangeButton = new GButton(ADD_ICON);
|
||||||
addRangeButton.addActionListener(e -> addRange());
|
addRangeButton.addActionListener(e -> addRange());
|
||||||
addRangeButton.setToolTipText("Add the range to the set of included addresses");
|
addRangeButton.setToolTipText("Add the range to the set of included addresses");
|
||||||
subtractRangeButton = new JButton(SUBTRACT_ICON);
|
subtractRangeButton = new GButton(SUBTRACT_ICON);
|
||||||
subtractRangeButton.addActionListener(e -> subtractRange());
|
subtractRangeButton.addActionListener(e -> subtractRange());
|
||||||
subtractRangeButton.setToolTipText("Remove the range from the set of included addresses");
|
subtractRangeButton.setToolTipText("Remove the range from the set of included addresses");
|
||||||
|
|
||||||
|
@ -116,7 +118,7 @@ public class AddressSetEditorPanel extends JPanel {
|
||||||
bottomButtons = new JPanel();
|
bottomButtons = new JPanel();
|
||||||
bottomButtons.setLayout(new MiddleLayout());
|
bottomButtons.setLayout(new MiddleLayout());
|
||||||
|
|
||||||
removeRangeButton = new JButton("Remove Selected Range(s)");
|
removeRangeButton = new GButton("Remove Selected Range(s)");
|
||||||
removeRangeButton.addActionListener(e -> removeRange());
|
removeRangeButton.addActionListener(e -> removeRange());
|
||||||
|
|
||||||
bottomButtons.add(removeRangeButton);
|
bottomButtons.add(removeRangeButton);
|
||||||
|
|
|
@ -30,6 +30,7 @@ import javax.swing.table.TableColumn;
|
||||||
import docking.DockingWindowManager;
|
import docking.DockingWindowManager;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
import docking.widgets.button.BrowseButton;
|
import docking.widgets.button.BrowseButton;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.filechooser.GhidraFileChooser;
|
import docking.widgets.filechooser.GhidraFileChooser;
|
||||||
import docking.widgets.filechooser.GhidraFileChooserMode;
|
import docking.widgets.filechooser.GhidraFileChooserMode;
|
||||||
import docking.widgets.label.GHtmlLabel;
|
import docking.widgets.label.GHtmlLabel;
|
||||||
|
@ -566,7 +567,7 @@ class SymbolServerPanel extends JPanel {
|
||||||
|
|
||||||
private static JButton createImageButton(Icon buttonIcon, String alternateText) {
|
private static JButton createImageButton(Icon buttonIcon, String alternateText) {
|
||||||
|
|
||||||
JButton button = new JButton(buttonIcon);
|
JButton button = new GButton(buttonIcon);
|
||||||
button.setToolTipText(alternateText);
|
button.setToolTipText(alternateText);
|
||||||
button.setPreferredSize(BUTTON_SIZE);
|
button.setPreferredSize(BUTTON_SIZE);
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,13 @@ package ghidra.feature.vt.gui.wizard;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.*;
|
import javax.swing.event.ChangeEvent;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.button.GRadioButton;
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import docking.widgets.list.GList;
|
import docking.widgets.list.GList;
|
||||||
|
@ -46,11 +46,7 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
private PluginTool tool;
|
private PluginTool tool;
|
||||||
private final String name;
|
private final String name;
|
||||||
private final Program program;
|
private final Program program;
|
||||||
private final AddressFactory addressFactory;
|
|
||||||
private final AddressSet selectionAddressSet;
|
|
||||||
private boolean hasSelection = false;
|
private boolean hasSelection = false;
|
||||||
private final AddressSet myInitialAddressSet;
|
|
||||||
private final AddressSetChoice initialAddressSetChoice;
|
|
||||||
private AddressSet myCurrentAddressSet;
|
private AddressSet myCurrentAddressSet;
|
||||||
private AddressSetChoice currentAddressSetChoice;
|
private AddressSetChoice currentAddressSetChoice;
|
||||||
private JRadioButton entireProgramButton;
|
private JRadioButton entireProgramButton;
|
||||||
|
@ -70,18 +66,14 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
final AddressSetChoice initialAddressSetChoice) {
|
final AddressSetChoice initialAddressSetChoice) {
|
||||||
|
|
||||||
super(new BorderLayout());
|
super(new BorderLayout());
|
||||||
// Establish the initial state from the parameters.
|
|
||||||
this.tool = tool;
|
this.tool = tool;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.program = program;
|
this.program = program;
|
||||||
this.addressFactory = program.getAddressFactory();
|
|
||||||
this.selectionAddressSet = new AddressSet(selectionAddressSet);
|
|
||||||
if (selectionAddressSet != null && !selectionAddressSet.isEmpty()) {
|
if (selectionAddressSet != null && !selectionAddressSet.isEmpty()) {
|
||||||
hasSelection = true;
|
hasSelection = true;
|
||||||
}
|
}
|
||||||
this.myInitialAddressSet = new AddressSet(myInitialAddressSet);
|
|
||||||
this.initialAddressSetChoice = (initialAddressSetChoice != null) ? initialAddressSetChoice
|
|
||||||
: (hasSelection ? AddressSetChoice.SELECTION : AddressSetChoice.ENTIRE_PROGRAM);
|
|
||||||
|
|
||||||
if (myInitialAddressSet != null && !myInitialAddressSet.isEmpty()) {
|
if (myInitialAddressSet != null && !myInitialAddressSet.isEmpty()) {
|
||||||
myCurrentAddressSet = new AddressSet(myInitialAddressSet);
|
myCurrentAddressSet = new AddressSet(myInitialAddressSet);
|
||||||
|
@ -134,26 +126,9 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
myRangesButton.setToolTipText("Limit the address ranges from the " + name +
|
myRangesButton.setToolTipText("Limit the address ranges from the " + name +
|
||||||
" program to those that I am specifying here.");
|
" program to those that I am specifying here.");
|
||||||
|
|
||||||
entireProgramButton.addActionListener(new ActionListener() {
|
entireProgramButton.addActionListener(ev -> choseEntireProgram());
|
||||||
@Override
|
toolSelectionButton.addActionListener(ev -> choseToolSelection());
|
||||||
public void actionPerformed(ActionEvent ev) {
|
myRangesButton.addActionListener(ev -> choseMyRanges());
|
||||||
choseEntireProgram();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
toolSelectionButton.addActionListener(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent ev) {
|
|
||||||
choseToolSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
myRangesButton.addActionListener(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent ev) {
|
|
||||||
choseMyRanges();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
chooseSourcePanel.add(entireProgramButton);
|
chooseSourcePanel.add(entireProgramButton);
|
||||||
chooseSourcePanel.add(toolSelectionButton);
|
chooseSourcePanel.add(toolSelectionButton);
|
||||||
|
@ -195,13 +170,8 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
bottomButtons = new JPanel();
|
bottomButtons = new JPanel();
|
||||||
bottomButtons.setLayout(new MiddleLayout());
|
bottomButtons.setLayout(new MiddleLayout());
|
||||||
|
|
||||||
removeRangeButton = new JButton("Remove Selected Range(s)");
|
removeRangeButton = new GButton("Remove Selected Range(s)");
|
||||||
removeRangeButton.addActionListener(new ActionListener() {
|
removeRangeButton.addActionListener(e -> removeRange());
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
removeRange();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bottomButtons.add(removeRangeButton);
|
bottomButtons.add(removeRangeButton);
|
||||||
return bottomButtons;
|
return bottomButtons;
|
||||||
|
@ -209,22 +179,12 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
|
|
||||||
private Component createRangeListPanel() {
|
private Component createRangeListPanel() {
|
||||||
|
|
||||||
addRangeButton = new JButton(ADD_ICON);
|
addRangeButton = new GButton(ADD_ICON);
|
||||||
addRangeButton.addActionListener(new ActionListener() {
|
addRangeButton.addActionListener(e -> showAddRangeDialog());
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
showAddRangeDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
addRangeButton.setToolTipText("Add the range to the set of included addresses");
|
addRangeButton.setToolTipText("Add the range to the set of included addresses");
|
||||||
|
|
||||||
subtractRangeButton = new JButton(SUBTRACT_ICON);
|
subtractRangeButton = new GButton(SUBTRACT_ICON);
|
||||||
subtractRangeButton.addActionListener(new ActionListener() {
|
subtractRangeButton.addActionListener(e -> showSubtractRangeDialog());
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
showSubtractRangeDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
subtractRangeButton.setToolTipText("Remove the range from the set of included addresses");
|
subtractRangeButton.setToolTipText("Remove the range from the set of included addresses");
|
||||||
|
|
||||||
JPanel buttonPanel = new JPanel();
|
JPanel buttonPanel = new JPanel();
|
||||||
|
@ -237,12 +197,7 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
listModel = new AddressSetListModel(myCurrentAddressSet.toList());
|
listModel = new AddressSetListModel(myCurrentAddressSet.toList());
|
||||||
list = new GList<>(listModel);
|
list = new GList<>(listModel);
|
||||||
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
list.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
|
list.getSelectionModel().addListSelectionListener(e -> validateRemoveButton());
|
||||||
@Override
|
|
||||||
public void valueChanged(ListSelectionEvent e) {
|
|
||||||
validateRemoveButton();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
JScrollPane scrollPane = new JScrollPane(list);
|
JScrollPane scrollPane = new JScrollPane(list);
|
||||||
|
|
||||||
JPanel panel = new JPanel(new BorderLayout());
|
JPanel panel = new JPanel(new BorderLayout());
|
||||||
|
@ -255,24 +210,16 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showAddRangeDialog() {
|
protected void showAddRangeDialog() {
|
||||||
AddressRangeListener addListener = new AddressRangeListener() {
|
AddressRangeListener addListener =
|
||||||
@Override
|
(minAddress, maxAddress) -> addRange(minAddress, maxAddress);
|
||||||
public void processAddressRange(Address minAddress, Address maxAddress) {
|
|
||||||
addRange(minAddress, maxAddress);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
AddRemoveAddressRangeDialog addRangeDialog =
|
AddRemoveAddressRangeDialog addRangeDialog =
|
||||||
new AddRemoveAddressRangeDialog("Add", name, program, addListener);
|
new AddRemoveAddressRangeDialog("Add", name, program, addListener);
|
||||||
tool.showDialog(addRangeDialog, this.getRootPane());
|
tool.showDialog(addRangeDialog, this.getRootPane());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showSubtractRangeDialog() {
|
protected void showSubtractRangeDialog() {
|
||||||
AddressRangeListener subtractListener = new AddressRangeListener() {
|
AddressRangeListener subtractListener =
|
||||||
@Override
|
(minAddress, maxAddress) -> subtractRange(minAddress, maxAddress);
|
||||||
public void processAddressRange(Address minAddress, Address maxAddress) {
|
|
||||||
subtractRange(minAddress, maxAddress);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
AddRemoveAddressRangeDialog removeRangeDialog =
|
AddRemoveAddressRangeDialog removeRangeDialog =
|
||||||
new AddRemoveAddressRangeDialog("Remove", name, program, subtractListener);
|
new AddRemoveAddressRangeDialog("Remove", name, program, subtractListener);
|
||||||
tool.showDialog(removeRangeDialog, this.getRootPane());
|
tool.showDialog(removeRangeDialog, this.getRootPane());
|
||||||
|
@ -289,8 +236,8 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
||||||
private synchronized void removeRange() {
|
private synchronized void removeRange() {
|
||||||
int[] selectedIndices = list.getSelectedIndices();
|
int[] selectedIndices = list.getSelectedIndices();
|
||||||
AddressSet removeRanges = new AddressSet();
|
AddressSet removeRanges = new AddressSet();
|
||||||
for (int i = 0; i < selectedIndices.length; i++) {
|
for (int selectedIndex : selectedIndices) {
|
||||||
AddressRange addressRange = listModel.getElementAt(selectedIndices[i]);
|
AddressRange addressRange = listModel.getElementAt(selectedIndex);
|
||||||
removeRanges.add(addressRange);
|
removeRanges.add(addressRange);
|
||||||
}
|
}
|
||||||
myCurrentAddressSet.delete(removeRanges);
|
myCurrentAddressSet.delete(removeRanges);
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
/* ###
|
||||||
|
* IP: GHIDRA
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package docking.widgets.button;
|
||||||
|
|
||||||
|
import javax.swing.Icon;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
|
||||||
|
import resources.ResourceManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A drop-in replacement for {@link JButton} that correctly installs a disable icon.
|
||||||
|
*/
|
||||||
|
public class GButton extends JButton {
|
||||||
|
|
||||||
|
public GButton() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GButton(Icon icon) {
|
||||||
|
super(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GButton(String text) {
|
||||||
|
super(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setIcon(Icon newIcon) {
|
||||||
|
Icon disabledIcon = ResourceManager.getDisabledIcon(newIcon);
|
||||||
|
setDisabledIcon(disabledIcon);
|
||||||
|
super.setIcon(newIcon);
|
||||||
|
}
|
||||||
|
}
|
|
@ -140,7 +140,7 @@ public class GLabel extends JLabel implements GComponent {
|
||||||
* <p>
|
* <p>
|
||||||
* If the user has a type of "GLabel", they will see the deprecated warning on calls to setText().
|
* If the user has a type of "GLabel", they will see the deprecated warning on calls to setText().
|
||||||
* <p>
|
* <p>
|
||||||
* If there are calls to setText() after the initial value has been set by the ctor, a
|
* If there are calls to setText() after the initial value has been set by the constructor, a
|
||||||
* warning will be printed in the log.
|
* warning will be printed in the log.
|
||||||
* <p>
|
* <p>
|
||||||
* @param text string this label will display
|
* @param text string this label will display
|
||||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.*;
|
||||||
import javax.swing.event.TableModelListener;
|
import javax.swing.event.TableModelListener;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
|
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.filechooser.GhidraFileChooser;
|
import docking.widgets.filechooser.GhidraFileChooser;
|
||||||
import docking.widgets.filechooser.GhidraFileChooserMode;
|
import docking.widgets.filechooser.GhidraFileChooserMode;
|
||||||
import docking.widgets.table.*;
|
import docking.widgets.table.*;
|
||||||
|
@ -162,26 +163,26 @@ public class PathManager {
|
||||||
panel = new JPanel(new BorderLayout(5, 5));
|
panel = new JPanel(new BorderLayout(5, 5));
|
||||||
|
|
||||||
if (allowOrdering) {
|
if (allowOrdering) {
|
||||||
upButton = new JButton(Icons.UP_ICON);
|
upButton = new GButton(Icons.UP_ICON);
|
||||||
upButton.setName("UpArrow");
|
upButton.setName("UpArrow");
|
||||||
upButton.setToolTipText("Move the selected path up in list");
|
upButton.setToolTipText("Move the selected path up in list");
|
||||||
upButton.addActionListener(e -> up());
|
upButton.addActionListener(e -> up());
|
||||||
upButton.setFocusable(false);
|
upButton.setFocusable(false);
|
||||||
|
|
||||||
downButton = new JButton(Icons.DOWN_ICON);
|
downButton = new GButton(Icons.DOWN_ICON);
|
||||||
downButton.setName("DownArrow");
|
downButton.setName("DownArrow");
|
||||||
downButton.setToolTipText("Move the selected path down in list");
|
downButton.setToolTipText("Move the selected path down in list");
|
||||||
downButton.addActionListener(e -> down());
|
downButton.addActionListener(e -> down());
|
||||||
downButton.setFocusable(false);
|
downButton.setFocusable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
addButton = new JButton(Icons.ADD_ICON);
|
addButton = new GButton(Icons.ADD_ICON);
|
||||||
addButton.setName("AddPath");
|
addButton.setName("AddPath");
|
||||||
addButton.setToolTipText("Display file chooser to select files to add");
|
addButton.setToolTipText("Display file chooser to select files to add");
|
||||||
addButton.addActionListener(e -> add());
|
addButton.addActionListener(e -> add());
|
||||||
addButton.setFocusable(false);
|
addButton.setFocusable(false);
|
||||||
|
|
||||||
removeButton = new JButton(Icons.DELETE_ICON);
|
removeButton = new GButton(Icons.DELETE_ICON);
|
||||||
removeButton.setName("RemovePath");
|
removeButton.setName("RemovePath");
|
||||||
removeButton.setToolTipText("Remove selected path(s) from list");
|
removeButton.setToolTipText("Remove selected path(s) from list");
|
||||||
removeButton.addActionListener(e -> remove());
|
removeButton.addActionListener(e -> remove());
|
||||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Objects;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.filechooser.GhidraFileChooser;
|
import docking.widgets.filechooser.GhidraFileChooser;
|
||||||
import docking.widgets.filechooser.GhidraFileChooserMode;
|
import docking.widgets.filechooser.GhidraFileChooserMode;
|
||||||
import docking.widgets.table.*;
|
import docking.widgets.table.*;
|
||||||
|
@ -157,24 +158,24 @@ public class PathnameTablePanel extends JPanel {
|
||||||
|
|
||||||
private void create() {
|
private void create() {
|
||||||
|
|
||||||
upButton = new JButton(Icons.UP_ICON);
|
upButton = new GButton(Icons.UP_ICON);
|
||||||
upButton.setName("UpArrow");
|
upButton.setName("UpArrow");
|
||||||
upButton.setToolTipText("Move the selected path up in list");
|
upButton.setToolTipText("Move the selected path up in list");
|
||||||
upButton.addActionListener(e -> up());
|
upButton.addActionListener(e -> up());
|
||||||
downButton = new JButton(Icons.DOWN_ICON);
|
downButton = new GButton(Icons.DOWN_ICON);
|
||||||
downButton.setName("DownArrow");
|
downButton.setName("DownArrow");
|
||||||
downButton.setToolTipText("Move the selected path down in list");
|
downButton.setToolTipText("Move the selected path down in list");
|
||||||
downButton.addActionListener(e -> down());
|
downButton.addActionListener(e -> down());
|
||||||
addButton = new JButton(Icons.ADD_ICON);
|
addButton = new GButton(Icons.ADD_ICON);
|
||||||
addButton.setName("AddPath");
|
addButton.setName("AddPath");
|
||||||
addButton.setToolTipText("Display file chooser to select files to add");
|
addButton.setToolTipText("Display file chooser to select files to add");
|
||||||
addButton.addActionListener(e -> add());
|
addButton.addActionListener(e -> add());
|
||||||
removeButton = new JButton(Icons.DELETE_ICON);
|
removeButton = new GButton(Icons.DELETE_ICON);
|
||||||
removeButton.setName("RemovePath");
|
removeButton.setName("RemovePath");
|
||||||
removeButton.setToolTipText("Remove selected path(s) from list");
|
removeButton.setToolTipText("Remove selected path(s) from list");
|
||||||
removeButton.addActionListener(e -> remove());
|
removeButton.addActionListener(e -> remove());
|
||||||
|
|
||||||
resetButton = new JButton(RESET_ICON);
|
resetButton = new GButton(RESET_ICON);
|
||||||
resetButton.setName("RefreshPaths");
|
resetButton.setName("RefreshPaths");
|
||||||
resetButton.setToolTipText("Resets path list to the default values");
|
resetButton.setToolTipText("Resets path list to the default values");
|
||||||
resetButton.addActionListener(e -> reset());
|
resetButton.addActionListener(e -> reset());
|
||||||
|
|
|
@ -31,6 +31,7 @@ import javax.swing.event.ListSelectionEvent;
|
||||||
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.ListSelectionListener;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.filechooser.GhidraFileChooser;
|
import docking.widgets.filechooser.GhidraFileChooser;
|
||||||
import docking.widgets.filechooser.GhidraFileChooserMode;
|
import docking.widgets.filechooser.GhidraFileChooserMode;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
|
@ -44,7 +45,6 @@ import ghidra.util.Msg;
|
||||||
import ghidra.util.filechooser.ExtensionFileFilter;
|
import ghidra.util.filechooser.ExtensionFileFilter;
|
||||||
import ghidra.util.filechooser.GhidraFileFilter;
|
import ghidra.util.filechooser.GhidraFileFilter;
|
||||||
import resources.Icons;
|
import resources.Icons;
|
||||||
import resources.ResourceManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialog for editing the Plugin path and Jar directory path preferences.
|
* Dialog for editing the Plugin path and Jar directory path preferences.
|
||||||
|
@ -268,13 +268,11 @@ class EditPluginPathDialog extends DialogComponentProvider {
|
||||||
|
|
||||||
private JPanel buildPluginPathsPanel() {
|
private JPanel buildPluginPathsPanel() {
|
||||||
// create the UP and DOWN arrows panel
|
// create the UP and DOWN arrows panel
|
||||||
upButton = new JButton(Icons.UP_ICON);
|
upButton = new GButton(Icons.UP_ICON);
|
||||||
upButton.setDisabledIcon(ResourceManager.getDisabledIcon(Icons.UP_ICON));
|
|
||||||
upButton.setName("UpArrow");
|
upButton.setName("UpArrow");
|
||||||
upButton.addActionListener(e -> handleSelection(UP));
|
upButton.addActionListener(e -> handleSelection(UP));
|
||||||
|
|
||||||
downButton = new JButton(Icons.DOWN_ICON);
|
downButton = new GButton(Icons.DOWN_ICON);
|
||||||
downButton.setDisabledIcon(ResourceManager.getDisabledIcon(Icons.DOWN_ICON));
|
|
||||||
downButton.setName("DownArrow");
|
downButton.setName("DownArrow");
|
||||||
downButton.addActionListener(e -> handleSelection(DOWN));
|
downButton.addActionListener(e -> handleSelection(DOWN));
|
||||||
JPanel arrowButtonsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
|
JPanel arrowButtonsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
|
||||||
|
@ -282,11 +280,11 @@ class EditPluginPathDialog extends DialogComponentProvider {
|
||||||
arrowButtonsPanel.add(downButton);
|
arrowButtonsPanel.add(downButton);
|
||||||
|
|
||||||
// create the Add and Remove panel
|
// create the Add and Remove panel
|
||||||
JButton addJarButton = new JButton(ADD_JAR_BUTTON_TEXT);
|
JButton addJarButton = new GButton(ADD_JAR_BUTTON_TEXT);
|
||||||
addJarButton.addActionListener(e -> addJarCallback());
|
addJarButton.addActionListener(e -> addJarCallback());
|
||||||
JButton addDirButton = new JButton(ADD_DIR_BUTTON_TEXT);
|
JButton addDirButton = new GButton(ADD_DIR_BUTTON_TEXT);
|
||||||
addDirButton.addActionListener(e -> addDirCallback());
|
addDirButton.addActionListener(e -> addDirCallback());
|
||||||
removeButton = new JButton("Remove");
|
removeButton = new GButton("Remove");
|
||||||
removeButton.addActionListener(e -> handleSelection(REMOVE));
|
removeButton.addActionListener(e -> handleSelection(REMOVE));
|
||||||
Dimension d = addJarButton.getPreferredSize();
|
Dimension d = addJarButton.getPreferredSize();
|
||||||
addDirButton.setPreferredSize(d);
|
addDirButton.setPreferredSize(d);
|
||||||
|
|
|
@ -32,6 +32,7 @@ import docking.action.MenuData;
|
||||||
import docking.tool.ToolConstants;
|
import docking.tool.ToolConstants;
|
||||||
import docking.widgets.OkDialog;
|
import docking.widgets.OkDialog;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.dialogs.InputDialog;
|
import docking.widgets.dialogs.InputDialog;
|
||||||
import docking.widgets.filechooser.GhidraFileChooser;
|
import docking.widgets.filechooser.GhidraFileChooser;
|
||||||
import docking.widgets.filechooser.GhidraFileChooserMode;
|
import docking.widgets.filechooser.GhidraFileChooserMode;
|
||||||
|
@ -697,7 +698,7 @@ public class FrontEndPlugin extends Plugin
|
||||||
RepositoryAdapter repository = project.getRepository();
|
RepositoryAdapter repository = project.getRepository();
|
||||||
User user = null;
|
User user = null;
|
||||||
boolean isConnected = repository.isConnected();
|
boolean isConnected = repository.isConnected();
|
||||||
connectionButton = new JButton(isConnected ? CONNECTED_ICON : DISCONNECTED_ICON);
|
connectionButton = new GButton(isConnected ? CONNECTED_ICON : DISCONNECTED_ICON);
|
||||||
connectionButton.addActionListener(e -> connect());
|
connectionButton.addActionListener(e -> connect());
|
||||||
|
|
||||||
connectionButton.setContentAreaFilled(false);
|
connectionButton.setContentAreaFilled(false);
|
||||||
|
|
|
@ -27,6 +27,7 @@ import javax.swing.border.BevelBorder;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import docking.wizard.WizardManager;
|
import docking.wizard.WizardManager;
|
||||||
|
@ -253,7 +254,7 @@ public class ProjectInfoDialog extends DialogComponentProvider {
|
||||||
JLabel connectLabel = new GDLabel("Connection Status:", SwingConstants.RIGHT);
|
JLabel connectLabel = new GDLabel("Connection Status:", SwingConstants.RIGHT);
|
||||||
panel.add(connectLabel);
|
panel.add(connectLabel);
|
||||||
|
|
||||||
connectionButton = new JButton(
|
connectionButton = new GButton(
|
||||||
isConnected ? FrontEndPlugin.CONNECTED_ICON : FrontEndPlugin.DISCONNECTED_ICON);
|
isConnected ? FrontEndPlugin.CONNECTED_ICON : FrontEndPlugin.DISCONNECTED_ICON);
|
||||||
connectionButton.addActionListener(e -> connect());
|
connectionButton.addActionListener(e -> connect());
|
||||||
connectionButton.setName("Connect Button");
|
connectionButton.setName("Connect Button");
|
||||||
|
|
|
@ -17,15 +17,17 @@ package ghidra.framework.main;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.CardLayout;
|
import java.awt.CardLayout;
|
||||||
import java.awt.event.*;
|
import java.awt.event.MouseEvent;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.*;
|
import javax.swing.event.ChangeListener;
|
||||||
|
import javax.swing.event.MouseInputAdapter;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.button.GRadioButton;
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
|
@ -78,7 +80,7 @@ class RepositoryChooser extends DialogComponentProvider {
|
||||||
serverInfoComponent.setChangeListener(e -> serverInfoChanged());
|
serverInfoComponent.setChangeListener(e -> serverInfoChanged());
|
||||||
topPanel.add(serverInfoComponent, BorderLayout.CENTER);
|
topPanel.add(serverInfoComponent, BorderLayout.CENTER);
|
||||||
|
|
||||||
queryButton = new JButton(REFRESH_ICON);
|
queryButton = new GButton(REFRESH_ICON);
|
||||||
queryButton.setToolTipText("Refresh Repository Names List");
|
queryButton.setToolTipText("Refresh Repository Names List");
|
||||||
setDefaultButton(queryButton);
|
setDefaultButton(queryButton);
|
||||||
queryButton.addActionListener(e -> queryServer());
|
queryButton.addActionListener(e -> queryServer());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue