mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +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
|
@ -28,6 +28,7 @@ import ghidra.app.services.CodeViewerService;
|
|||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.HelpLocation;
|
||||
import resources.ResourceManager;
|
||||
|
||||
|
@ -172,9 +173,10 @@ class DiffActionManager {
|
|||
String secondName = secondProgram.getName();
|
||||
|
||||
//@formatter:off
|
||||
openCloseProgram2Action.setDescription("<html><center>Close Diff View</center><br>" +
|
||||
"Current diff: " +
|
||||
"<b>"+firstName+"</b> to <b>" +secondName+"</b>");
|
||||
openCloseProgram2Action.setDescription(
|
||||
"<html><center>Close Diff View</center><br>" +
|
||||
"Current diff: " +
|
||||
"<b>"+HTMLUtilities.friendlyEncodeHTML(firstName)+"</b> to <b>" +HTMLUtilities.friendlyEncodeHTML(secondName)+"</b>");
|
||||
//@formatter:on
|
||||
}
|
||||
|
||||
|
@ -280,9 +282,8 @@ class DiffActionManager {
|
|||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/eraser_arrow16.png");
|
||||
ignoreDiffsAction.setPopupMenuData(
|
||||
new MenuData(new String[] { "Ignore Selection and Goto Next Difference" }, icon,
|
||||
GROUP));
|
||||
ignoreDiffsAction.setPopupMenuData(new MenuData(
|
||||
new String[] { "Ignore Selection and Goto Next Difference" }, icon, GROUP));
|
||||
ignoreDiffsAction.setDescription(
|
||||
"Ignores the selected program differences and moves the cursor to the next difference.");
|
||||
ignoreDiffsAction.setToolBarData(new ToolBarData(icon, GROUP));
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Collections;
|
|||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.DockingUtils;
|
||||
import docking.WindowPosition;
|
||||
import docking.widgets.VariableHeightPanel;
|
||||
import ghidra.app.plugin.core.diff.DiffApplySettingsOptionManager.*;
|
||||
|
@ -259,12 +260,12 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
createChoices();
|
||||
VariableHeightPanel panel = new VariableHeightPanel(false, 10, 3);
|
||||
|
||||
panel.setToolTipText(
|
||||
"<HTML>" + "For each difference type, select whether to ignore, replace, or merge." +
|
||||
"<BR>  <B>Ignore</B> - don't apply this type of difference." +
|
||||
"<BR>  <B>Replace</B> - replace the difference type with the one from program 2." +
|
||||
"<BR>  <B>Merge</B> - merge the difference type from program 2 with what's there." +
|
||||
"</HTML>");
|
||||
panel.setToolTipText("<HTML>" +
|
||||
"For each difference type, select whether to ignore, replace, or merge." +
|
||||
"<BR>  <B>Ignore</B> - don't apply this type of difference." +
|
||||
"<BR>  <B>Replace</B> - replace the difference type with the one from program 2." +
|
||||
"<BR>  <B>Merge</B> - merge the difference type from program 2 with what's there." +
|
||||
"</HTML>");
|
||||
for (Choice choice : choices) {
|
||||
panel.add(choice);
|
||||
}
|
||||
|
@ -411,7 +412,7 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
if (typeName.endsWith(" Comments")) {
|
||||
typeName = "Comments, " + typeName.substring(0, typeName.length() - 9);
|
||||
}
|
||||
label = new JLabel(" " + typeName + " ");
|
||||
label = DockingUtils.createNonHtmlLabel(" " + typeName + " ");
|
||||
label.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||
add(applyCB, BorderLayout.EAST);
|
||||
add(label, BorderLayout.CENTER);
|
||||
|
@ -459,7 +460,7 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
protected void init() {
|
||||
applyCB = new JComboBox<>(DiffApplySettingsOptionManager.SYMBOL_MERGE_CHOICE.values());
|
||||
applyCB.setName(type + " Diff Apply CB");
|
||||
label = new JLabel(" " + type + " ");
|
||||
label = DockingUtils.createNonHtmlLabel(" " + type + " ");
|
||||
label.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||
add(applyCB, BorderLayout.EAST);
|
||||
add(label, BorderLayout.CENTER);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue