mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
GT-2698 - convert JRadioButton to GRadioButton
This commit is contained in:
parent
3c0484cae3
commit
d7410690ff
@ -35,6 +35,7 @@ import docking.action.ToolBarData;
|
|||||||
import docking.menu.ActionState;
|
import docking.menu.ActionState;
|
||||||
import docking.menu.MultiStateDockingAction;
|
import docking.menu.MultiStateDockingAction;
|
||||||
import docking.widgets.*;
|
import docking.widgets.*;
|
||||||
|
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;
|
||||||
import ghidra.examples.graph.layout.SampleGraphPluginDependencyLayoutProvider;
|
import ghidra.examples.graph.layout.SampleGraphPluginDependencyLayoutProvider;
|
||||||
@ -189,9 +190,9 @@ public class SampleGraphProvider extends ComponentProviderAdapter {
|
|||||||
//
|
//
|
||||||
// How should we display the filtered-out vertices?
|
// How should we display the filtered-out vertices?
|
||||||
//
|
//
|
||||||
fadedButton = new JRadioButton("Faded");
|
fadedButton = new GRadioButton("Faded");
|
||||||
fadedButton.setToolTipText("Filtered vertices remain in the graph, but are grayed-out");
|
fadedButton.setToolTipText("Filtered vertices remain in the graph, but are grayed-out");
|
||||||
removedButton = new JRadioButton("Removed");
|
removedButton = new GRadioButton("Removed");
|
||||||
removedButton.setToolTipText("Filtered vertices are removed from the graph");
|
removedButton.setToolTipText("Filtered vertices are removed from the graph");
|
||||||
|
|
||||||
ButtonGroup group = new ButtonGroup();
|
ButtonGroup group = new ButtonGroup();
|
||||||
|
@ -22,6 +22,7 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
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;
|
||||||
import ghidra.app.merge.MergeConstants;
|
import ghidra.app.merge.MergeConstants;
|
||||||
@ -96,9 +97,9 @@ class CategoryConflictPanel extends JPanel {
|
|||||||
labelPanel.add(Box.createHorizontalStrut(5));
|
labelPanel.add(Box.createHorizontalStrut(5));
|
||||||
labelPanel.add(categoryLabel);
|
labelPanel.add(categoryLabel);
|
||||||
|
|
||||||
latestRB = new JRadioButton("Use Latest");
|
latestRB = new GRadioButton("Use Latest");
|
||||||
myRB = new JRadioButton("Use My Version");
|
myRB = new GRadioButton("Use My Version");
|
||||||
originalRB = new JRadioButton("Use Original");
|
originalRB = new GRadioButton("Use Original");
|
||||||
latestRB.setName(LATEST_BUTTON_NAME);
|
latestRB.setName(LATEST_BUTTON_NAME);
|
||||||
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
||||||
originalRB.setName(ORIGINAL_BUTTON_NAME);
|
originalRB.setName(ORIGINAL_BUTTON_NAME);
|
||||||
|
@ -23,6 +23,7 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.widgets.MultiLineLabel;
|
import docking.widgets.MultiLineLabel;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.label.GIconLabel;
|
import docking.widgets.label.GIconLabel;
|
||||||
import ghidra.app.merge.MergeConstants;
|
import ghidra.app.merge.MergeConstants;
|
||||||
@ -114,15 +115,15 @@ class DataTypeMergePanel extends JPanel {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
latestRB = new JRadioButton(MergeConstants.LATEST_TITLE);
|
latestRB = new GRadioButton(MergeConstants.LATEST_TITLE);
|
||||||
latestRB.setName(LATEST_BUTTON_NAME);
|
latestRB.setName(LATEST_BUTTON_NAME);
|
||||||
latestRB.addItemListener(listener);
|
latestRB.addItemListener(listener);
|
||||||
|
|
||||||
myRB = new JRadioButton(MergeConstants.MY_TITLE);
|
myRB = new GRadioButton(MergeConstants.MY_TITLE);
|
||||||
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
||||||
myRB.addItemListener(listener);
|
myRB.addItemListener(listener);
|
||||||
|
|
||||||
originalRB = new JRadioButton(MergeConstants.ORIGINAL_TITLE);
|
originalRB = new GRadioButton(MergeConstants.ORIGINAL_TITLE);
|
||||||
originalRB.setName(ORIGINAL_BUTTON_NAME);
|
originalRB.setName(ORIGINAL_BUTTON_NAME);
|
||||||
originalRB.addItemListener(listener);
|
originalRB.addItemListener(listener);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.widgets.MultiLineLabel;
|
import docking.widgets.MultiLineLabel;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.label.GIconLabel;
|
import docking.widgets.label.GIconLabel;
|
||||||
import ghidra.app.merge.MergeConstants;
|
import ghidra.app.merge.MergeConstants;
|
||||||
@ -113,15 +114,15 @@ class SourceArchiveMergePanel extends JPanel {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
latestRB = new JRadioButton(MergeConstants.LATEST_TITLE);
|
latestRB = new GRadioButton(MergeConstants.LATEST_TITLE);
|
||||||
latestRB.setName(LATEST_BUTTON_NAME);
|
latestRB.setName(LATEST_BUTTON_NAME);
|
||||||
latestRB.addItemListener(listener);
|
latestRB.addItemListener(listener);
|
||||||
|
|
||||||
myRB = new JRadioButton(MergeConstants.MY_TITLE);
|
myRB = new GRadioButton(MergeConstants.MY_TITLE);
|
||||||
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
||||||
myRB.addItemListener(listener);
|
myRB.addItemListener(listener);
|
||||||
|
|
||||||
originalRB = new JRadioButton(MergeConstants.ORIGINAL_TITLE);
|
originalRB = new GRadioButton(MergeConstants.ORIGINAL_TITLE);
|
||||||
originalRB.setName(ORIGINAL_BUTTON_NAME);
|
originalRB.setName(ORIGINAL_BUTTON_NAME);
|
||||||
originalRB.addItemListener(listener);
|
originalRB.addItemListener(listener);
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.widgets.EmptyBorderButton;
|
import docking.widgets.EmptyBorderButton;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.fieldpanel.FieldPanel;
|
import docking.widgets.fieldpanel.FieldPanel;
|
||||||
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
|
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
|
||||||
import docking.widgets.label.GIconLabel;
|
import docking.widgets.label.GIconLabel;
|
||||||
@ -224,19 +225,19 @@ class ExternalAddConflictPanel extends JPanel implements CodeFormatService {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
keepLatestRB = new JRadioButton(MergeConstants.LATEST_TITLE);
|
keepLatestRB = new GRadioButton(MergeConstants.LATEST_TITLE);
|
||||||
keepLatestRB.setName(KEEP_LATEST_BUTTON_NAME);
|
keepLatestRB.setName(KEEP_LATEST_BUTTON_NAME);
|
||||||
keepLatestRB.addItemListener(listener);
|
keepLatestRB.addItemListener(listener);
|
||||||
|
|
||||||
keepMyRB = new JRadioButton(MergeConstants.MY_TITLE);
|
keepMyRB = new GRadioButton(MergeConstants.MY_TITLE);
|
||||||
keepMyRB.setName(KEEP_MY_BUTTON_NAME);
|
keepMyRB.setName(KEEP_MY_BUTTON_NAME);
|
||||||
keepMyRB.addItemListener(listener);
|
keepMyRB.addItemListener(listener);
|
||||||
|
|
||||||
keepBothRB = new JRadioButton("Both");
|
keepBothRB = new GRadioButton("Both");
|
||||||
keepBothRB.setName(KEEP_BOTH_BUTTON_NAME);
|
keepBothRB.setName(KEEP_BOTH_BUTTON_NAME);
|
||||||
keepBothRB.addItemListener(listener);
|
keepBothRB.addItemListener(listener);
|
||||||
|
|
||||||
mergeBothRB = new JRadioButton("Merge");
|
mergeBothRB = new GRadioButton("Merge");
|
||||||
mergeBothRB.setName(MERGE_BOTH_BUTTON_NAME);
|
mergeBothRB.setName(MERGE_BOTH_BUTTON_NAME);
|
||||||
mergeBothRB.addItemListener(listener);
|
mergeBothRB.addItemListener(listener);
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import javax.swing.border.TitledBorder;
|
|||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
import javax.swing.table.TableModel;
|
import javax.swing.table.TableModel;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import docking.widgets.table.AbstractSortedTableModel;
|
import docking.widgets.table.AbstractSortedTableModel;
|
||||||
import docking.widgets.table.GTable;
|
import docking.widgets.table.GTable;
|
||||||
@ -253,7 +254,7 @@ class ListChoice extends JPanel {
|
|||||||
|
|
||||||
setLayout(new BorderLayout());
|
setLayout(new BorderLayout());
|
||||||
|
|
||||||
rb = new JRadioButton("UNKNOWN");
|
rb = new GRadioButton("UNKNOWN");
|
||||||
rb.addItemListener(radioButtonListener);
|
rb.addItemListener(radioButtonListener);
|
||||||
group.add(rb);
|
group.add(rb);
|
||||||
add(rb, BorderLayout.NORTH);
|
add(rb, BorderLayout.NORTH);
|
||||||
|
@ -25,6 +25,8 @@ import javax.swing.border.Border;
|
|||||||
import javax.swing.border.TitledBorder;
|
import javax.swing.border.TitledBorder;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import ghidra.app.merge.util.ConflictUtility;
|
import ghidra.app.merge.util.ConflictUtility;
|
||||||
@ -547,7 +549,7 @@ public class VariousChoicesPanel extends ConflictPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MyRadioButton extends JRadioButton {
|
private class MyRadioButton extends GRadioButton {
|
||||||
private final static long serialVersionUID = 1;
|
private final static long serialVersionUID = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -592,7 +594,7 @@ public class VariousChoicesPanel extends ConflictPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MyCheckBox extends JCheckBox {
|
private class MyCheckBox extends GCheckBox {
|
||||||
private final static long serialVersionUID = 1;
|
private final static long serialVersionUID = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,6 +24,7 @@ import javax.swing.border.Border;
|
|||||||
import javax.swing.border.TitledBorder;
|
import javax.swing.border.TitledBorder;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
@ -105,7 +106,7 @@ public class VerticalChoicesPanel extends ConflictPanel {
|
|||||||
add(rowPanel, BorderLayout.CENTER);
|
add(rowPanel, BorderLayout.CENTER);
|
||||||
rowPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
rowPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||||
|
|
||||||
JRadioButton rb = new JRadioButton();
|
GRadioButton rb = new GRadioButton();
|
||||||
JCheckBox cb = new GCheckBox();
|
JCheckBox cb = new GCheckBox();
|
||||||
indent = Math.max(rb.getPreferredSize().width, cb.getPreferredSize().width);
|
indent = Math.max(rb.getPreferredSize().width, cb.getPreferredSize().width);
|
||||||
|
|
||||||
@ -504,7 +505,7 @@ public class VerticalChoicesPanel extends ConflictPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MyRadioButton extends JRadioButton {
|
private class MyRadioButton extends GRadioButton {
|
||||||
private final static long serialVersionUID = 1;
|
private final static long serialVersionUID = 1;
|
||||||
private int option;
|
private int option;
|
||||||
|
|
||||||
@ -560,7 +561,7 @@ public class VerticalChoicesPanel extends ConflictPanel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MyCheckBox extends JCheckBox {
|
private class MyCheckBox extends GCheckBox {
|
||||||
private final static long serialVersionUID = 1;
|
private final static long serialVersionUID = 1;
|
||||||
private int option;
|
private int option;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -22,6 +21,8 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Panel to show radio buttons to choose a name or a set of permissions
|
* Panel to show radio buttons to choose a name or a set of permissions
|
||||||
* for a memory block, or to resolve the conflict for the image base
|
* for a memory block, or to resolve the conflict for the image base
|
||||||
@ -89,6 +90,7 @@ class BlockConflictPanel extends JPanel {
|
|||||||
group = new ButtonGroup();
|
group = new ButtonGroup();
|
||||||
|
|
||||||
ItemListener itemListener = new ItemListener() {
|
ItemListener itemListener = new ItemListener() {
|
||||||
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
if (e.getStateChange() == ItemEvent.SELECTED) {
|
if (e.getStateChange() == ItemEvent.SELECTED) {
|
||||||
listener.stateChanged(null);
|
listener.stateChanged(null);
|
||||||
@ -96,13 +98,13 @@ class BlockConflictPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
latestRB = new JRadioButton("Latest");
|
latestRB = new GRadioButton("Latest");
|
||||||
latestRB.setName(MemoryMergePanel.LATEST_BUTTON_NAME);
|
latestRB.setName(MemoryMergePanel.LATEST_BUTTON_NAME);
|
||||||
latestRB.addItemListener(itemListener);
|
latestRB.addItemListener(itemListener);
|
||||||
myRB = new JRadioButton("My");
|
myRB = new GRadioButton("My");
|
||||||
myRB.addItemListener(itemListener);
|
myRB.addItemListener(itemListener);
|
||||||
myRB.setName(MemoryMergePanel.MY_BUTTON_NAME);
|
myRB.setName(MemoryMergePanel.MY_BUTTON_NAME);
|
||||||
originalRB = new JRadioButton("Original");
|
originalRB = new GRadioButton("Original");
|
||||||
originalRB.addItemListener(itemListener);
|
originalRB.addItemListener(itemListener);
|
||||||
originalRB.setName(MemoryMergePanel.ORIGINAL_BUTTON_NAME);
|
originalRB.setName(MemoryMergePanel.ORIGINAL_BUTTON_NAME);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -16,15 +15,16 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.merge.memory;
|
package ghidra.app.merge.memory;
|
||||||
|
|
||||||
import ghidra.app.merge.MergeConstants;
|
|
||||||
import ghidra.util.layout.PairLayout;
|
|
||||||
|
|
||||||
import java.awt.event.ItemEvent;
|
import java.awt.event.ItemEvent;
|
||||||
import java.awt.event.ItemListener;
|
import java.awt.event.ItemListener;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
|
import ghidra.app.merge.MergeConstants;
|
||||||
|
import ghidra.util.layout.PairLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Panel that shows the block comments; has radio buttons to choose
|
* Panel that shows the block comments; has radio buttons to choose
|
||||||
* which comment to use.
|
* which comment to use.
|
||||||
@ -123,8 +123,9 @@ class CommentsConflictPanel extends JPanel {
|
|||||||
case MergeConstants.ORIGINAL:
|
case MergeConstants.ORIGINAL:
|
||||||
str = MergeConstants.ORIGINAL_TITLE;
|
str = MergeConstants.ORIGINAL_TITLE;
|
||||||
}
|
}
|
||||||
JRadioButton rb = new JRadioButton("Use comments from " + str);
|
GRadioButton rb = new GRadioButton("Use comments from " + str);
|
||||||
rb.addItemListener(new ItemListener() {
|
rb.addItemListener(new ItemListener() {
|
||||||
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
if (e.getStateChange() == ItemEvent.SELECTED) {
|
if (e.getStateChange() == ItemEvent.SELECTED) {
|
||||||
listener.stateChanged(null);
|
listener.stateChanged(null);
|
||||||
|
@ -22,6 +22,7 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import ghidra.app.merge.MergeConstants;
|
import ghidra.app.merge.MergeConstants;
|
||||||
@ -140,9 +141,9 @@ class ConflictPanel extends JPanel {
|
|||||||
namePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 10, 5));
|
namePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 10, 5));
|
||||||
namePanel.add(propertyGroupLabel);
|
namePanel.add(propertyGroupLabel);
|
||||||
|
|
||||||
latestRB = new JRadioButton("Use " + MergeConstants.LATEST_TITLE);
|
latestRB = new GRadioButton("Use " + MergeConstants.LATEST_TITLE);
|
||||||
myRB = new JRadioButton("Use " + MergeConstants.MY_TITLE);
|
myRB = new GRadioButton("Use " + MergeConstants.MY_TITLE);
|
||||||
originalRB = new JRadioButton("Use " + MergeConstants.ORIGINAL_TITLE);
|
originalRB = new GRadioButton("Use " + MergeConstants.ORIGINAL_TITLE);
|
||||||
|
|
||||||
latestRB.setName(LATEST_BUTTON_NAME);
|
latestRB.setName(LATEST_BUTTON_NAME);
|
||||||
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
myRB.setName(CHECKED_OUT_BUTTON_NAME);
|
||||||
|
@ -24,6 +24,7 @@ import javax.swing.event.ChangeEvent;
|
|||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
import docking.widgets.EmptyBorderButton;
|
import docking.widgets.EmptyBorderButton;
|
||||||
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.fieldpanel.FieldPanel;
|
import docking.widgets.fieldpanel.FieldPanel;
|
||||||
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
|
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
|
||||||
import docking.widgets.fieldpanel.support.BackgroundColorModel;
|
import docking.widgets.fieldpanel.support.BackgroundColorModel;
|
||||||
@ -607,7 +608,7 @@ public class ListingMergePanel extends JPanel
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LockComponent extends JCheckBox {
|
class LockComponent extends GCheckBox {
|
||||||
private static final Icon lock = ResourceManager.loadImage("images/lock.gif");
|
private static final Icon lock = ResourceManager.loadImage("images/lock.gif");
|
||||||
private static final Icon unlock = ResourceManager.loadImage("images/unlock.gif");
|
private static final Icon unlock = ResourceManager.loadImage("images/unlock.gif");
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import docking.widgets.label.GIconLabel;
|
import docking.widgets.label.GIconLabel;
|
||||||
import ghidra.app.merge.MergeConstants;
|
import ghidra.app.merge.MergeConstants;
|
||||||
@ -134,9 +135,9 @@ class NameConflictsPanel extends JPanel {
|
|||||||
iconPanel.add(conflictsLabel);
|
iconPanel.add(conflictsLabel);
|
||||||
iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
|
iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
|
||||||
|
|
||||||
keepOtherRB = new JRadioButton("Keep 'Other' Name");
|
keepOtherRB = new GRadioButton("Keep 'Other' Name");
|
||||||
addOrRenameRB = new JRadioButton("Rename 'My' name to My.username");
|
addOrRenameRB = new GRadioButton("Rename 'My' name to My.username");
|
||||||
originalRB = new JRadioButton("Use 'Original' name");
|
originalRB = new GRadioButton("Use 'Original' name");
|
||||||
|
|
||||||
keepOtherRB.setName(ProgramTreeMergePanel.KEEP_OTHER_BUTTON_NAME);
|
keepOtherRB.setName(ProgramTreeMergePanel.KEEP_OTHER_BUTTON_NAME);
|
||||||
addOrRenameRB.setName(ProgramTreeMergePanel.RENAME_PRIVATE_BUTTON_NAME);
|
addOrRenameRB.setName(ProgramTreeMergePanel.RENAME_PRIVATE_BUTTON_NAME);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -16,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.merge.tree;
|
package ghidra.app.merge.tree;
|
||||||
|
|
||||||
import ghidra.app.merge.MergeConstants;
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.event.ItemEvent;
|
import java.awt.event.ItemEvent;
|
||||||
import java.awt.event.ItemListener;
|
import java.awt.event.ItemListener;
|
||||||
@ -25,6 +22,9 @@ import java.awt.event.ItemListener;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
|
import ghidra.app.merge.MergeConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Panel for resolving name conflicts among program trees when private
|
* Panel for resolving name conflicts among program trees when private
|
||||||
* name of tree does not exist in destination program.
|
* name of tree does not exist in destination program.
|
||||||
@ -88,10 +88,10 @@ class NamePanel extends JPanel {
|
|||||||
panel.setLayout(new BorderLayout());
|
panel.setLayout(new BorderLayout());
|
||||||
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
||||||
|
|
||||||
keepOtherRB = new JRadioButton("Keep 'Other' Name");
|
keepOtherRB = new GRadioButton("Keep 'Other' Name");
|
||||||
keepMyRB = new JRadioButton("Keep 'My' Name");
|
keepMyRB = new GRadioButton("Keep 'My' Name");
|
||||||
newTreeRB = new JRadioButton("Add New Tree");
|
newTreeRB = new GRadioButton("Add New Tree");
|
||||||
originalRB = new JRadioButton("Use Original Name");
|
originalRB = new GRadioButton("Use Original Name");
|
||||||
|
|
||||||
keepOtherRB.setName(ProgramTreeMergePanel.KEEP_OTHER_BUTTON_NAME);
|
keepOtherRB.setName(ProgramTreeMergePanel.KEEP_OTHER_BUTTON_NAME);
|
||||||
keepMyRB.setName(ProgramTreeMergePanel.KEEP_PRIVATE_BUTTON_NAME);
|
keepMyRB.setName(ProgramTreeMergePanel.KEEP_PRIVATE_BUTTON_NAME);
|
||||||
@ -112,6 +112,7 @@ class NamePanel extends JPanel {
|
|||||||
|
|
||||||
add(panel);
|
add(panel);
|
||||||
ItemListener itemListener = new ItemListener() {
|
ItemListener itemListener = new ItemListener() {
|
||||||
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.stateChanged(null);
|
listener.stateChanged(null);
|
||||||
|
@ -27,6 +27,7 @@ import javax.swing.text.Document;
|
|||||||
|
|
||||||
import docking.ToolTipManager;
|
import docking.ToolTipManager;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import ghidra.program.model.data.Category;
|
import ghidra.program.model.data.Category;
|
||||||
@ -332,9 +333,9 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupMinimumAlignment() {
|
private void setupMinimumAlignment() {
|
||||||
defaultMinAlignButton = new JRadioButton("none ");
|
defaultMinAlignButton = new GRadioButton("none ");
|
||||||
machineMinAlignButton = new JRadioButton("machine ");
|
machineMinAlignButton = new GRadioButton("machine ");
|
||||||
byValueMinAlignButton = new JRadioButton();
|
byValueMinAlignButton = new GRadioButton();
|
||||||
minAlignValueTextField = new JTextField();
|
minAlignValueTextField = new JTextField();
|
||||||
setupDefaultMinAlignButton();
|
setupDefaultMinAlignButton();
|
||||||
setupMachineMinAlignButton();
|
setupMachineMinAlignButton();
|
||||||
@ -519,8 +520,8 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupPacking() {
|
private void setupPacking() {
|
||||||
noPackingButton = new JRadioButton("none ");
|
noPackingButton = new GRadioButton("none ");
|
||||||
byValuePackingButton = new JRadioButton();
|
byValuePackingButton = new GRadioButton();
|
||||||
packingValueTextField = new JTextField();
|
packingValueTextField = new JTextField();
|
||||||
setupNoPackingButton();
|
setupNoPackingButton();
|
||||||
setupByValuePackingButton();
|
setupByValuePackingButton();
|
||||||
|
@ -29,6 +29,7 @@ import javax.swing.text.BadLocationException;
|
|||||||
import javax.swing.text.Document;
|
import javax.swing.text.Document;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.table.*;
|
import docking.widgets.table.*;
|
||||||
import ghidra.app.services.DataTypeManagerService;
|
import ghidra.app.services.DataTypeManagerService;
|
||||||
import ghidra.app.util.ToolTipUtils;
|
import ghidra.app.util.ToolTipUtils;
|
||||||
@ -245,8 +246,8 @@ public class CreateStructureDialog extends DialogComponentProvider {
|
|||||||
matchingStylePanel.setBorder(
|
matchingStylePanel.setBorder(
|
||||||
new TitledBorder(BorderFactory.createEmptyBorder(), "Matching: "));
|
new TitledBorder(BorderFactory.createEmptyBorder(), "Matching: "));
|
||||||
|
|
||||||
exactMatchButton = new JRadioButton("Exact");
|
exactMatchButton = new GRadioButton("Exact");
|
||||||
sizeMatchButton = new JRadioButton("Size");
|
sizeMatchButton = new GRadioButton("Size");
|
||||||
|
|
||||||
exactMatchButton.setToolTipText(
|
exactMatchButton.setToolTipText(
|
||||||
"Match structures with the same " + "number and type of data elements");
|
"Match structures with the same " + "number and type of data elements");
|
||||||
|
@ -21,6 +21,7 @@ import java.awt.event.*;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GIconLabel;
|
import docking.widgets.label.GIconLabel;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
@ -119,9 +120,9 @@ public class ConflictDialog extends DialogComponentProvider {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ButtonGroup bg = new ButtonGroup();
|
ButtonGroup bg = new ButtonGroup();
|
||||||
renameRB = new JRadioButton("Rename new data type to " + newDTName, true);
|
renameRB = new GRadioButton("Rename new data type to " + newDTName, true);
|
||||||
replaceRB = new JRadioButton("Replace existing data type");
|
replaceRB = new GRadioButton("Replace existing data type");
|
||||||
useExistingRB = new JRadioButton("Use existing data type");
|
useExistingRB = new GRadioButton("Use existing data type");
|
||||||
|
|
||||||
renameRB.addItemListener(listener);
|
renameRB.addItemListener(listener);
|
||||||
useExistingRB.addItemListener(listener);
|
useExistingRB.addItemListener(listener);
|
||||||
|
@ -26,6 +26,7 @@ import javax.swing.*;
|
|||||||
import docking.*;
|
import docking.*;
|
||||||
import docking.action.ToggleDockingAction;
|
import docking.action.ToggleDockingAction;
|
||||||
import docking.action.ToolBarData;
|
import docking.action.ToolBarData;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GHtmlCheckBox;
|
import docking.widgets.checkbox.GHtmlCheckBox;
|
||||||
import docking.widgets.combobox.GhidraComboBox;
|
import docking.widgets.combobox.GhidraComboBox;
|
||||||
import docking.widgets.filter.FilterListener;
|
import docking.widgets.filter.FilterListener;
|
||||||
@ -243,11 +244,11 @@ class FilterAction extends ToggleDockingAction {
|
|||||||
|
|
||||||
JPanel enablePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
|
JPanel enablePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
|
||||||
ButtonGroup group = new ButtonGroup();
|
ButtonGroup group = new ButtonGroup();
|
||||||
enableButton = new JRadioButton("Enabled", true);
|
enableButton = new GRadioButton("Enabled", true);
|
||||||
enableButton.addKeyListener(listener);
|
enableButton.addKeyListener(listener);
|
||||||
enablePanel.add(enableButton);
|
enablePanel.add(enableButton);
|
||||||
group.add(enableButton);
|
group.add(enableButton);
|
||||||
disableButton = new JRadioButton("Disabled", false);
|
disableButton = new GRadioButton("Disabled", false);
|
||||||
disableButton.addKeyListener(listener);
|
disableButton.addKeyListener(listener);
|
||||||
enablePanel.add(disableButton);
|
enablePanel.add(disableButton);
|
||||||
group.add(disableButton);
|
group.add(disableButton);
|
||||||
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import ghidra.app.util.bean.FixedBitSizeValueField;
|
import ghidra.app.util.bean.FixedBitSizeValueField;
|
||||||
import ghidra.program.model.lang.Register;
|
import ghidra.program.model.lang.Register;
|
||||||
@ -77,8 +78,8 @@ public class ProcessorStateDialog extends DialogComponentProvider {
|
|||||||
mainPanel.add(scrollPane, BorderLayout.CENTER);
|
mainPanel.add(scrollPane, BorderLayout.CENTER);
|
||||||
JPanel radioPanel = new JPanel(new FlowLayout());
|
JPanel radioPanel = new JPanel(new FlowLayout());
|
||||||
mainPanel.add(radioPanel, BorderLayout.SOUTH);
|
mainPanel.add(radioPanel, BorderLayout.SOUTH);
|
||||||
JRadioButton hexButton = new JRadioButton("Hex");
|
GRadioButton hexButton = new GRadioButton("Hex");
|
||||||
JRadioButton decimalButton = new JRadioButton("Decimal");
|
GRadioButton decimalButton = new GRadioButton("Decimal");
|
||||||
hexButton.setSelected(true);
|
hexButton.setSelected(true);
|
||||||
ButtonGroup group = new ButtonGroup();
|
ButtonGroup group = new ButtonGroup();
|
||||||
group.add(hexButton);
|
group.add(hexButton);
|
||||||
|
@ -27,6 +27,7 @@ import javax.swing.event.ChangeListener;
|
|||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
import docking.ToolTipManager;
|
import docking.ToolTipManager;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import ghidra.app.util.AddressInput;
|
import ghidra.app.util.AddressInput;
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
@ -231,7 +232,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
|
|||||||
panel.setLayout(bl);
|
panel.setLayout(bl);
|
||||||
|
|
||||||
ButtonGroup group = new ButtonGroup();
|
ButtonGroup group = new ButtonGroup();
|
||||||
defaultRB = new JRadioButton("Default", true);
|
defaultRB = new GRadioButton("Default", true);
|
||||||
defaultRB.addActionListener(new ActionListener() {
|
defaultRB.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
@ -240,7 +241,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
|
|||||||
});
|
});
|
||||||
ToolTipManager.setToolTipText(defaultRB, "Use default fallthrough address");
|
ToolTipManager.setToolTipText(defaultRB, "Use default fallthrough address");
|
||||||
|
|
||||||
userRB = new JRadioButton("User", false);
|
userRB = new GRadioButton("User", false);
|
||||||
userRB.addActionListener(new ActionListener() {
|
userRB.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
|
@ -20,6 +20,8 @@ import java.awt.event.ActionEvent;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the user to define a custom search range for the {@link InstructionSearchDialog}.
|
* Allows the user to define a custom search range for the {@link InstructionSearchDialog}.
|
||||||
*
|
*
|
||||||
@ -126,7 +128,7 @@ public class SearchDirectionWidget extends ControlPanelWidget {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private JRadioButton createSearchRB(AbstractAction action, String name, String tooltip) {
|
private JRadioButton createSearchRB(AbstractAction action, String name, String tooltip) {
|
||||||
JRadioButton button = new JRadioButton(action);
|
GRadioButton button = new GRadioButton(action);
|
||||||
button.setText(name);
|
button.setText(name);
|
||||||
button.setToolTipText(tooltip);
|
button.setToolTipText(tooltip);
|
||||||
button.setAlignmentX(Component.LEFT_ALIGNMENT);
|
button.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import ghidra.app.plugin.core.instructionsearch.util.InstructionSearchUtils;
|
import ghidra.app.plugin.core.instructionsearch.util.InstructionSearchUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,8 +60,8 @@ public class SelectionModeWidget extends ControlPanelWidget {
|
|||||||
@Override
|
@Override
|
||||||
protected JPanel createContent() {
|
protected JPanel createContent() {
|
||||||
JPanel rbPanel = new JPanel();
|
JPanel rbPanel = new JPanel();
|
||||||
hexRB = new JRadioButton("hex");
|
hexRB = new GRadioButton("hex");
|
||||||
binaryRB = new JRadioButton("binary");
|
binaryRB = new GRadioButton("binary");
|
||||||
ButtonGroup inputGroup = new ButtonGroup();
|
ButtonGroup inputGroup = new ButtonGroup();
|
||||||
inputGroup.add(hexRB);
|
inputGroup.add(hexRB);
|
||||||
inputGroup.add(binaryRB);
|
inputGroup.add(binaryRB);
|
||||||
@ -93,15 +94,17 @@ public class SelectionModeWidget extends ControlPanelWidget {
|
|||||||
// 1. Get the whitespace map so we can restore it after conversion.
|
// 1. Get the whitespace map so we can restore it after conversion.
|
||||||
// 2. Get the group map so we can group bytes just as in the hex display.
|
// 2. Get the group map so we can group bytes just as in the hex display.
|
||||||
// 3. Convert and display.
|
// 3. Convert and display.
|
||||||
List<String> whitespaces = InstructionSearchUtils.getWhitespace(parent.getInputString().trim());
|
List<String> whitespaces =
|
||||||
|
InstructionSearchUtils.getWhitespace(parent.getInputString().trim());
|
||||||
|
|
||||||
List<Integer> groups;
|
List<Integer> groups;
|
||||||
try {
|
try {
|
||||||
groups =
|
groups = InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(),
|
||||||
InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(), InputMode.BINARY);
|
InputMode.BINARY);
|
||||||
|
|
||||||
// Now convert whatever is in the input box to binary.
|
// Now convert whatever is in the input box to binary.
|
||||||
String hexStr = InstructionSearchUtils.toHex(parent.getInputString().trim(), true);
|
String hexStr =
|
||||||
|
InstructionSearchUtils.toHex(parent.getInputString().trim(), true);
|
||||||
|
|
||||||
// Restore grouping.
|
// Restore grouping.
|
||||||
hexStr =
|
hexStr =
|
||||||
@ -139,15 +142,17 @@ public class SelectionModeWidget extends ControlPanelWidget {
|
|||||||
// 1. Get the whitespace map so we can restore it after conversion.
|
// 1. Get the whitespace map so we can restore it after conversion.
|
||||||
// 2. Get the group map so we can group bytes just as in the hex display.
|
// 2. Get the group map so we can group bytes just as in the hex display.
|
||||||
// 3. Convert and display.
|
// 3. Convert and display.
|
||||||
List<String> whitespaces = InstructionSearchUtils.getWhitespace(parent.getInputString().trim());
|
List<String> whitespaces =
|
||||||
|
InstructionSearchUtils.getWhitespace(parent.getInputString().trim());
|
||||||
|
|
||||||
List<Integer> groups;
|
List<Integer> groups;
|
||||||
try {
|
try {
|
||||||
groups =
|
groups = InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(),
|
||||||
InstructionSearchUtils.getGroupSizes(parent.getInputString().trim(), InputMode.HEX);
|
InputMode.HEX);
|
||||||
|
|
||||||
// Now convert whatever is in the input box to binary.
|
// Now convert whatever is in the input box to binary.
|
||||||
String binaryStr = InstructionSearchUtils.toBinary(parent.getInputString().trim());
|
String binaryStr =
|
||||||
|
InstructionSearchUtils.toBinary(parent.getInputString().trim());
|
||||||
|
|
||||||
// Restore grouping.
|
// Restore grouping.
|
||||||
binaryStr = restoreGroupingAndWhitespace(binaryStr, groups, whitespaces,
|
binaryStr = restoreGroupingAndWhitespace(binaryStr, groups, whitespaces,
|
||||||
@ -176,9 +181,9 @@ public class SelectionModeWidget extends ControlPanelWidget {
|
|||||||
inputMode = InputMode.HEX;
|
inputMode = InputMode.HEX;
|
||||||
}
|
}
|
||||||
else if (binaryRB.isSelected()) {
|
else if (binaryRB.isSelected()) {
|
||||||
inputMode = InputMode.BINARY;
|
inputMode = InputMode.BINARY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return inputMode;
|
return inputMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import ghidra.app.plugin.core.instructionsearch.InstructionSearchPlugin;
|
import ghidra.app.plugin.core.instructionsearch.InstructionSearchPlugin;
|
||||||
import ghidra.program.model.address.AddressRange;
|
import ghidra.program.model.address.AddressRange;
|
||||||
import ghidra.program.model.address.AddressRangeIterator;
|
import ghidra.program.model.address.AddressRangeIterator;
|
||||||
@ -36,7 +37,7 @@ public class SelectionScopeWidget extends ControlPanelWidget {
|
|||||||
private JRadioButton searchSelectionRB;
|
private JRadioButton searchSelectionRB;
|
||||||
|
|
||||||
// Stores the current search range settings.
|
// Stores the current search range settings.
|
||||||
private List<AddressRange> searchRanges = new ArrayList<AddressRange>();
|
private List<AddressRange> searchRanges = new ArrayList<>();
|
||||||
|
|
||||||
private InstructionSearchDialog dialog;
|
private InstructionSearchDialog dialog;
|
||||||
private InstructionSearchPlugin plugin;
|
private InstructionSearchPlugin plugin;
|
||||||
@ -183,7 +184,7 @@ public class SelectionScopeWidget extends ControlPanelWidget {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private JRadioButton createSearchRB(AbstractAction action, String name, String tooltip) {
|
private JRadioButton createSearchRB(AbstractAction action, String name, String tooltip) {
|
||||||
JRadioButton button = new JRadioButton(action);
|
GRadioButton button = new GRadioButton(action);
|
||||||
button.setName(name);
|
button.setName(name);
|
||||||
button.setText(name);
|
button.setText(name);
|
||||||
button.setToolTipText(tooltip);
|
button.setToolTipText(tooltip);
|
||||||
|
@ -22,6 +22,7 @@ import javax.swing.*;
|
|||||||
import javax.swing.event.*;
|
import javax.swing.event.*;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
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;
|
||||||
@ -379,11 +380,11 @@ class AddBlockDialog extends DialogComponentProvider implements ChangeListener {
|
|||||||
panel.setLayout(bl);
|
panel.setLayout(bl);
|
||||||
|
|
||||||
ButtonGroup radioGroup = new ButtonGroup();
|
ButtonGroup radioGroup = new ButtonGroup();
|
||||||
initializedRB = new JRadioButton("Initialized", false);
|
initializedRB = new GRadioButton("Initialized", false);
|
||||||
initializedRB.setName(initializedRB.getText());
|
initializedRB.setName(initializedRB.getText());
|
||||||
initializedRB.addActionListener(ev -> initializeRBChanged());
|
initializedRB.addActionListener(ev -> initializeRBChanged());
|
||||||
|
|
||||||
uninitializedRB = new JRadioButton("Uninitialized", true);
|
uninitializedRB = new GRadioButton("Uninitialized", true);
|
||||||
uninitializedRB.setName(uninitializedRB.getText());
|
uninitializedRB.setName(uninitializedRB.getText());
|
||||||
uninitializedRB.addActionListener(ev -> uninitializedRBChanged());
|
uninitializedRB.addActionListener(ev -> uninitializedRBChanged());
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import java.awt.event.*;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
|
|
||||||
@ -85,16 +86,16 @@ public class PrintOptionsDialog extends DialogComponentProvider {
|
|||||||
|
|
||||||
group = new ButtonGroup();
|
group = new ButtonGroup();
|
||||||
|
|
||||||
selection = new JRadioButton("Selected area(s)");
|
selection = new GRadioButton("Selected area(s)");
|
||||||
selection.addKeyListener(key);
|
selection.addKeyListener(key);
|
||||||
rangePanel.add(selection);
|
rangePanel.add(selection);
|
||||||
group.add(selection);
|
group.add(selection);
|
||||||
selection.setEnabled(selectionEnabled);
|
selection.setEnabled(selectionEnabled);
|
||||||
visible = new JRadioButton("Code visible on screen");
|
visible = new GRadioButton("Code visible on screen");
|
||||||
visible.addKeyListener(key);
|
visible.addKeyListener(key);
|
||||||
rangePanel.add(visible);
|
rangePanel.add(visible);
|
||||||
group.add(visible);
|
group.add(visible);
|
||||||
view = new JRadioButton("Current view");
|
view = new GRadioButton("Current view");
|
||||||
view.addKeyListener(key);
|
view.addKeyListener(key);
|
||||||
rangePanel.add(view);
|
rangePanel.add(view);
|
||||||
group.add(view);
|
group.add(view);
|
||||||
|
@ -15,15 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.references;
|
package ghidra.app.plugin.core.references;
|
||||||
|
|
||||||
import ghidra.framework.options.SaveState;
|
|
||||||
import ghidra.program.model.address.Address;
|
|
||||||
import ghidra.program.model.address.AddressSetView;
|
|
||||||
import ghidra.program.model.listing.CodeUnit;
|
|
||||||
import ghidra.program.model.listing.Program;
|
|
||||||
import ghidra.program.model.symbol.Reference;
|
|
||||||
import ghidra.util.HelpLocation;
|
|
||||||
import ghidra.util.exception.AssertException;
|
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@ -34,6 +25,15 @@ import javax.swing.event.ChangeListener;
|
|||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
|
import ghidra.framework.options.SaveState;
|
||||||
|
import ghidra.program.model.address.Address;
|
||||||
|
import ghidra.program.model.address.AddressSetView;
|
||||||
|
import ghidra.program.model.listing.CodeUnit;
|
||||||
|
import ghidra.program.model.listing.Program;
|
||||||
|
import ghidra.program.model.symbol.Reference;
|
||||||
|
import ghidra.util.HelpLocation;
|
||||||
|
import ghidra.util.exception.AssertException;
|
||||||
|
|
||||||
public class EditReferenceDialog extends DialogComponentProvider {
|
public class EditReferenceDialog extends DialogComponentProvider {
|
||||||
|
|
||||||
@ -98,26 +98,24 @@ public class EditReferenceDialog extends DialogComponentProvider {
|
|||||||
|
|
||||||
JPanel topPanel = new JPanel(new BorderLayout());
|
JPanel topPanel = new JPanel(new BorderLayout());
|
||||||
|
|
||||||
instrPanel =
|
instrPanel = new InstructionPanel(5, 5, 5, 5, null, plugin, new InstructionPanelListener() {
|
||||||
new InstructionPanel(5, 5, 5, 5, null, plugin,
|
@Override
|
||||||
new InstructionPanelListener() {
|
public boolean dropSupported() {
|
||||||
@Override
|
return false;
|
||||||
public boolean dropSupported() {
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operandSelected(int opIndex, int subIndex) {
|
public void operandSelected(int opIndex, int subIndex) {
|
||||||
if (!initializing) {
|
if (!initializing) {
|
||||||
setAddOpIndex(opIndex, subIndex);
|
setAddOpIndex(opIndex, subIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectionDropped(AddressSetView set, CodeUnit cu, int opIndex) {
|
public void selectionDropped(AddressSetView set, CodeUnit cu, int opIndex) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
topPanel.add(instrPanel, BorderLayout.NORTH);
|
topPanel.add(instrPanel, BorderLayout.NORTH);
|
||||||
|
|
||||||
JPanel refTypePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
|
JPanel refTypePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
|
||||||
@ -135,13 +133,13 @@ public class EditReferenceDialog extends DialogComponentProvider {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
memRefChoice = new JRadioButton("Memory");
|
memRefChoice = new GRadioButton("Memory");
|
||||||
memRefChoice.addChangeListener(refChoiceListener);
|
memRefChoice.addChangeListener(refChoiceListener);
|
||||||
extRefChoice = new JRadioButton("External");
|
extRefChoice = new GRadioButton("External");
|
||||||
extRefChoice.addChangeListener(refChoiceListener);
|
extRefChoice.addChangeListener(refChoiceListener);
|
||||||
stackRefChoice = new JRadioButton("Stack");
|
stackRefChoice = new GRadioButton("Stack");
|
||||||
stackRefChoice.addChangeListener(refChoiceListener);
|
stackRefChoice.addChangeListener(refChoiceListener);
|
||||||
regRefChoice = new JRadioButton("Register");
|
regRefChoice = new GRadioButton("Register");
|
||||||
regRefChoice.addChangeListener(refChoiceListener);
|
regRefChoice.addChangeListener(refChoiceListener);
|
||||||
|
|
||||||
ButtonGroup refChoices = new ButtonGroup();
|
ButtonGroup refChoices = new ButtonGroup();
|
||||||
|
@ -24,6 +24,7 @@ import javax.swing.border.TitledBorder;
|
|||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
import docking.DockingWindowManager;
|
import docking.DockingWindowManager;
|
||||||
import docking.help.HelpService;
|
import docking.help.HelpService;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import docking.widgets.textfield.IntegerTextField;
|
import docking.widgets.textfield.IntegerTextField;
|
||||||
import ghidra.app.plugin.core.scalartable.RangeFilterTextField.FilterType;
|
import ghidra.app.plugin.core.scalartable.RangeFilterTextField.FilterType;
|
||||||
@ -143,8 +144,8 @@ public class ScalarSearchDialog extends DialogComponentProvider {
|
|||||||
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
||||||
panel.setBorder(new TitledBorder("Search Scope"));
|
panel.setBorder(new TitledBorder("Search Scope"));
|
||||||
|
|
||||||
searchSelectionRadioButton = new JRadioButton("Search Selection");
|
searchSelectionRadioButton = new GRadioButton("Search Selection");
|
||||||
searchAllRadioButton = new JRadioButton("Search All");
|
searchAllRadioButton = new GRadioButton("Search All");
|
||||||
|
|
||||||
searchSelectionRadioButton.setToolTipText("Search only the current selection");
|
searchSelectionRadioButton.setToolTipText("Search only the current selection");
|
||||||
searchAllRadioButton.setToolTipText("Search the entire program");
|
searchAllRadioButton.setToolTipText("Search the entire program");
|
||||||
@ -258,8 +259,8 @@ public class ScalarSearchDialog extends DialogComponentProvider {
|
|||||||
setLayout(new BorderLayout());
|
setLayout(new BorderLayout());
|
||||||
setBorder(new TitledBorder("Search Type"));
|
setBorder(new TitledBorder("Search Type"));
|
||||||
|
|
||||||
searchAllScalars = new JRadioButton("Scalars in Range:");
|
searchAllScalars = new GRadioButton("Scalars in Range:");
|
||||||
searchAScalar = new JRadioButton("Specific Scalar:");
|
searchAScalar = new GRadioButton("Specific Scalar:");
|
||||||
|
|
||||||
searchAllScalars.setToolTipText(
|
searchAllScalars.setToolTipText(
|
||||||
"Search program (or selection) for scalar operands or defined scalar data types with values in the following range:");
|
"Search program (or selection) for scalar operands or defined scalar data types with values in the following range:");
|
||||||
|
@ -15,9 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.searchmem;
|
package ghidra.app.plugin.core.searchmem;
|
||||||
|
|
||||||
import ghidra.util.HTMLUtilities;
|
|
||||||
import ghidra.util.exception.AssertException;
|
|
||||||
|
|
||||||
import java.awt.GridLayout;
|
import java.awt.GridLayout;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
@ -27,16 +24,20 @@ import javax.swing.*;
|
|||||||
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeEvent;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
|
import ghidra.util.HTMLUtilities;
|
||||||
|
import ghidra.util.exception.AssertException;
|
||||||
|
|
||||||
public class DecimalSearchFormat extends SearchFormat {
|
public class DecimalSearchFormat extends SearchFormat {
|
||||||
|
|
||||||
private static final String MINUS_SIGN = "-";
|
private static final String MINUS_SIGN = "-";
|
||||||
private static final int BYTE = 0;
|
private static final int BYTE = 0;
|
||||||
private static final int WORD = 1;
|
private static final int WORD = 1;
|
||||||
private static final int DWORD = 2;
|
private static final int DWORD = 2;
|
||||||
private static final int QWORD = 3;
|
private static final int QWORD = 3;
|
||||||
private static final int FLOAT = 4;
|
private static final int FLOAT = 4;
|
||||||
private static final int DOUBLE = 5;
|
private static final int DOUBLE = 5;
|
||||||
|
|
||||||
private int decimalFormat = WORD;
|
private int decimalFormat = WORD;
|
||||||
|
|
||||||
public DecimalSearchFormat(ChangeListener listener) {
|
public DecimalSearchFormat(ChangeListener listener) {
|
||||||
@ -44,53 +45,59 @@ public class DecimalSearchFormat extends SearchFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getToolTip() {
|
public String getToolTip() {
|
||||||
return HTMLUtilities.toHTML(
|
return HTMLUtilities.toHTML(
|
||||||
"Interpret values as a sequence of\n"+
|
"Interpret values as a sequence of\n" + "decimal numbers, separated by spaces");
|
||||||
"decimal numbers, separated by spaces");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDecimalFormat(int format) {
|
private void setDecimalFormat(int format) {
|
||||||
decimalFormat = format;
|
decimalFormat = format;
|
||||||
changeListener.stateChanged(new ChangeEvent(this));
|
changeListener.stateChanged(new ChangeEvent(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JPanel getOptionsPanel() {
|
public JPanel getOptionsPanel() {
|
||||||
ButtonGroup decimalGroup = new ButtonGroup();
|
ButtonGroup decimalGroup = new ButtonGroup();
|
||||||
|
|
||||||
JRadioButton decimalByte = new JRadioButton("Byte", false);
|
GRadioButton decimalByte = new GRadioButton("Byte", false);
|
||||||
JRadioButton decimalWord = new JRadioButton("Word", true);
|
GRadioButton decimalWord = new GRadioButton("Word", true);
|
||||||
JRadioButton decimalDWord = new JRadioButton("DWord", false);
|
GRadioButton decimalDWord = new GRadioButton("DWord", false);
|
||||||
JRadioButton decimalQWord = new JRadioButton("QWord", false);
|
GRadioButton decimalQWord = new GRadioButton("QWord", false);
|
||||||
JRadioButton decimalFloat = new JRadioButton("Float", false);
|
GRadioButton decimalFloat = new GRadioButton("Float", false);
|
||||||
JRadioButton decimalDouble = new JRadioButton("Double", false);
|
GRadioButton decimalDouble = new GRadioButton("Double", false);
|
||||||
|
|
||||||
decimalByte.addActionListener(new ActionListener() {
|
decimalByte.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
setDecimalFormat(BYTE);
|
setDecimalFormat(BYTE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
decimalWord.addActionListener(new ActionListener() {
|
decimalWord.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
setDecimalFormat(WORD);
|
setDecimalFormat(WORD);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
decimalDWord.addActionListener(new ActionListener() {
|
decimalDWord.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
setDecimalFormat(DWORD);
|
setDecimalFormat(DWORD);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
decimalQWord.addActionListener(new ActionListener() {
|
decimalQWord.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
setDecimalFormat(QWORD);
|
setDecimalFormat(QWORD);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
decimalFloat.addActionListener(new ActionListener() {
|
decimalFloat.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
setDecimalFormat(FLOAT);
|
setDecimalFormat(FLOAT);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
decimalDouble.addActionListener(new ActionListener() {
|
decimalDouble.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
public void actionPerformed(ActionEvent ev) {
|
public void actionPerformed(ActionEvent ev) {
|
||||||
setDecimalFormat(DOUBLE);
|
setDecimalFormat(DOUBLE);
|
||||||
}
|
}
|
||||||
@ -111,35 +118,37 @@ public class DecimalSearchFormat extends SearchFormat {
|
|||||||
decimalOptionsPanel.add(decimalQWord);
|
decimalOptionsPanel.add(decimalQWord);
|
||||||
decimalOptionsPanel.add(decimalFloat);
|
decimalOptionsPanel.add(decimalFloat);
|
||||||
decimalOptionsPanel.add(decimalDouble);
|
decimalOptionsPanel.add(decimalDouble);
|
||||||
decimalOptionsPanel.setBorder(BorderFactory
|
decimalOptionsPanel.setBorder(BorderFactory.createTitledBorder("Format Options"));
|
||||||
.createTitledBorder("Format Options"));
|
|
||||||
|
|
||||||
return decimalOptionsPanel;
|
return decimalOptionsPanel;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SearchData getSearchData( String input ) {
|
public SearchData getSearchData(String input) {
|
||||||
List<Byte> bytesList = new ArrayList<Byte>();
|
List<Byte> bytesList = new ArrayList<>();
|
||||||
StringTokenizer tokenizer = new StringTokenizer(input);
|
StringTokenizer tokenizer = new StringTokenizer(input);
|
||||||
while (tokenizer.hasMoreTokens()) {
|
while (tokenizer.hasMoreTokens()) {
|
||||||
String tok = tokenizer.nextToken();
|
String tok = tokenizer.nextToken();
|
||||||
if (tok.equals(MINUS_SIGN)) {
|
if (tok.equals(MINUS_SIGN)) {
|
||||||
if ( !input.endsWith(MINUS_SIGN) ) {
|
if (!input.endsWith(MINUS_SIGN)) {
|
||||||
return SearchData.createInvalidInputSearchData( "Cannot have space after a '-'" );
|
return SearchData.createInvalidInputSearchData("Cannot have space after a '-'");
|
||||||
}
|
}
|
||||||
return SearchData.createIncompleteSearchData( "" );
|
return SearchData.createIncompleteSearchData("");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
bytesList.addAll(getBytes(tok));
|
bytesList.addAll(getBytes(tok));
|
||||||
} catch (NumberFormatException ex) {
|
}
|
||||||
return SearchData.createInvalidInputSearchData("");
|
catch (NumberFormatException ex) {
|
||||||
} catch ( RuntimeException re ) {
|
return SearchData.createInvalidInputSearchData("");
|
||||||
return SearchData.createInvalidInputSearchData(re.getMessage());
|
}
|
||||||
}
|
catch (RuntimeException re) {
|
||||||
}
|
return SearchData.createInvalidInputSearchData(re.getMessage());
|
||||||
return SearchData.createSearchData( input, getDataBytes(bytesList), null );
|
}
|
||||||
|
}
|
||||||
|
return SearchData.createSearchData(input, getDataBytes(bytesList), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] getDataBytes(List<Byte> bytesList) {
|
private byte[] getDataBytes(List<Byte> bytesList) {
|
||||||
byte[] bytes = new byte[bytesList.size()];
|
byte[] bytes = new byte[bytesList.size()];
|
||||||
for (int i = 0; i < bytes.length; i++) {
|
for (int i = 0; i < bytes.length; i++) {
|
||||||
@ -149,10 +158,10 @@ public class DecimalSearchFormat extends SearchFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<Byte> getBytes(long value, int n) {
|
private List<Byte> getBytes(long value, int n) {
|
||||||
List<Byte> list = new ArrayList<Byte>();
|
List<Byte> list = new ArrayList<>();
|
||||||
|
|
||||||
for(int i=0;i<n;i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
byte b = (byte)value;
|
byte b = (byte) value;
|
||||||
list.add(new Byte(b));
|
list.add(new Byte(b));
|
||||||
value >>= 8;
|
value >>= 8;
|
||||||
}
|
}
|
||||||
@ -161,68 +170,66 @@ public class DecimalSearchFormat extends SearchFormat {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkValue(long value, long min, long max) {
|
|
||||||
if ( value < min || value > max ) {
|
|
||||||
// I know, icky
|
|
||||||
throw new RuntimeException( "Number must be in the range [" + min + "," + max + "]" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Byte> getBytes(String tok) {
|
|
||||||
switch(decimalFormat) {
|
|
||||||
case BYTE:
|
|
||||||
long value = Short.parseShort(tok);
|
|
||||||
checkValue( value, Byte.MIN_VALUE, 255 );
|
|
||||||
return getBytes(value, 1);
|
|
||||||
case WORD:
|
|
||||||
value = Integer.parseInt(tok);
|
|
||||||
checkValue( value, Short.MIN_VALUE, 65535 );
|
|
||||||
return getBytes(value, 2);
|
|
||||||
case DWORD:
|
|
||||||
value = Long.parseLong(tok);
|
|
||||||
checkValue( value, Integer.MIN_VALUE, 4294967295l );
|
|
||||||
return getBytes(value, 4);
|
|
||||||
case QWORD:
|
|
||||||
value = Long.parseLong(tok);
|
|
||||||
return getBytes(value, 8);
|
|
||||||
case FLOAT:
|
|
||||||
tok = preProcessFloat(tok);
|
|
||||||
float floatValue = Float.parseFloat(tok);
|
|
||||||
value = Float.floatToIntBits(floatValue);
|
|
||||||
return getBytes(value, 4);
|
|
||||||
case DOUBLE:
|
|
||||||
tok = preProcessFloat(tok);
|
|
||||||
double dvalue = Double.parseDouble(tok);
|
|
||||||
value = Double.doubleToLongBits(dvalue);
|
|
||||||
return getBytes(value, 8);
|
|
||||||
default:
|
|
||||||
throw new AssertException("Unexpected format type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks for parsable characters that we don't want to allow (dDfF) and removes
|
|
||||||
* the start of an exponent expression (example 2.34e would become 2.34. So woudl 2.34-)
|
|
||||||
* @param the string that will be parsed into a float or double
|
|
||||||
* @return the parsable string
|
|
||||||
* @exception NumberFormatException thrown if the the tok contains any of "dDfF".
|
|
||||||
*/
|
|
||||||
private String preProcessFloat(String tok) {
|
|
||||||
if ((tok.indexOf('d') >= 0) ||
|
|
||||||
(tok.indexOf('D') >= 0) ||
|
|
||||||
(tok.indexOf('F') >= 0) ||
|
|
||||||
(tok.indexOf('f') >= 0)) {
|
|
||||||
throw new NumberFormatException();
|
|
||||||
}
|
|
||||||
if (tok.endsWith("E") || tok.endsWith("e")) {
|
|
||||||
tok = tok.substring(0,tok.length()-1);
|
|
||||||
}
|
|
||||||
if (tok.endsWith("E-") || tok.endsWith("e-")) {
|
|
||||||
tok = tok.substring(0,tok.length()-2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tok;
|
private void checkValue(long value, long min, long max) {
|
||||||
}
|
if (value < min || value > max) {
|
||||||
|
// I know, icky
|
||||||
|
throw new RuntimeException("Number must be in the range [" + min + "," + max + "]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Byte> getBytes(String tok) {
|
||||||
|
switch (decimalFormat) {
|
||||||
|
case BYTE:
|
||||||
|
long value = Short.parseShort(tok);
|
||||||
|
checkValue(value, Byte.MIN_VALUE, 255);
|
||||||
|
return getBytes(value, 1);
|
||||||
|
case WORD:
|
||||||
|
value = Integer.parseInt(tok);
|
||||||
|
checkValue(value, Short.MIN_VALUE, 65535);
|
||||||
|
return getBytes(value, 2);
|
||||||
|
case DWORD:
|
||||||
|
value = Long.parseLong(tok);
|
||||||
|
checkValue(value, Integer.MIN_VALUE, 4294967295l);
|
||||||
|
return getBytes(value, 4);
|
||||||
|
case QWORD:
|
||||||
|
value = Long.parseLong(tok);
|
||||||
|
return getBytes(value, 8);
|
||||||
|
case FLOAT:
|
||||||
|
tok = preProcessFloat(tok);
|
||||||
|
float floatValue = Float.parseFloat(tok);
|
||||||
|
value = Float.floatToIntBits(floatValue);
|
||||||
|
return getBytes(value, 4);
|
||||||
|
case DOUBLE:
|
||||||
|
tok = preProcessFloat(tok);
|
||||||
|
double dvalue = Double.parseDouble(tok);
|
||||||
|
value = Double.doubleToLongBits(dvalue);
|
||||||
|
return getBytes(value, 8);
|
||||||
|
default:
|
||||||
|
throw new AssertException("Unexpected format type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks for parsable characters that we don't want to allow (dDfF) and removes
|
||||||
|
* the start of an exponent expression (example 2.34e would become 2.34. So woudl 2.34-)
|
||||||
|
* @param the string that will be parsed into a float or double
|
||||||
|
* @return the parsable string
|
||||||
|
* @exception NumberFormatException thrown if the the tok contains any of "dDfF".
|
||||||
|
*/
|
||||||
|
private String preProcessFloat(String tok) {
|
||||||
|
if ((tok.indexOf('d') >= 0) || (tok.indexOf('D') >= 0) || (tok.indexOf('F') >= 0) ||
|
||||||
|
(tok.indexOf('f') >= 0)) {
|
||||||
|
throw new NumberFormatException();
|
||||||
|
}
|
||||||
|
if (tok.endsWith("E") || tok.endsWith("e")) {
|
||||||
|
tok = tok.substring(0, tok.length() - 1);
|
||||||
|
}
|
||||||
|
if (tok.endsWith("E-") || tok.endsWith("e-")) {
|
||||||
|
tok = tok.substring(0, tok.length() - 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tok;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import javax.swing.event.ChangeListener;
|
|||||||
import javax.swing.text.*;
|
import javax.swing.text.*;
|
||||||
|
|
||||||
import docking.*;
|
import docking.*;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
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;
|
||||||
@ -396,8 +397,8 @@ class MemSearchDialog extends DialogComponentProvider {
|
|||||||
|
|
||||||
private Container buildEndienessPanel() {
|
private Container buildEndienessPanel() {
|
||||||
ButtonGroup endianGroup = new ButtonGroup();
|
ButtonGroup endianGroup = new ButtonGroup();
|
||||||
littleEndian = new JRadioButton("Little Endian", true);
|
littleEndian = new GRadioButton("Little Endian", true);
|
||||||
bigEndian = new JRadioButton("Big Endian", false);
|
bigEndian = new GRadioButton("Big Endian", false);
|
||||||
endianGroup.add(bigEndian);
|
endianGroup.add(bigEndian);
|
||||||
endianGroup.add(littleEndian);
|
endianGroup.add(littleEndian);
|
||||||
|
|
||||||
@ -450,8 +451,8 @@ class MemSearchDialog extends DialogComponentProvider {
|
|||||||
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
||||||
panel.setBorder(new TitledBorder("Selection Scope"));
|
panel.setBorder(new TitledBorder("Selection Scope"));
|
||||||
|
|
||||||
searchSelectionRadioButton = new JRadioButton("Search Selection");
|
searchSelectionRadioButton = new GRadioButton("Search Selection");
|
||||||
searchAllRadioButton = new JRadioButton("Search All");
|
searchAllRadioButton = new GRadioButton("Search All");
|
||||||
|
|
||||||
ButtonGroup buttonGroup = new ButtonGroup();
|
ButtonGroup buttonGroup = new ButtonGroup();
|
||||||
buttonGroup.add(searchSelectionRadioButton);
|
buttonGroup.add(searchSelectionRadioButton);
|
||||||
@ -497,7 +498,7 @@ class MemSearchDialog extends DialogComponentProvider {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (SearchFormat element : allFormats) {
|
for (SearchFormat element : allFormats) {
|
||||||
JRadioButton formatButton = new JRadioButton(element.getName(), true);
|
GRadioButton formatButton = new GRadioButton(element.getName(), true);
|
||||||
formatButton.setToolTipText(element.getToolTip());
|
formatButton.setToolTipText(element.getToolTip());
|
||||||
|
|
||||||
formatGroup.add(formatButton);
|
formatGroup.add(formatButton);
|
||||||
@ -574,8 +575,8 @@ class MemSearchDialog extends DialogComponentProvider {
|
|||||||
*/
|
*/
|
||||||
private JPanel buildExtrasPanel() {
|
private JPanel buildExtrasPanel() {
|
||||||
ButtonGroup memoryBlockGroup = new ButtonGroup();
|
ButtonGroup memoryBlockGroup = new ButtonGroup();
|
||||||
loadedBlocks = new JRadioButton("Loaded Blocks", true);
|
loadedBlocks = new GRadioButton("Loaded Blocks", true);
|
||||||
allBlocks = new JRadioButton("All Blocks", false);
|
allBlocks = new GRadioButton("All Blocks", false);
|
||||||
memoryBlockGroup.add(loadedBlocks);
|
memoryBlockGroup.add(loadedBlocks);
|
||||||
memoryBlockGroup.add(allBlocks);
|
memoryBlockGroup.add(allBlocks);
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import javax.swing.border.Border;
|
|||||||
import javax.swing.text.*;
|
import javax.swing.text.*;
|
||||||
|
|
||||||
import docking.*;
|
import docking.*;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.combobox.GhidraComboBox;
|
import docking.widgets.combobox.GhidraComboBox;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
@ -345,14 +346,14 @@ class SearchTextDialog extends DialogComponentProvider {
|
|||||||
JPanel radioPanel = new JPanel(new VerticalLayout(10));
|
JPanel radioPanel = new JPanel(new VerticalLayout(10));
|
||||||
|
|
||||||
ButtonGroup bg = new ButtonGroup();
|
ButtonGroup bg = new ButtonGroup();
|
||||||
searchFieldRB = new JRadioButton("Selected Fields", true);
|
searchFieldRB = new GRadioButton("Selected Fields", true);
|
||||||
searchFieldRB.setToolTipText(HTMLUtilities.toHTML("Search for specific fields. Use the\n" +
|
searchFieldRB.setToolTipText(HTMLUtilities.toHTML("Search for specific fields. Use the\n" +
|
||||||
"checkboxes to mark which fields to search.\n" +
|
"checkboxes to mark which fields to search.\n" +
|
||||||
"This option applies to either the Program Database Search\n" +
|
"This option applies to either the Program Database Search\n" +
|
||||||
"or the Listing Display Match Search.\n\n" +
|
"or the Listing Display Match Search.\n\n" +
|
||||||
"NOTE: Selecting all of these fields is NOT the same as selecting \"All Fields\".\n"));
|
"NOTE: Selecting all of these fields is NOT the same as selecting \"All Fields\".\n"));
|
||||||
|
|
||||||
searchAllRB = new JRadioButton("All Fields", false);
|
searchAllRB = new GRadioButton("All Fields", false);
|
||||||
searchAllRB.setToolTipText(
|
searchAllRB.setToolTipText(
|
||||||
HTMLUtilities.toHTML("Search all the fields displayed in the Code Browser.\n" +
|
HTMLUtilities.toHTML("Search all the fields displayed in the Code Browser.\n" +
|
||||||
"The option applies only to the Listing Display Search."));
|
"The option applies only to the Listing Display Search."));
|
||||||
@ -389,7 +390,7 @@ class SearchTextDialog extends DialogComponentProvider {
|
|||||||
|
|
||||||
ButtonGroup bg = new ButtonGroup();
|
ButtonGroup bg = new ButtonGroup();
|
||||||
|
|
||||||
programDatabaseSearchRB = new JRadioButton("Program Database", true);
|
programDatabaseSearchRB = new GRadioButton("Program Database", true);
|
||||||
programDatabaseSearchRB.setToolTipText(HTMLUtilities.toHTML(
|
programDatabaseSearchRB.setToolTipText(HTMLUtilities.toHTML(
|
||||||
"Searches comments, labels, instructions, function signatures, and data stored in the" +
|
"Searches comments, labels, instructions, function signatures, and data stored in the" +
|
||||||
" program database.\n This search is much faster, but does not search all text displayed in the Code Browser\n" +
|
" program database.\n This search is much faster, but does not search all text displayed in the Code Browser\n" +
|
||||||
@ -406,7 +407,7 @@ class SearchTextDialog extends DialogComponentProvider {
|
|||||||
changingState = false;
|
changingState = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
listingDisplaySearchRB = new JRadioButton("Listing Display", false);
|
listingDisplaySearchRB = new GRadioButton("Listing Display", false);
|
||||||
listingDisplaySearchRB.setToolTipText(
|
listingDisplaySearchRB.setToolTipText(
|
||||||
HTMLUtilities.toHTML("Searches the text displayed in the Code Browser\n" +
|
HTMLUtilities.toHTML("Searches the text displayed in the Code Browser\n" +
|
||||||
"Listing Display. (Depending on which fields are selected)\n" +
|
"Listing Display. (Depending on which fields are selected)\n" +
|
||||||
@ -433,9 +434,9 @@ class SearchTextDialog extends DialogComponentProvider {
|
|||||||
directionPanel.setBorder(BorderFactory.createTitledBorder("Memory Block Types"));
|
directionPanel.setBorder(BorderFactory.createTitledBorder("Memory Block Types"));
|
||||||
|
|
||||||
ButtonGroup directionGroup = new ButtonGroup();
|
ButtonGroup directionGroup = new ButtonGroup();
|
||||||
loadedBlocksButton = new JRadioButton("Loaded Blocks", true);
|
loadedBlocksButton = new GRadioButton("Loaded Blocks", true);
|
||||||
|
|
||||||
allBlocksButton = new JRadioButton("All Blocks", false);
|
allBlocksButton = new GRadioButton("All Blocks", false);
|
||||||
loadedBlocksButton.setToolTipText(HTMLUtilities.toHTML(
|
loadedBlocksButton.setToolTipText(HTMLUtilities.toHTML(
|
||||||
"Only searches memory blocks that are loaded in a running executable.\n " +
|
"Only searches memory blocks that are loaded in a running executable.\n " +
|
||||||
"Ghidra now includes memory blocks for other data such as section headers.\n" +
|
"Ghidra now includes memory blocks for other data such as section headers.\n" +
|
||||||
|
@ -24,6 +24,7 @@ import javax.swing.*;
|
|||||||
|
|
||||||
import docking.ComponentProvider;
|
import docking.ComponentProvider;
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import docking.widgets.textfield.IntegerTextField;
|
import docking.widgets.textfield.IntegerTextField;
|
||||||
import ghidra.app.nav.Navigatable;
|
import ghidra.app.nav.Navigatable;
|
||||||
@ -116,7 +117,7 @@ class SelectBlockDialog extends DialogComponentProvider {
|
|||||||
gbc.insets = new Insets(2, 2, 2, 2);
|
gbc.insets = new Insets(2, 2, 2, 2);
|
||||||
gbc.anchor = GridBagConstraints.WEST;
|
gbc.anchor = GridBagConstraints.WEST;
|
||||||
|
|
||||||
forwardButton = new JRadioButton("Select Forward", true);
|
forwardButton = new GRadioButton("Select Forward", true);
|
||||||
forwardButton.setName("forwardButton");
|
forwardButton.setName("forwardButton");
|
||||||
forwardButton.addActionListener(new ActionListener() {
|
forwardButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -127,7 +128,7 @@ class SelectBlockDialog extends DialogComponentProvider {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
buttonGroup.add(forwardButton);
|
buttonGroup.add(forwardButton);
|
||||||
backwardButton = new JRadioButton("Select Backward");
|
backwardButton = new GRadioButton("Select Backward");
|
||||||
backwardButton.setName("backwardButton");
|
backwardButton.setName("backwardButton");
|
||||||
backwardButton.addActionListener(new ActionListener() {
|
backwardButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -138,7 +139,7 @@ class SelectBlockDialog extends DialogComponentProvider {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
buttonGroup.add(backwardButton);
|
buttonGroup.add(backwardButton);
|
||||||
allButton = new JRadioButton("Select All");
|
allButton = new GRadioButton("Select All");
|
||||||
allButton.setName("allButton");
|
allButton.setName("allButton");
|
||||||
allButton.addActionListener(new ActionListener() {
|
allButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -149,7 +150,7 @@ class SelectBlockDialog extends DialogComponentProvider {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonGroup.add(allButton);
|
buttonGroup.add(allButton);
|
||||||
toButton = new JRadioButton("To Address");
|
toButton = new GRadioButton("To Address");
|
||||||
toButton.setName("toButton");
|
toButton.setName("toButton");
|
||||||
toButton.addActionListener(new ActionListener() {
|
toButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -26,6 +26,7 @@ import javax.swing.border.TitledBorder;
|
|||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
import docking.options.editor.ButtonPanelFactory;
|
import docking.options.editor.ButtonPanelFactory;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.filechooser.GhidraFileChooser;
|
import docking.widgets.filechooser.GhidraFileChooser;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
@ -267,8 +268,8 @@ public class SearchStringDialog extends DialogComponentProvider {
|
|||||||
panel.setBorder(BorderFactory.createTitledBorder("Memory Block Types"));
|
panel.setBorder(BorderFactory.createTitledBorder("Memory Block Types"));
|
||||||
|
|
||||||
ButtonGroup memoryBlockGroup = new ButtonGroup();
|
ButtonGroup memoryBlockGroup = new ButtonGroup();
|
||||||
loadedBlocksRB = new JRadioButton("Loaded Blocks", true);
|
loadedBlocksRB = new GRadioButton("Loaded Blocks", true);
|
||||||
allBlocksRB = new JRadioButton("All Blocks", false);
|
allBlocksRB = new GRadioButton("All Blocks", false);
|
||||||
memoryBlockGroup.add(loadedBlocksRB);
|
memoryBlockGroup.add(loadedBlocksRB);
|
||||||
memoryBlockGroup.add(allBlocksRB);
|
memoryBlockGroup.add(allBlocksRB);
|
||||||
|
|
||||||
@ -296,8 +297,8 @@ public class SearchStringDialog extends DialogComponentProvider {
|
|||||||
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
||||||
panel.setBorder(new TitledBorder("Selection Scope"));
|
panel.setBorder(new TitledBorder("Selection Scope"));
|
||||||
|
|
||||||
searchSelectionRB = new JRadioButton("Search Selection");
|
searchSelectionRB = new GRadioButton("Search Selection");
|
||||||
searchAllRB = new JRadioButton("Search All");
|
searchAllRB = new GRadioButton("Search All");
|
||||||
|
|
||||||
ButtonGroup buttonGroup = new ButtonGroup();
|
ButtonGroup buttonGroup = new ButtonGroup();
|
||||||
buttonGroup.add(searchSelectionRB);
|
buttonGroup.add(searchSelectionRB);
|
||||||
|
@ -28,6 +28,7 @@ import javax.swing.table.TableColumnModel;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.filter.FilterListener;
|
import docking.widgets.filter.FilterListener;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
@ -229,16 +230,16 @@ public class SetEquateDialog extends DialogComponentProvider {
|
|||||||
titleLabel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
|
titleLabel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
|
||||||
|
|
||||||
//long value = scalar.getSignedValue();
|
//long value = scalar.getSignedValue();
|
||||||
applyToCurrent = new JRadioButton("Current location", true);
|
applyToCurrent = new GRadioButton("Current location", true);
|
||||||
applyToCurrent.setName("applyToCurrent");
|
applyToCurrent.setName("applyToCurrent");
|
||||||
applyToCurrent.setToolTipText("Apply to current scalar operand only");
|
applyToCurrent.setToolTipText("Apply to current scalar operand only");
|
||||||
|
|
||||||
applyToSelection = new JRadioButton("Current selection", false);
|
applyToSelection = new GRadioButton("Current selection", false);
|
||||||
applyToSelection.setName("applyToSelection");
|
applyToSelection.setName("applyToSelection");
|
||||||
applyToSelection.setToolTipText(
|
applyToSelection.setToolTipText(
|
||||||
"Apply to all matching, defined scalar code " + "units in current selection.");
|
"Apply to all matching, defined scalar code " + "units in current selection.");
|
||||||
|
|
||||||
applyToAll = new JRadioButton("Entire program", false);
|
applyToAll = new GRadioButton("Entire program", false);
|
||||||
applyToAll.setName("applyToAll");
|
applyToAll.setName("applyToAll");
|
||||||
applyToAll.setToolTipText(
|
applyToAll.setToolTipText(
|
||||||
"Apply to all matching, defined scalar code units " + "in entire program.");
|
"Apply to all matching, defined scalar code units " + "in entire program.");
|
||||||
|
@ -21,6 +21,7 @@ import javax.swing.*;
|
|||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
|
|
||||||
import docking.widgets.*;
|
import docking.widgets.*;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import docking.widgets.textfield.IntegerTextField;
|
import docking.widgets.textfield.IntegerTextField;
|
||||||
import generic.jar.ResourceFile;
|
import generic.jar.ResourceFile;
|
||||||
@ -61,7 +62,7 @@ public class GhidraScriptSelectionDialog extends ListSelectionDialog<ResourceFil
|
|||||||
private JComponent createButtonComponent(AnalyzerType type) {
|
private JComponent createButtonComponent(AnalyzerType type) {
|
||||||
JPanel panel = new JPanel(new HorizontalLayout(1));
|
JPanel panel = new JPanel(new HorizontalLayout(1));
|
||||||
Icon icon = AnalyzerUtil.getIcon(type);
|
Icon icon = AnalyzerUtil.getIcon(type);
|
||||||
JRadioButton button = new JRadioButton();
|
GRadioButton button = new GRadioButton();
|
||||||
button.setActionCommand(type.name());
|
button.setActionCommand(type.name());
|
||||||
button.setToolTipText(type.getDescription());
|
button.setToolTipText(type.getDescription());
|
||||||
if (buttonGroup == null) {
|
if (buttonGroup == null) {
|
||||||
|
@ -20,6 +20,7 @@ import java.awt.Component;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.DockingWindowManager;
|
import docking.DockingWindowManager;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import docking.widgets.textfield.IntegerTextField;
|
import docking.widgets.textfield.IntegerTextField;
|
||||||
import ghidra.closedpatternmining.SequenceMiningParams;
|
import ghidra.closedpatternmining.SequenceMiningParams;
|
||||||
@ -97,9 +98,9 @@ public class SequenceMiningParamsInputDialog extends InputDialogComponentProvide
|
|||||||
|
|
||||||
boolean useBinary = Boolean.parseBoolean(
|
boolean useBinary = Boolean.parseBoolean(
|
||||||
Preferences.getProperty(BINARY_SEQUENCES_PROPERTY, BINARY_SEQUENCES_DEFAULT));
|
Preferences.getProperty(BINARY_SEQUENCES_PROPERTY, BINARY_SEQUENCES_DEFAULT));
|
||||||
binaryButton = new JRadioButton(BINARY_BUTTON_TEXT, useBinary);
|
binaryButton = new GRadioButton(BINARY_BUTTON_TEXT, useBinary);
|
||||||
binaryButton.setMnemonic(BINARY_MNEMONIC);
|
binaryButton.setMnemonic(BINARY_MNEMONIC);
|
||||||
nibbleButton = new JRadioButton(NIBBLE_BUTTON_TEXT, !useBinary);
|
nibbleButton = new GRadioButton(NIBBLE_BUTTON_TEXT, !useBinary);
|
||||||
nibbleButton.setMnemonic(NIBBLE_MNEMONIC);
|
nibbleButton.setMnemonic(NIBBLE_MNEMONIC);
|
||||||
mainPanel.add(binaryButton);
|
mainPanel.add(binaryButton);
|
||||||
mainPanel.add(nibbleButton);
|
mainPanel.add(nibbleButton);
|
||||||
|
@ -400,10 +400,9 @@ public class VTMarkupItemsTableProvider extends ComponentProviderAdapter
|
|||||||
JComponent nameFilterPanel = createTextFilterPanel();
|
JComponent nameFilterPanel = createTextFilterPanel();
|
||||||
parentPanel.add(nameFilterPanel, BorderLayout.CENTER);
|
parentPanel.add(nameFilterPanel, BorderLayout.CENTER);
|
||||||
|
|
||||||
ancillaryFilterButton = new JButton();
|
ancillaryFilterButton = new JButton(FILTER_ICON);
|
||||||
ancillaryFilterButton.addActionListener(
|
ancillaryFilterButton.addActionListener(
|
||||||
e -> tool.showDialog(ancillaryFilterDialog, component));
|
e -> tool.showDialog(ancillaryFilterDialog, component));
|
||||||
ancillaryFilterButton.setIcon(FILTER_ICON);
|
|
||||||
ancillaryFilterButton.setToolTipText("Filters Dialog");
|
ancillaryFilterButton.setToolTipText("Filters Dialog");
|
||||||
|
|
||||||
parentPanel.add(ancillaryFilterButton, BorderLayout.EAST);
|
parentPanel.add(ancillaryFilterButton, BorderLayout.EAST);
|
||||||
|
@ -28,6 +28,7 @@ import javax.swing.border.TitledBorder;
|
|||||||
|
|
||||||
import docking.DockingWindowManager;
|
import docking.DockingWindowManager;
|
||||||
import docking.help.HelpService;
|
import docking.help.HelpService;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.combobox.GComboBox;
|
import docking.widgets.combobox.GComboBox;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
@ -843,7 +844,7 @@ public class ApplyMarkupPropertyEditor implements OptionsEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private JRadioButton createRadioButton(final String optionName) {
|
private JRadioButton createRadioButton(final String optionName) {
|
||||||
final JRadioButton applyRadioButton = new JRadioButton(optionName);
|
final GRadioButton applyRadioButton = new GRadioButton(optionName);
|
||||||
applyRadioButton.addActionListener(e -> changesMade(true));
|
applyRadioButton.addActionListener(e -> changesMade(true));
|
||||||
|
|
||||||
return applyRadioButton;
|
return applyRadioButton;
|
||||||
|
@ -352,10 +352,9 @@ public class VTMatchTableProvider extends ComponentProviderAdapter
|
|||||||
JComponent lengthFilterPanel = createLengthFilterPanel();
|
JComponent lengthFilterPanel = createLengthFilterPanel();
|
||||||
innerPanel.add(lengthFilterPanel);
|
innerPanel.add(lengthFilterPanel);
|
||||||
|
|
||||||
ancillaryFilterButton = new JButton();
|
ancillaryFilterButton = new JButton(UNFILTERED_ICON);
|
||||||
ancillaryFilterButton.addActionListener(
|
ancillaryFilterButton.addActionListener(
|
||||||
e -> tool.showDialog(ancillaryFilterDialog, component));
|
e -> tool.showDialog(ancillaryFilterDialog, component));
|
||||||
ancillaryFilterButton.setIcon(UNFILTERED_ICON);
|
|
||||||
ancillaryFilterButton.setToolTipText("Filters Dialog");
|
ancillaryFilterButton.setToolTipText("Filters Dialog");
|
||||||
HelpService helpService = DockingWindowManager.getHelpService();
|
HelpService helpService = DockingWindowManager.getHelpService();
|
||||||
HelpLocation filterHelpLocation =
|
HelpLocation filterHelpLocation =
|
||||||
|
@ -25,6 +25,7 @@ import javax.swing.*;
|
|||||||
import javax.swing.event.*;
|
import javax.swing.event.*;
|
||||||
|
|
||||||
import docking.DockingUtils;
|
import docking.DockingUtils;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
import ghidra.program.model.address.*;
|
import ghidra.program.model.address.*;
|
||||||
@ -119,9 +120,9 @@ public class ChooseAddressSetEditorPanel extends JPanel {
|
|||||||
JPanel chooseSourcePanel = new JPanel(new VerticalLayout(5));
|
JPanel chooseSourcePanel = new JPanel(new VerticalLayout(5));
|
||||||
|
|
||||||
ButtonGroup originGroup = new ButtonGroup();
|
ButtonGroup originGroup = new ButtonGroup();
|
||||||
entireProgramButton = new JRadioButton("Use Entire " + name + " Program", false);
|
entireProgramButton = new GRadioButton("Use Entire " + name + " Program", false);
|
||||||
toolSelectionButton = new JRadioButton("Use " + name + " Tool's Selection", false);
|
toolSelectionButton = new GRadioButton("Use " + name + " Tool's Selection", false);
|
||||||
myRangesButton = new JRadioButton("Specify My Own Address Ranges", false);
|
myRangesButton = new GRadioButton("Specify My Own Address Ranges", false);
|
||||||
originGroup.add(entireProgramButton);
|
originGroup.add(entireProgramButton);
|
||||||
originGroup.add(toolSelectionButton);
|
originGroup.add(toolSelectionButton);
|
||||||
originGroup.add(myRangesButton);
|
originGroup.add(myRangesButton);
|
||||||
|
@ -27,6 +27,9 @@ import javax.swing.tree.DefaultTreeCellRenderer;
|
|||||||
import javax.swing.tree.TreeCellRenderer;
|
import javax.swing.tree.TreeCellRenderer;
|
||||||
import javax.swing.undo.UndoableEdit;
|
import javax.swing.undo.UndoableEdit;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.checkbox.GHtmlCheckBox;
|
import docking.widgets.checkbox.GHtmlCheckBox;
|
||||||
import docking.widgets.combobox.GComboBox;
|
import docking.widgets.combobox.GComboBox;
|
||||||
@ -38,7 +41,9 @@ import docking.widgets.table.GTableCellRenderer;
|
|||||||
import docking.widgets.tree.support.GTreeRenderer;
|
import docking.widgets.tree.support.GTreeRenderer;
|
||||||
import ghidra.docking.util.DockingWindowsLookAndFeelUtils;
|
import ghidra.docking.util.DockingWindowsLookAndFeelUtils;
|
||||||
import ghidra.util.HTMLUtilities;
|
import ghidra.util.HTMLUtilities;
|
||||||
|
import ghidra.util.Msg;
|
||||||
import resources.ResourceManager;
|
import resources.ResourceManager;
|
||||||
|
import utilities.util.reflection.ReflectionUtilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>Notes about how to use HTML safely:</h1>
|
* <h1>Notes about how to use HTML safely:</h1>
|
||||||
@ -87,6 +92,7 @@ import resources.ResourceManager;
|
|||||||
* <tr><td>{@link ListCellRenderer}<br>{@link DefaultListCellRenderer}</td><td>{@link GListCellRenderer}</td></tr>
|
* <tr><td>{@link ListCellRenderer}<br>{@link DefaultListCellRenderer}</td><td>{@link GListCellRenderer}</td></tr>
|
||||||
* <tr><td>{@link TableCellRenderer}</td><td>{@link GTableCellRenderer}</td></tr>
|
* <tr><td>{@link TableCellRenderer}</td><td>{@link GTableCellRenderer}</td></tr>
|
||||||
* <tr><td>{@link TreeCellRenderer}<br>{@link DefaultTreeCellRenderer}</td><td>{@link GTreeRenderer}<br>{@link DnDTreeCellRenderer}</td></tr>
|
* <tr><td>{@link TreeCellRenderer}<br>{@link DefaultTreeCellRenderer}</td><td>{@link GTreeRenderer}<br>{@link DnDTreeCellRenderer}</td></tr>
|
||||||
|
* <tr><td>{@link JRadioButton}</td><td>{@link GRadioButton}</td></tr>
|
||||||
* <tr><td>{@link JButton}</td><td>???tbd???</td></tr>
|
* <tr><td>{@link JButton}</td><td>???tbd???</td></tr>
|
||||||
* </table>
|
* </table>
|
||||||
*/
|
*/
|
||||||
@ -133,6 +139,22 @@ public class DockingUtils {
|
|||||||
return separator;
|
return separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper function that logs a warning about a string text that looks like it has HTML text.
|
||||||
|
* <p>
|
||||||
|
* Use this when working with a string in a label that has already disabled HTML rendering.
|
||||||
|
* <p>
|
||||||
|
* @param text string to test for HTML and warn about
|
||||||
|
*/
|
||||||
|
public static void warnAboutHtmlText(String text) {
|
||||||
|
// #ifdef still_finding_html_labels_in_our_huge_codebase
|
||||||
|
if (StringUtils.startsWithIgnoreCase(text, "<html>")) {
|
||||||
|
Msg.warn(GLabel.class, "HTML text detected in non-HTML component: " + text,
|
||||||
|
ReflectionUtilities.createJavaFilteredThrowable());
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns off the HTML rendering in the specified component.
|
* Turns off the HTML rendering in the specified component.
|
||||||
*
|
*
|
||||||
|
@ -142,8 +142,7 @@ public class ErrLogDialog extends DialogComponentProvider {
|
|||||||
sendButton.addActionListener(e -> sendDetails());
|
sendButton.addActionListener(e -> sendDetails());
|
||||||
|
|
||||||
detailsPanel = new ErrorDetailsPanel();
|
detailsPanel = new ErrorDetailsPanel();
|
||||||
String text = isShowingDetails ? CLOSE : DETAIL;
|
detailsButton = new JButton(isShowingDetails ? CLOSE : DETAIL);
|
||||||
detailsButton = new JButton(text);
|
|
||||||
detailsButton.addActionListener(e -> {
|
detailsButton.addActionListener(e -> {
|
||||||
String label = detailsButton.getText();
|
String label = detailsButton.getText();
|
||||||
showDetails(label.equals(DETAIL));
|
showDetails(label.equals(DETAIL));
|
||||||
|
@ -37,25 +37,21 @@ import docking.widgets.label.GDLabel;
|
|||||||
public class FontPropertyEditor extends PropertyEditorSupport {
|
public class FontPropertyEditor extends PropertyEditorSupport {
|
||||||
private Font font;
|
private Font font;
|
||||||
// private JLabel previewLabel = new GDLabel();
|
// private JLabel previewLabel = new GDLabel();
|
||||||
private JButton previewButton = new JButton();
|
|
||||||
private final static String SAMPLE_STRING = "ABCabc \u00a9\u00ab\u00a7\u0429\u05d1\u062c\u4eb9";
|
private final static String SAMPLE_STRING = "ABCabc \u00a9\u00ab\u00a7\u0429\u05d1\u062c\u4eb9";
|
||||||
|
private JButton previewButton = new JButton(SAMPLE_STRING);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default constructor.
|
* The default constructor.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public FontPropertyEditor() {
|
public FontPropertyEditor() {
|
||||||
previewButton.setText(SAMPLE_STRING);
|
|
||||||
|
|
||||||
previewButton.addActionListener(new ActionListener() {
|
previewButton.addActionListener(e -> {
|
||||||
@Override
|
// show the editor to get the user value
|
||||||
public void actionPerformed(ActionEvent e) {
|
showDialog();
|
||||||
// show the editor to get the user value
|
|
||||||
showDialog();
|
|
||||||
|
|
||||||
// now set the new value
|
// now set the new value
|
||||||
previewButton.setFont(font);
|
previewButton.setFont(font);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// previewLabel.addMouseListener( new MouseAdapter() {
|
// previewLabel.addMouseListener( new MouseAdapter() {
|
||||||
|
@ -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.GRadioButton;
|
||||||
import docking.widgets.combobox.GhidraComboBox;
|
import docking.widgets.combobox.GhidraComboBox;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
|
|
||||||
@ -63,8 +64,8 @@ public class FindDialog extends DialogComponentProvider {
|
|||||||
private JPanel buildMainPanel() {
|
private JPanel buildMainPanel() {
|
||||||
|
|
||||||
ButtonGroup formatGroup = new ButtonGroup();
|
ButtonGroup formatGroup = new ButtonGroup();
|
||||||
stringRadioButton = new JRadioButton("String", true);
|
stringRadioButton = new GRadioButton("String", true);
|
||||||
regexRadioButton = new JRadioButton("Regular Expression", false);
|
regexRadioButton = new GRadioButton("Regular Expression", false);
|
||||||
formatGroup.add(stringRadioButton);
|
formatGroup.add(stringRadioButton);
|
||||||
formatGroup.add(regexRadioButton);
|
formatGroup.add(regexRadioButton);
|
||||||
|
|
||||||
|
@ -0,0 +1,118 @@
|
|||||||
|
/* ###
|
||||||
|
* 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.*;
|
||||||
|
|
||||||
|
import docking.DockingUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link JRadioButton} that disables HTML rendering.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GRadioButton extends JRadioButton {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a blank radio button with HTML rendering disabled.
|
||||||
|
*/
|
||||||
|
public GRadioButton() {
|
||||||
|
super();
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio button with the specified icon, with HTML rendering disabled.
|
||||||
|
*
|
||||||
|
* @param icon image to display
|
||||||
|
*/
|
||||||
|
public GRadioButton(Icon icon) {
|
||||||
|
super(icon);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio button with properties taken from the specified Action, with HTML rendering
|
||||||
|
* disabled.
|
||||||
|
*
|
||||||
|
* @param a {@link Action}
|
||||||
|
*/
|
||||||
|
public GRadioButton(Action a) {
|
||||||
|
super(a);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio button with the specified icon and selected state, with HTML rendering
|
||||||
|
* disabled.
|
||||||
|
*
|
||||||
|
* @param icon image to display
|
||||||
|
* @param selected initial selection state, true means selected
|
||||||
|
*/
|
||||||
|
public GRadioButton(Icon icon, boolean selected) {
|
||||||
|
super(icon, selected);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio button with the specified text, with HTML rendering disabled.
|
||||||
|
*
|
||||||
|
* @param text string to be displayed by the label
|
||||||
|
*/
|
||||||
|
public GRadioButton(String text) {
|
||||||
|
super(text);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio button with the specified text and selected state, with HTML rendering
|
||||||
|
* disabled.
|
||||||
|
*
|
||||||
|
* @param text string to be displayed by the label
|
||||||
|
* @param selected initial selection state, true means selected
|
||||||
|
*/
|
||||||
|
public GRadioButton(String text, boolean selected) {
|
||||||
|
super(text, selected);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio button that has the specified text and icon, with HTML rendering disabled.
|
||||||
|
*
|
||||||
|
* @param text string to be displayed by the label
|
||||||
|
* @param icon image to display
|
||||||
|
*/
|
||||||
|
public GRadioButton(String text, Icon icon) {
|
||||||
|
super(text, icon);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a radio button that has the specified text, icon, and selected state, with
|
||||||
|
* HTML rendering disabled.
|
||||||
|
*
|
||||||
|
* @param text string to be displayed by the label
|
||||||
|
* @param icon image to display
|
||||||
|
* @param selected initial selection state, true means selected
|
||||||
|
*/
|
||||||
|
public GRadioButton(String text, Icon icon, boolean selected) {
|
||||||
|
super(text, icon, selected);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
DockingUtils.turnOffHTMLRendering(this);
|
||||||
|
}
|
||||||
|
}
|
@ -136,4 +136,16 @@ public class GCheckBox extends JCheckBox {
|
|||||||
DockingUtils.turnOffHTMLRendering(this);
|
DockingUtils.turnOffHTMLRendering(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See {@link JCheckBox#setText(String)}.
|
||||||
|
* <p>
|
||||||
|
* Overridden to warn about HTML text in non-HTML enabled checkbox.
|
||||||
|
*
|
||||||
|
* @param text string this label will display
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setText(String text) {
|
||||||
|
DockingUtils.warnAboutHtmlText(text);
|
||||||
|
super.setText(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import javax.swing.border.EmptyBorder;
|
|||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
import docking.DisabledComponentLayerFactory;
|
import docking.DisabledComponentLayerFactory;
|
||||||
import docking.widgets.InlineComponentTitledPanel;
|
import docking.widgets.InlineComponentTitledPanel;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.combobox.GComboBox;
|
import docking.widgets.combobox.GComboBox;
|
||||||
import docking.widgets.label.GIconLabel;
|
import docking.widgets.label.GIconLabel;
|
||||||
@ -148,10 +149,10 @@ public class FilterOptionsEditorDialog extends DialogComponentProvider {
|
|||||||
setLayout(new PairLayout(2, 2));
|
setLayout(new PairLayout(2, 2));
|
||||||
setBorder(BorderFactory.createTitledBorder("Text Filter Strategy"));
|
setBorder(BorderFactory.createTitledBorder("Text Filter Strategy"));
|
||||||
ButtonGroup buttonGroup = new ButtonGroup();
|
ButtonGroup buttonGroup = new ButtonGroup();
|
||||||
JRadioButton startsWithButton = new JRadioButton("Starts With");
|
GRadioButton startsWithButton = new GRadioButton("Starts With");
|
||||||
JRadioButton containsButton = new JRadioButton("Contains");
|
GRadioButton containsButton = new GRadioButton("Contains");
|
||||||
JRadioButton matchesExactlyButton = new JRadioButton("Matches Exactly");
|
GRadioButton matchesExactlyButton = new GRadioButton("Matches Exactly");
|
||||||
JRadioButton regularExpressionButton = new JRadioButton("Regular Expression");
|
GRadioButton regularExpressionButton = new GRadioButton("Regular Expression");
|
||||||
|
|
||||||
startsWithButton.setToolTipText(
|
startsWithButton.setToolTipText(
|
||||||
"The filter will match all entries that start with the entered filter text.");
|
"The filter will match all entries that start with the entered filter text.");
|
||||||
@ -437,7 +438,7 @@ public class FilterOptionsEditorDialog extends DialogComponentProvider {
|
|||||||
ButtonGroup modeBtnGroup = new ButtonGroup();
|
ButtonGroup modeBtnGroup = new ButtonGroup();
|
||||||
MultitermEvaluationMode[] modes = MultitermEvaluationMode.values();
|
MultitermEvaluationMode[] modes = MultitermEvaluationMode.values();
|
||||||
for (MultitermEvaluationMode mode : modes) {
|
for (MultitermEvaluationMode mode : modes) {
|
||||||
JRadioButton modeRB = new JRadioButton(mode.name());
|
GRadioButton modeRB = new GRadioButton(mode.name());
|
||||||
modeRB.setToolTipText(mode.getDescription());
|
modeRB.setToolTipText(mode.getDescription());
|
||||||
modeRB.addActionListener(e -> {
|
modeRB.addActionListener(e -> {
|
||||||
evalMode = MultitermEvaluationMode.valueOf(mode.name());
|
evalMode = MultitermEvaluationMode.valueOf(mode.name());
|
||||||
|
@ -106,7 +106,7 @@ public class GDLabel extends JLabel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setText(String text) {
|
public void setText(String text) {
|
||||||
GLabel.warnAboutHtmlText(text);
|
DockingUtils.warnAboutHtmlText(text);
|
||||||
super.setText(text);
|
super.setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,24 +155,8 @@ public class GLabel extends JLabel {
|
|||||||
ReflectionUtilities.createJavaFilteredThrowable());
|
ReflectionUtilities.createJavaFilteredThrowable());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
warnAboutHtmlText(text);
|
DockingUtils.warnAboutHtmlText(text);
|
||||||
super.setText(text);
|
super.setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper function that logs a warning about a string text that looks like it has HTML text.
|
|
||||||
* <p>
|
|
||||||
* Use this when working with a string in a label that has already disabled HTML rendering.
|
|
||||||
* <p>
|
|
||||||
* @param text string to test for HTML and warn about
|
|
||||||
*/
|
|
||||||
public static void warnAboutHtmlText(String text) {
|
|
||||||
// #ifdef still_finding_html_labels_in_our_huge_codebase
|
|
||||||
if (StringUtils.startsWithIgnoreCase(text, "<html>")) {
|
|
||||||
Msg.warn(GLabel.class, "HTML text detected in non-HTML component: " + text,
|
|
||||||
ReflectionUtilities.createJavaFilteredThrowable());
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -29,48 +28,50 @@ import javax.swing.JCheckBox;
|
|||||||
*/
|
*/
|
||||||
public class PropertyBoolean extends JCheckBox implements ItemListener {
|
public class PropertyBoolean extends JCheckBox implements ItemListener {
|
||||||
|
|
||||||
private PropertyEditor editor;
|
private PropertyEditor editor;
|
||||||
private boolean notifyEditorOfChanges = true;
|
private boolean notifyEditorOfChanges = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor new PropertyText.
|
* Constructor new PropertyText.
|
||||||
* @param pe bean property editor that is used to get the value
|
* @param pe bean property editor that is used to get the value
|
||||||
* to show in the text field
|
* to show in the text field
|
||||||
*/
|
*/
|
||||||
public PropertyBoolean(PropertyEditor pe) {
|
public PropertyBoolean(PropertyEditor pe) {
|
||||||
super();
|
super();
|
||||||
setSelected((Boolean)pe.getValue());
|
setSelected((Boolean) pe.getValue());
|
||||||
|
|
||||||
editor = pe;
|
editor = pe;
|
||||||
addItemListener( this);
|
addItemListener(this);
|
||||||
|
|
||||||
editor.addPropertyChangeListener(new PropertyChangeListener() {
|
editor.addPropertyChangeListener(new PropertyChangeListener() {
|
||||||
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
Object value = editor.getValue();
|
Object value = editor.getValue();
|
||||||
if ((value instanceof Boolean) && !value.equals(getText())) {
|
if ((value instanceof Boolean) && !value.equals(getText())) {
|
||||||
notifyEditorOfChanges = false;
|
notifyEditorOfChanges = false;
|
||||||
try {
|
try {
|
||||||
setSelected((Boolean)value);
|
setSelected((Boolean) value);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
notifyEditorOfChanges = true;
|
notifyEditorOfChanges = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
//----------------------------------------------------------------------
|
// Change listener methods.
|
||||||
// Change listener methods.
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
if (notifyEditorOfChanges) {
|
if (notifyEditorOfChanges) {
|
||||||
try {
|
try {
|
||||||
editor.setValue(isSelected() ? Boolean.TRUE : Boolean.FALSE);
|
editor.setValue(isSelected() ? Boolean.TRUE : Boolean.FALSE);
|
||||||
} catch (IllegalArgumentException ex) {
|
|
||||||
// Quietly ignore.
|
|
||||||
}
|
}
|
||||||
}
|
catch (IllegalArgumentException ex) {
|
||||||
}
|
// Quietly ignore.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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 javax.swing.*;
|
||||||
|
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.wizard.AbstractWizardJPanel;
|
import docking.wizard.AbstractWizardJPanel;
|
||||||
import docking.wizard.PanelManager;
|
import docking.wizard.PanelManager;
|
||||||
|
import ghidra.app.util.GenericHelpTopics;
|
||||||
import ghidra.app.util.*;
|
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
import ghidra.util.layout.VerticalLayout;
|
import ghidra.util.layout.VerticalLayout;
|
||||||
|
|
||||||
@ -47,29 +46,29 @@ class ProjectTypePanel extends AbstractWizardJPanel {
|
|||||||
buildPanel();
|
buildPanel();
|
||||||
setBorder(NewProjectPanelManager.EMPTY_BORDER);
|
setBorder(NewProjectPanelManager.EMPTY_BORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void buildPanel() {
|
private void buildPanel() {
|
||||||
JPanel innerPanel = new JPanel(new VerticalLayout(10));
|
JPanel innerPanel = new JPanel(new VerticalLayout(10));
|
||||||
innerPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
|
innerPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
|
||||||
ItemListener listener = new ItemListener() {
|
ItemListener listener = new ItemListener() {
|
||||||
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
panelManager.getWizardManager().validityChanged();
|
panelManager.getWizardManager().validityChanged();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
nonSharedRB = new JRadioButton("Non-Shared Project", true);
|
nonSharedRB = new GRadioButton("Non-Shared Project", true);
|
||||||
nonSharedRB.addItemListener(listener);
|
nonSharedRB.addItemListener(listener);
|
||||||
nonSharedRB.setToolTipText("Create a project that is not shared with others");
|
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.addItemListener(listener);
|
||||||
sharedRB.setToolTipText("Create a project that can be shared with others");
|
sharedRB.setToolTipText("Create a project that can be shared with others");
|
||||||
|
|
||||||
buttonGroup = new ButtonGroup();
|
buttonGroup = new ButtonGroup();
|
||||||
buttonGroup.add(nonSharedRB);
|
buttonGroup.add(nonSharedRB);
|
||||||
buttonGroup.add(sharedRB);
|
buttonGroup.add(sharedRB);
|
||||||
|
|
||||||
innerPanel.add(nonSharedRB);
|
innerPanel.add(nonSharedRB);
|
||||||
innerPanel.add(sharedRB);
|
innerPanel.add(sharedRB);
|
||||||
JPanel outerPanel = new JPanel();
|
JPanel outerPanel = new JPanel();
|
||||||
@ -77,17 +76,19 @@ class ProjectTypePanel extends AbstractWizardJPanel {
|
|||||||
outerPanel.add(innerPanel);
|
outerPanel.add(innerPanel);
|
||||||
add(outerPanel);
|
add(outerPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see ghidra.util.bean.wizard.WizardPanel#getTitle()
|
* @see ghidra.util.bean.wizard.WizardPanel#getTitle()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return "Select Project Type";
|
return "Select Project Type";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see ghidra.util.bean.wizard.WizardPanel#initialize()
|
* @see ghidra.util.bean.wizard.WizardPanel#initialize()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
buttonGroup.remove(sharedRB);
|
buttonGroup.remove(sharedRB);
|
||||||
buttonGroup.remove(nonSharedRB);
|
buttonGroup.remove(nonSharedRB);
|
||||||
@ -96,22 +97,23 @@ class ProjectTypePanel extends AbstractWizardJPanel {
|
|||||||
buttonGroup.add(nonSharedRB);
|
buttonGroup.add(nonSharedRB);
|
||||||
buttonGroup.add(sharedRB);
|
buttonGroup.add(sharedRB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the user has entered a valid project file
|
* Return true if the user has entered a valid project file
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isValidInformation() {
|
public boolean isValidInformation() {
|
||||||
return sharedRB.isSelected() || nonSharedRB.isSelected();
|
return sharedRB.isSelected() || nonSharedRB.isSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see ghidra.util.bean.wizard.WizardPanel#getHelpLocation()
|
* @see ghidra.util.bean.wizard.WizardPanel#getHelpLocation()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public HelpLocation getHelpLocation() {
|
public HelpLocation getHelpLocation() {
|
||||||
return new HelpLocation(GenericHelpTopics.FRONT_END, "SelectProjectType");
|
return new HelpLocation(GenericHelpTopics.FRONT_END, "SelectProjectType");
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isSharedProject() {
|
boolean isSharedProject() {
|
||||||
return sharedRB.isSelected();
|
return sharedRB.isSelected();
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import javax.swing.event.*;
|
|||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
import docking.DockingUtils;
|
import docking.DockingUtils;
|
||||||
|
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;
|
||||||
import ghidra.framework.client.*;
|
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.setSelected(true);
|
||||||
serverInfoChoice.addChangeListener(choiceListener);
|
serverInfoChoice.addChangeListener(choiceListener);
|
||||||
radioButtonPanel.add(serverInfoChoice);
|
radioButtonPanel.add(serverInfoChoice);
|
||||||
|
|
||||||
urlChoice = new JRadioButton("Ghidra URL");
|
urlChoice = new GRadioButton("Ghidra URL");
|
||||||
urlChoice.addChangeListener(choiceListener);
|
urlChoice.addChangeListener(choiceListener);
|
||||||
radioButtonPanel.add(urlChoice);
|
radioButtonPanel.add(urlChoice);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import javax.swing.*;
|
|||||||
import javax.swing.event.*;
|
import javax.swing.event.*;
|
||||||
|
|
||||||
import docking.DockingUtils;
|
import docking.DockingUtils;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import docking.wizard.*;
|
import docking.wizard.*;
|
||||||
import ghidra.app.util.GenericHelpTopics;
|
import ghidra.app.util.GenericHelpTopics;
|
||||||
@ -147,7 +148,7 @@ public class RepositoryPanel extends AbstractWizardJPanel {
|
|||||||
private JPanel createListPanel(String[] repositoryNames) {
|
private JPanel createListPanel(String[] repositoryNames) {
|
||||||
JPanel panel = new JPanel(new VerticalLayout(5));
|
JPanel panel = new JPanel(new VerticalLayout(5));
|
||||||
panel.setBorder(BorderFactory.createTitledBorder("Choose Existing Repository"));
|
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);
|
existingRepButton.setEnabled(repositoryNames.length > 0);
|
||||||
buttonGroup.add(existingRepButton);
|
buttonGroup.add(existingRepButton);
|
||||||
|
|
||||||
@ -177,7 +178,7 @@ public class RepositoryPanel extends AbstractWizardJPanel {
|
|||||||
namePanel.setLayout(new VerticalLayout(5));
|
namePanel.setLayout(new VerticalLayout(5));
|
||||||
namePanel.setBorder(BorderFactory.createTitledBorder("Create Repository"));
|
namePanel.setBorder(BorderFactory.createTitledBorder("Create Repository"));
|
||||||
|
|
||||||
createRepButton = new JRadioButton("Create Repository", !existingRepButton.isSelected());
|
createRepButton = new GRadioButton("Create Repository", !existingRepButton.isSelected());
|
||||||
buttonGroup.add(createRepButton);
|
buttonGroup.add(createRepButton);
|
||||||
|
|
||||||
nameLabel = new GDLabel("Repository Name:", SwingConstants.RIGHT);
|
nameLabel = new GDLabel("Repository Name:", SwingConstants.RIGHT);
|
||||||
|
@ -25,6 +25,7 @@ import javax.swing.*;
|
|||||||
|
|
||||||
import docking.DialogComponentProvider;
|
import docking.DialogComponentProvider;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.label.GHtmlLabel;
|
import docking.widgets.label.GHtmlLabel;
|
||||||
import ghidra.framework.model.Tool;
|
import ghidra.framework.model.Tool;
|
||||||
import ghidra.util.HTMLUtilities;
|
import ghidra.util.HTMLUtilities;
|
||||||
@ -75,7 +76,7 @@ public class SelectChangedToolDialog extends DialogComponentProvider {
|
|||||||
|
|
||||||
ButtonGroup buttonGroup = new ButtonGroup();
|
ButtonGroup buttonGroup = new ButtonGroup();
|
||||||
|
|
||||||
JRadioButton noneButton = new JRadioButton("None");
|
GRadioButton noneButton = new GRadioButton("None");
|
||||||
ItemListener listener = new ItemListener() {
|
ItemListener listener = new ItemListener() {
|
||||||
@Override
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
@ -87,7 +88,7 @@ public class SelectChangedToolDialog extends DialogComponentProvider {
|
|||||||
panel.add(noneButton);
|
panel.add(noneButton);
|
||||||
|
|
||||||
for (final Tool tool : toolList) {
|
for (final Tool tool : toolList) {
|
||||||
JRadioButton radioButton = new JRadioButton(tool.getName());
|
GRadioButton radioButton = new GRadioButton(tool.getName());
|
||||||
radioButton.addItemListener(new ItemListener() {
|
radioButton.addItemListener(new ItemListener() {
|
||||||
@Override
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
|
@ -23,6 +23,7 @@ import java.io.IOException;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.framework.DockingApplicationConfiguration;
|
import docking.framework.DockingApplicationConfiguration;
|
||||||
|
import docking.widgets.button.GRadioButton;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import generic.concurrent.GThreadPool;
|
import generic.concurrent.GThreadPool;
|
||||||
import ghidra.GhidraApplicationLayout;
|
import ghidra.GhidraApplicationLayout;
|
||||||
@ -69,10 +70,10 @@ public class TaskSimulator {
|
|||||||
JButton addGroupButton = new JButton("Add Group");
|
JButton addGroupButton = new JButton("Add Group");
|
||||||
JButton addTaskButton = new JButton("Add Task");
|
JButton addTaskButton = new JButton("Add Task");
|
||||||
JButton showResultsButton = new JButton("Show Results");
|
JButton showResultsButton = new JButton("Show Results");
|
||||||
lowButton = new JRadioButton("Low");
|
lowButton = new GRadioButton("Low");
|
||||||
mediumButton = new JRadioButton("Medium");
|
mediumButton = new GRadioButton("Medium");
|
||||||
highButton = new JRadioButton("High");
|
highButton = new GRadioButton("High");
|
||||||
urgentButton = new JRadioButton("Urgent");
|
urgentButton = new GRadioButton("Urgent");
|
||||||
ButtonGroup group = new ButtonGroup();
|
ButtonGroup group = new ButtonGroup();
|
||||||
group.add(lowButton);
|
group.add(lowButton);
|
||||||
group.add(mediumButton);
|
group.add(mediumButton);
|
||||||
|
Loading…
Reference in New Issue
Block a user