mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GT-2698 refactor UI elements to lock down HTML rendering
This commit is contained in:
parent
a03c96d37b
commit
e0c25b0590
360 changed files with 3895 additions and 4563 deletions
|
@ -449,6 +449,11 @@ public abstract class ByteViewerComponentProvider extends ComponentProviderAdapt
|
|||
return panel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the status info on the tool.
|
||||
*
|
||||
* @param message non-html text to display
|
||||
*/
|
||||
void setStatusMessage(String message) {
|
||||
plugin.setStatusMessage(message, this);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import javax.swing.event.ChangeEvent;
|
|||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.DockingUtils;
|
||||
import ghidra.app.plugin.core.format.ByteBlockSelection;
|
||||
import ghidra.app.plugin.core.format.DataFormatModel;
|
||||
import ghidra.app.util.AddressInput;
|
||||
|
@ -72,8 +73,7 @@ public class ByteViewerOptionsDialog extends DialogComponentProvider
|
|||
private Component buildSettingsPanel() {
|
||||
JPanel panel = new JPanel(new PairLayout(5, 5));
|
||||
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
||||
JLabel label = new JLabel("Alignment Address:");
|
||||
panel.add(label);
|
||||
panel.add(DockingUtils.createNonHtmlLabel("Alignment Address:"));
|
||||
|
||||
if (provider instanceof ProgramByteViewerComponentProvider) {
|
||||
Program program = ((ProgramByteViewerComponentProvider) provider).getProgram();
|
||||
|
@ -87,8 +87,7 @@ public class ByteViewerOptionsDialog extends DialogComponentProvider
|
|||
}
|
||||
}
|
||||
|
||||
label = new JLabel("Bytes Per Line:");
|
||||
panel.add(label);
|
||||
panel.add(DockingUtils.createNonHtmlLabel("Bytes Per Line:"));
|
||||
bytesPerLineField = new FixedBitSizeValueField(8, false, true);
|
||||
bytesPerLineField.setFormat(10, false);
|
||||
bytesPerLineField.setMinMax(BigInteger.valueOf(1), BigInteger.valueOf(256));
|
||||
|
@ -96,8 +95,7 @@ public class ByteViewerOptionsDialog extends DialogComponentProvider
|
|||
panel.add(bytesPerLineField);
|
||||
bytesPerLineField.addChangeListener(this);
|
||||
|
||||
label = new JLabel("Group size (Hex View Only):");
|
||||
panel.add(label);
|
||||
panel.add(DockingUtils.createNonHtmlLabel("Group size (Hex View Only):"));
|
||||
groupSizeField = new FixedBitSizeValueField(8, false, true);
|
||||
groupSizeField.setFormat(10, false);
|
||||
groupSizeField.setMinMax(BigInteger.valueOf(1), BigInteger.valueOf(256));
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.List;
|
|||
import javax.swing.*;
|
||||
import javax.swing.event.*;
|
||||
|
||||
import docking.DockingUtils;
|
||||
import docking.help.Help;
|
||||
import docking.help.HelpService;
|
||||
import docking.widgets.fieldpanel.*;
|
||||
|
@ -824,21 +825,21 @@ public class ByteViewerPanel extends JPanel implements TableColumnModelListener,
|
|||
|
||||
private JPanel createStatusPanel() {
|
||||
|
||||
JLabel startLabel = new JLabel("Start:", SwingConstants.RIGHT);
|
||||
JLabel endLabel = new JLabel("End:", SwingConstants.RIGHT);
|
||||
JLabel offsetLabel = new JLabel("Offset:", SwingConstants.RIGHT);
|
||||
JLabel insertionLabel = new JLabel("Insertion:", SwingConstants.RIGHT);
|
||||
JLabel startLabel = DockingUtils.createNonHtmlLabel("Start:", SwingConstants.RIGHT);
|
||||
JLabel endLabel = DockingUtils.createNonHtmlLabel("End:", SwingConstants.RIGHT);
|
||||
JLabel offsetLabel = DockingUtils.createNonHtmlLabel("Offset:", SwingConstants.RIGHT);
|
||||
JLabel insertionLabel = DockingUtils.createNonHtmlLabel("Insertion:", SwingConstants.RIGHT);
|
||||
|
||||
startField = new JLabel("00000000");
|
||||
startField = DockingUtils.createNonHtmlLabel("00000000");
|
||||
startField.setName("Start");
|
||||
|
||||
endField = new JLabel("00000000");
|
||||
endField = DockingUtils.createNonHtmlLabel("00000000");
|
||||
endField.setName("End");
|
||||
|
||||
offsetField = new JLabel("00000000");
|
||||
offsetField = DockingUtils.createNonHtmlLabel("00000000");
|
||||
offsetField.setName("Offset");
|
||||
|
||||
insertionField = new JLabel("00000000");
|
||||
insertionField = DockingUtils.createNonHtmlLabel("00000000");
|
||||
insertionField.setName("Insertion");
|
||||
|
||||
Font f = new Font("SansSerif", Font.PLAIN, 11);
|
||||
|
@ -1030,6 +1031,11 @@ public class ByteViewerPanel extends JPanel implements TableColumnModelListener,
|
|||
return viewList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the status info on the tool.
|
||||
*
|
||||
* @param message non-html text to display
|
||||
*/
|
||||
void setStatusMessage(String message) {
|
||||
provider.setStatusMessage(message);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,14 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.byteviewer;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.jdom.Element;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.ToolBarData;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.events.*;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
|
@ -28,16 +36,7 @@ import ghidra.program.model.listing.Program;
|
|||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.SystemUtilities;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.jdom.Element;
|
||||
|
||||
import resources.ResourceManager;
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.ToolBarData;
|
||||
|
||||
/**
|
||||
* Visible Plugin to show ByteBlock data in various formats.
|
||||
|
@ -69,7 +68,7 @@ public class ByteViewerPlugin extends Plugin {
|
|||
private ProgramByteViewerComponentProvider connectedProvider;
|
||||
|
||||
private List<ProgramByteViewerComponentProvider> disconnectedProviders =
|
||||
new ArrayList<ProgramByteViewerComponentProvider>();
|
||||
new ArrayList<>();
|
||||
|
||||
public ByteViewerPlugin(PluginTool tool) {
|
||||
super(tool);
|
||||
|
@ -86,8 +85,8 @@ public class ByteViewerPlugin extends Plugin {
|
|||
showConnectedProvider();
|
||||
}
|
||||
};
|
||||
action.setToolBarData(new ToolBarData(ResourceManager.loadImage("images/binaryData.gif"),
|
||||
"View"));
|
||||
action.setToolBarData(
|
||||
new ToolBarData(ResourceManager.loadImage("images/binaryData.gif"), "View"));
|
||||
|
||||
action.setDescription("Display Bytes");
|
||||
action.setEnabled(true);
|
||||
|
@ -245,7 +244,7 @@ public class ByteViewerPlugin extends Plugin {
|
|||
|
||||
@Override
|
||||
public Object getUndoRedoState(DomainObject domainObject) {
|
||||
Map<Long, Object> stateMap = new HashMap<Long, Object>();
|
||||
Map<Long, Object> stateMap = new HashMap<>();
|
||||
|
||||
addUndoRedoState(stateMap, domainObject, connectedProvider);
|
||||
|
||||
|
@ -336,6 +335,9 @@ public class ByteViewerPlugin extends Plugin {
|
|||
|
||||
/**
|
||||
* Set the status info on the tool.
|
||||
*
|
||||
* @param msg non-html text to display
|
||||
* @param provider not used
|
||||
*/
|
||||
void setStatusMessage(String msg, ComponentProvider provider) {
|
||||
tool.setStatusInfo(msg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue