mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-4296 - Fixed screen reader support of tooltips using html
This commit is contained in:
parent
dffb5fd859
commit
0b0356528d
43 changed files with 349 additions and 342 deletions
|
@ -27,9 +27,7 @@ import ghidra.app.util.demangler.*;
|
|||
import ghidra.app.util.importer.MessageLog;
|
||||
import ghidra.framework.options.*;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.Function;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.model.symbol.SourceType;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
|
|
@ -45,7 +45,6 @@ import ghidra.program.model.listing.Function;
|
|||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.model.symbol.Symbol;
|
||||
import ghidra.program.util.*;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.SwingUpdateManager;
|
||||
|
@ -443,10 +442,10 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
|||
navigateIncomingToggleAction.setSelected(isPrimary);
|
||||
navigateIncomingToggleAction.setToolBarData(new ToolBarData(
|
||||
Icons.NAVIGATE_ON_INCOMING_EVENT_ICON, navigationOptionsToolbarGroup, "2"));
|
||||
navigateIncomingToggleAction.setDescription(HTMLUtilities.toHTML("Incoming Navigation" +
|
||||
navigateIncomingToggleAction.setDescription("<html>Incoming Navigation" +
|
||||
"<br><br>Toggle <b>On</b> - change the displayed " +
|
||||
"function on Listing navigation events" +
|
||||
"<br>Toggled <b>Off</b> - don't change the displayed function on Listing navigation events"));
|
||||
"<br>Toggled <b>Off</b> - don't change the displayed function on Listing navigation events");
|
||||
navigateIncomingToggleAction.setHelpLocation(
|
||||
new HelpLocation(plugin.getName(), "Call_Tree_Action_Incoming_Navigation"));
|
||||
tool.addLocalAction(this, navigateIncomingToggleAction);
|
||||
|
|
|
@ -124,7 +124,7 @@ public class ClearDialog extends DialogComponentProvider {
|
|||
|
||||
symbolsCb = new GCheckBox("Symbols");
|
||||
commentsCb = new GHtmlCheckBox(
|
||||
"<HTML>Comments <FONT SIZE=\"2\">(does not affect automatic comments)</FONT>");
|
||||
"<html>Comments <FONT SIZE=\"2\">(does not affect automatic comments)</FONT>");
|
||||
commentsCb.setVerticalTextPosition(SwingConstants.TOP);
|
||||
propertiesCb = new GCheckBox("Properties");
|
||||
codeCb = new GCheckBox("Code");
|
||||
|
|
|
@ -103,17 +103,17 @@ public class DataTypeListingHover extends AbstractConfigurableHover implements L
|
|||
toolTipText = toolTipText.replace("Unsized", Integer.toString(dataLen));
|
||||
}
|
||||
if (dataInstance != null) {
|
||||
toolTipText = toolTipText.replace("</HTML>",
|
||||
getLocationSupplimentalToolTipText(dt, dataInstance) + "</HTML>");
|
||||
toolTipText = toolTipText.replace("</html>",
|
||||
getLocationSupplimentalToolTipText(dt, dataInstance) + "</html>");
|
||||
}
|
||||
String warningMsg = "";
|
||||
if (hasInvalidStorage) {
|
||||
warningMsg += "WARNING! Invalid Storage";
|
||||
}
|
||||
if (warningMsg.length() != 0) {
|
||||
String errorText = "<HTML><center><font color=\"" + Messages.ERROR.toHexString() +
|
||||
String errorText = "<html><center><font color=\"" + Messages.ERROR.toHexString() +
|
||||
"\">" + warningMsg + "!</font></center><BR>";
|
||||
toolTipText = toolTipText.replace("<HTML>", errorText);
|
||||
toolTipText = toolTipText.replace("<html>", errorText);
|
||||
}
|
||||
return createTooltipComponent(toolTipText);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public class ProgramAddressRelationshipListingHover extends AbstractConfigurable
|
|||
return null;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder("<HTML><table>");
|
||||
StringBuilder sb = new StringBuilder("<html><table>");
|
||||
|
||||
Address loc = programLocation.getAddress();
|
||||
if (isInDefaultSpace(program, loc)) {
|
||||
|
|
|
@ -623,9 +623,9 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable {
|
|||
conflictMsg += "<div style=\"color: red;font-style: italic\">overlaps " +
|
||||
HTMLUtilities.escapeHTML(conflictTip) + "</div>";
|
||||
}
|
||||
return "<HTML><div style=\"text-align:center\">" + HTMLUtilities.escapeHTML(tip) +
|
||||
return "<html><div style=\"text-align:center\">" + HTMLUtilities.escapeHTML(tip) +
|
||||
conflictMsg +
|
||||
"<div style=\"color: gray;font-style: italic\">(Shift-wheel to zoom)</div></div></HTML>";
|
||||
"<div style=\"color: gray;font-style: italic\">(Shift-wheel to zoom)</div></div>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -394,10 +394,10 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
new HelpLocation(provider.getHelpTopic(), provider.getHelpName() + "_" + "Align"));
|
||||
}
|
||||
String alignmentToolTip =
|
||||
"<HTML>The <B>align</B> control allows the overall minimum alignment of this<BR>" +
|
||||
"<html>The <B>align</B> control allows the overall minimum alignment of this<BR>" +
|
||||
"data type to be specified. The actual computed alignment<BR>" +
|
||||
"may be any multiple of this value. " + "<font color=\"" +
|
||||
Palette.BLUE.toHexString() + "\" size=\"-2\">(<F1> for help)</HTML>";
|
||||
Palette.BLUE.toHexString() + "\" size=\"-2\">(<F1> for help)</html>";
|
||||
alignPanel.setToolTipText(alignmentToolTip);
|
||||
|
||||
addMinimumAlignmentComponents();
|
||||
|
@ -449,10 +449,10 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
|
||||
private void setupDefaultMinAlignButton() {
|
||||
defaultAlignButton.setName("Default Alignment");
|
||||
String alignmentToolTip = "<HTML>Sets this data type to use <B>default</B> alignment.<BR>" +
|
||||
String alignmentToolTip = "<html>Sets this data type to use <B>default</B> alignment.<BR>" +
|
||||
"If packing is disabled, the default will be 1 byte. If packing<BR>" +
|
||||
"is enabled, the alignment is computed based upon the pack<BR>" +
|
||||
"setting and the alignment of each component data type.</HTML>";
|
||||
"setting and the alignment of each component data type.</html>";
|
||||
|
||||
defaultAlignButton.addActionListener(e -> {
|
||||
((CompEditorModel) model).setAlignmentType(AlignmentType.DEFAULT, -1);
|
||||
|
@ -468,10 +468,10 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
private void setupMachineMinAlignButton() {
|
||||
machineAlignButton.setName("Machine Alignment");
|
||||
String alignmentToolTip =
|
||||
"<HTML>Sets this data type to use the <B>machine</B> alignment<BR>" +
|
||||
"<html>Sets this data type to use the <B>machine</B> alignment<BR>" +
|
||||
"as specified by the compiler specification. If packing is<BR>" +
|
||||
"enabled, the computed alignment of this composite should be<BR>" +
|
||||
"the machine alignment value.</HTML>";
|
||||
"the machine alignment value.</html>";
|
||||
machineAlignButton.setToolTipText(alignmentToolTip);
|
||||
|
||||
machineAlignButton.addActionListener(e -> {
|
||||
|
@ -487,9 +487,9 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
private void setupExplicitAlignButton() {
|
||||
explicitAlignButton.setName("Explicit Alignment");
|
||||
String alignmentToolTip =
|
||||
"<HTML>Sets this data type to use the <B>explicit</B> alignment value<BR>" +
|
||||
"<html>Sets this data type to use the <B>explicit</B> alignment value<BR>" +
|
||||
"specified. If packing is enabled, the computed alignment of<BR>" +
|
||||
"this composite may be any multiple of this value.</HTML>";
|
||||
"this composite may be any multiple of this value.</html>";
|
||||
explicitAlignButton.setToolTipText(alignmentToolTip);
|
||||
|
||||
explicitAlignButton.addActionListener(e -> {
|
||||
|
@ -555,10 +555,10 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
private void setupActualAlignment() {
|
||||
GridBagConstraints gridBagConstraints = new GridBagConstraints();
|
||||
String actualAlignmentToolTip =
|
||||
"<HTML>The actual alignment to be used for this data type.<BR>" +
|
||||
"<html>The actual alignment to be used for this data type.<BR>" +
|
||||
"A combination of the pack and alignment settings made to this datatype<BR>" +
|
||||
"combined with alignments of the individual components are used to<BR>" +
|
||||
"to compute the actual alignment of this datatype.</HTML>";
|
||||
"to compute the actual alignment of this datatype.</html>";
|
||||
|
||||
JPanel actualAlignmentPanel = new JPanel(new BorderLayout());
|
||||
actualAlignmentLabel = new GDLabel("Alignment:");
|
||||
|
@ -672,10 +672,10 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
private void setupPackingEnablementButton() {
|
||||
packingEnablementButton.setName("Packing Enablement");
|
||||
String packingToolTipText =
|
||||
"<HTML>Enable packing when details of all components are known (including sizing and" +
|
||||
"<html>Enable packing when details of all components are known (including sizing and" +
|
||||
" alignment).<BR>" + "Disable packing when Reverse Engineering composite. " +
|
||||
"<font color=\"" + Palette.BLUE.toHexString() +
|
||||
"\" size=\"-2\">(<F1> for help)</font></HTML>";
|
||||
"\" size=\"-2\">(<F1> for help)</font></html>";
|
||||
packingEnablementButton.addActionListener(e -> {
|
||||
((CompEditorModel) model).setPackingType(
|
||||
packingEnablementButton.isSelected() ? PackingType.DEFAULT : PackingType.DISABLED,
|
||||
|
@ -692,7 +692,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
private void setupDefaultPackingButton() {
|
||||
defaultPackingButton.setName("Default Packing");
|
||||
String packingToolTipText =
|
||||
"<HTML>Indicates <B>default</B> compiler packing rules should be applied.</HTML>";
|
||||
"<html>Indicates <B>default</B> compiler packing rules should be applied.</html>";
|
||||
|
||||
defaultPackingButton.addActionListener(e -> {
|
||||
((CompEditorModel) model).setPackingType(PackingType.DEFAULT, -1);
|
||||
|
@ -708,7 +708,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
|
|||
private void setupExplicitPackingButton() {
|
||||
explicitPackingButton.setName("Explicit Packing");
|
||||
String packingToolTipText =
|
||||
"<HTML>Indicates an explicit pack size should be applied.</HTML>";
|
||||
"<html>Indicates an explicit pack size should be applied.</html>";
|
||||
|
||||
explicitPackingButton.addActionListener(e -> chooseByValuePacking());
|
||||
explicitPackingButton.setToolTipText(packingToolTipText);
|
||||
|
|
|
@ -94,8 +94,8 @@ public class DataTypeCellRenderer extends GTableCellRenderer {
|
|||
displayName = HTMLUtilities.friendlyEncodeHTML(displayName);
|
||||
|
||||
String toolTipText = ToolTipUtils.getToolTipText(dataType);
|
||||
String headerText = "<HTML><b>" + displayName + "</b><BR>";
|
||||
toolTipText = toolTipText.replace("<HTML>", headerText);
|
||||
String headerText = "<html><b>" + displayName + "</b><BR>";
|
||||
toolTipText = toolTipText.replace("<html>", headerText);
|
||||
return toolTipText;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,7 +572,7 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider {
|
|||
message = EXISITING_STRUCTURE_STATUS_PREFIX;
|
||||
}
|
||||
|
||||
setStatusText("<HTML>" + message + "<BR>\"" + HTMLUtilities.escapeHTML(name) + "\"");
|
||||
setStatusText("<html>" + message + "<BR>\"" + HTMLUtilities.escapeHTML(name) + "\"");
|
||||
}
|
||||
|
||||
// this class is used instead of a cell renderer so that sorting will
|
||||
|
|
|
@ -359,7 +359,7 @@ public class DataTypeSynchronizer {
|
|||
// aesthetically pleasing
|
||||
String spacerString = createHTMLSpacerString(htmlContent, otherContent);
|
||||
StringBuilder buffy = new StringBuilder();
|
||||
buffy.append("<HTML>");
|
||||
buffy.append("<html>");
|
||||
|
||||
// -we use CELLPADDING here to allow us to create a narrow column within the table
|
||||
// -the CELLSPACING gives us some space around the narrow column
|
||||
|
@ -412,8 +412,8 @@ public class DataTypeSynchronizer {
|
|||
private static String createHTMLSpacerString(String htmlContent, String otherHTMLContent) {
|
||||
// unfortunately, to get the displayed widths, we have to have rendered content, which
|
||||
// is what the JLabels below are doing for us
|
||||
JLabel label1 = new GDHtmlLabel("<HTML>" + htmlContent);
|
||||
JLabel label2 = new GDHtmlLabel("<HTML>" + otherHTMLContent);
|
||||
JLabel label1 = new GDHtmlLabel("<html>" + htmlContent);
|
||||
JLabel label2 = new GDHtmlLabel("<html>" + otherHTMLContent);
|
||||
|
||||
int maxPixelWidth =
|
||||
Math.max(label1.getPreferredSize().width, label2.getPreferredSize().width);
|
||||
|
|
|
@ -336,7 +336,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec
|
|||
* the help key triggers (Ctrl-F1) did not work correctly.
|
||||
*/
|
||||
private static final String TOOLTIP_TEXT_PREPEND =
|
||||
"<HTML>Currently selected<br> Code Browser program location<br>" + "address: ";
|
||||
"<html>Currently selected<br> Code Browser program location<br>address: ";
|
||||
|
||||
/**
|
||||
* The component that will house our view.
|
||||
|
|
|
@ -656,9 +656,9 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod
|
|||
color = getErrorForegroundColor(isSelected);
|
||||
}
|
||||
String toolTipText = ToolTipUtils.getToolTipText(dataType);
|
||||
String headerText = "<HTML><b>" +
|
||||
String headerText = "<html><b>" +
|
||||
HTMLUtilities.friendlyEncodeHTML(dataType.getPathName()) + "</b><BR>";
|
||||
toolTipText = toolTipText.replace("<HTML>", headerText);
|
||||
toolTipText = toolTipText.replace("<html>", headerText);
|
||||
setToolTipText(toolTipText);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -125,7 +125,7 @@ public class ProcessorListPlugin extends Plugin implements ApplicationLevelPlugi
|
|||
private String getProcessorList(boolean asHtml) {
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
if (asHtml) {
|
||||
strBuilder.append("<HTML><BODY>\n");
|
||||
strBuilder.append("<html><BODY>\n");
|
||||
strBuilder.append("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>");
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ public class ProcessorListPlugin extends Plugin implements ApplicationLevelPlugi
|
|||
}
|
||||
if (asHtml) {
|
||||
strBuilder.append("</ul>\n</td></tr>\n</table>");
|
||||
strBuilder.append("</BODY></HTML>");
|
||||
strBuilder.append("</BODY></html>");
|
||||
}
|
||||
return strBuilder.toString();
|
||||
}
|
||||
|
|
|
@ -93,12 +93,12 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
|||
private TaskListener cleanupTaskSetListener = new TaskListener() {
|
||||
@Override
|
||||
public void taskCompleted(Task task) {
|
||||
runningScriptTaskSet.remove((RunScriptTask) task);
|
||||
runningScriptTaskSet.remove(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskCancelled(Task task) {
|
||||
runningScriptTaskSet.remove((RunScriptTask) task);
|
||||
runningScriptTaskSet.remove(task);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
|||
return list;
|
||||
}
|
||||
});
|
||||
tableFilterPanel.setToolTipText("<HTML>Include scripts with <b>Names</b> or " +
|
||||
tableFilterPanel.setToolTipText("<html>Include scripts with <b>Names</b> or " +
|
||||
"<b>Descriptions</b> containing this text.");
|
||||
tableFilterPanel.setFocusComponent(scriptCategoryTree);
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ public class ScriptSelectionEditor {
|
|||
|
||||
@Override
|
||||
public String getString(ScriptInfo info) {
|
||||
StringBuilder buffy = new StringBuilder("<HTML><P>");
|
||||
StringBuilder buffy = new StringBuilder("<html><P>");
|
||||
|
||||
KeyStroke keyBinding = info.getKeyBinding();
|
||||
if (keyBinding != null) {
|
||||
|
|
|
@ -81,7 +81,7 @@ class ProgramTextWriter {
|
|||
|
||||
//boolean sk = false;
|
||||
if (options.isHTML()) {
|
||||
writer.print("<HTML><BODY BGCOLOR=#ffffe0>");
|
||||
writer.print("<html><BODY BGCOLOR=#ffffe0>");
|
||||
writer.println("<FONT FACE=COURIER SIZE=3><STRONG><PRE>");
|
||||
}
|
||||
TemplateSimplifier simplifier = new TemplateSimplifier();
|
||||
|
@ -339,7 +339,7 @@ class ProgramTextWriter {
|
|||
}
|
||||
|
||||
if (options.isHTML()) {
|
||||
writer.println("</PRE></STRONG></FONT></BODY></HTML>");
|
||||
writer.println("</PRE></STRONG></FONT></BODY></html>");
|
||||
}
|
||||
|
||||
writer.close();
|
||||
|
|
|
@ -40,9 +40,10 @@ public abstract class HTMLDataTypeRepresentation {
|
|||
protected final static int MAX_CHARACTER_LENGTH = 80;
|
||||
protected final static int MAX_LINE_LENGTH = MAX_CHARACTER_LENGTH * 3;
|
||||
|
||||
// HTML Tag constants
|
||||
protected static final String HTML_OPEN = "<HTML>";
|
||||
protected static final String HTML_CLOSE = "</HTML>";
|
||||
// HTML Tag constants. Intentionally lower-case to match external checks for isHtml(), some of
|
||||
// which check case-sensitive for "<html>"
|
||||
protected static final String HTML_OPEN = "<html>";
|
||||
protected static final String HTML_CLOSE = "</html>";
|
||||
|
||||
// single HTML space
|
||||
protected static final String HTML_SPACE = " ";
|
||||
|
@ -300,11 +301,11 @@ public abstract class HTMLDataTypeRepresentation {
|
|||
*/
|
||||
protected HTMLDataTypeRepresentation(String htmlText) {
|
||||
this.originalHTMLData = htmlText.trim();
|
||||
// NOTE: the text expected here should not have <HTML></HTML> tags!
|
||||
// NOTE: the text expected here should not have <html></html> tags!
|
||||
boolean htmlStart = StringUtilities.startsWithIgnoreCase(htmlText, HTML_OPEN);
|
||||
boolean htmlEnd = StringUtilities.startsWithIgnoreCase(htmlText, HTML_CLOSE);
|
||||
if (htmlStart || htmlEnd) {
|
||||
throw new AssertException("Invalid HTML format: text must not include HTML tag");
|
||||
throw new AssertException("Invalid HTML format: text must not include <html> tag");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class EolExtraCommentsPropertyEditor extends PropertyEditorSupport
|
|||
private static final String ABBREVIATED_LABEL = "Use Abbreviated Comments";
|
||||
|
||||
private static final String REPEATABLE_TOOLTIP =
|
||||
"<HTML>For repeatable comments:" +
|
||||
"<html>For repeatable comments:" +
|
||||
"<UL>" +
|
||||
" <LI>ALWAYS - show even if an EOL comment exists</LI>" +
|
||||
" <LI>DEFAULT - show only when no EOL comment exists</LI>" +
|
||||
|
@ -45,7 +45,7 @@ public class EolExtraCommentsPropertyEditor extends PropertyEditorSupport
|
|||
"</UL>";
|
||||
|
||||
private static final String REF_REPEATABLE_TOOLTIP =
|
||||
"<HTML>For referenced repeatable comments:" +
|
||||
"<html>For referenced repeatable comments:" +
|
||||
"<UL>" +
|
||||
" <LI>ALWAYS - show even if a higher priority comment exists</LI>" +
|
||||
" <LI>DEFAULT - show only when no higher priority comment exists</LI>" +
|
||||
|
@ -53,7 +53,7 @@ public class EolExtraCommentsPropertyEditor extends PropertyEditorSupport
|
|||
"</UL>";
|
||||
|
||||
private static final String AUTO_TOOLTIP =
|
||||
"<HTML>For automatic comments:" +
|
||||
"<html>For automatic comments:" +
|
||||
"<UL>" +
|
||||
" <LI>ALWAYS - show even if a higher priority comment exists</LI>" +
|
||||
" <LI>DEFAULT - show only when no higher priority comment exists</LI>" +
|
||||
|
|
|
@ -522,7 +522,7 @@ public class ListingCodeComparisonPanel
|
|||
class ToggleOrientationAction extends ToggleDockingAction {
|
||||
ToggleOrientationAction() {
|
||||
super("Dual Listing Toggle Orientation", owner);
|
||||
setDescription("<HTML>Toggle the layout of the listings " +
|
||||
setDescription("<html>Toggle the layout of the listings " +
|
||||
"<BR>between side-by-side and one above the other.</HTML>");
|
||||
setEnabled(true);
|
||||
setSelected(isSideBySide);
|
||||
|
@ -1871,7 +1871,7 @@ public class ListingCodeComparisonPanel
|
|||
if (!titlePrefix.isEmpty()) {
|
||||
titlePrefix += " "; // Add a space between prefix and title.
|
||||
}
|
||||
String htmlPrefix = "<HTML>";
|
||||
String htmlPrefix = "<html>";
|
||||
if (title.startsWith(htmlPrefix)) {
|
||||
titlePanel.setTitleName(htmlPrefix + HTMLUtilities.friendlyEncodeHTML(titlePrefix) +
|
||||
title.substring(htmlPrefix.length()));
|
||||
|
|
|
@ -193,7 +193,7 @@ class InfoPanel extends JPanel {
|
|||
private HyperlinkComponent buildJavaVersionComponent() {
|
||||
String anchorName = "java_version";
|
||||
final HyperlinkComponent javaVersionComponent =
|
||||
new HyperlinkComponent("<HTML><CENTER>Java Version " + "<A HREF=\"" + anchorName +
|
||||
new HyperlinkComponent("<html><CENTER>Java Version " + "<A HREF=\"" + anchorName +
|
||||
"\">" + System.getProperty("java.version") + "</A></CENTER>");
|
||||
javaVersionComponent.addHyperlinkListener(anchorName, e -> {
|
||||
if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) {
|
||||
|
|
|
@ -52,7 +52,7 @@ import ghidra.test.TestEnv;
|
|||
public class ClearTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
|
||||
private static final String COMMENTS_CHECK_BOX_TEXT =
|
||||
"<HTML>Comments <FONT SIZE=\"2\">(does not affect automatic comments)</FONT>";
|
||||
"<html>Comments <FONT SIZE=\"2\">(does not affect automatic comments)</FONT>";
|
||||
|
||||
private TestEnv env;
|
||||
private PluginTool tool;
|
||||
|
|
|
@ -362,7 +362,7 @@ public class HTMLDataTypeRepresentationTest extends AbstractGenericTest {
|
|||
private String getParamText(String html) {
|
||||
|
||||
// function html format:
|
||||
// <HTML>void myFunction(<BR> byte )<BR></HTML>
|
||||
// <html>void myFunction(<BR> byte )<BR></HTML>
|
||||
|
||||
Pattern p = Pattern.compile("\\((.*)\\)");
|
||||
Matcher matcher = p.matcher(html);
|
||||
|
|
|
@ -26,7 +26,6 @@ import docking.ComponentProvider;
|
|||
import docking.action.*;
|
||||
import docking.options.OptionsService;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
|
||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||
import docking.widgets.label.GDHtmlLabel;
|
||||
import ghidra.GhidraOptions;
|
||||
|
@ -40,7 +39,8 @@ import ghidra.program.model.address.AddressSetView;
|
|||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.util.FunctionUtility;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
/**
|
||||
* Panel that displays two decompilers for comparison
|
||||
|
@ -133,7 +133,7 @@ public abstract class DecompilerCodeComparisonPanel<T extends DualDecompilerFiel
|
|||
if (!titlePrefix.isEmpty()) {
|
||||
titlePrefix += " "; // Add a space between prefix and title.
|
||||
}
|
||||
String htmlPrefix = "<HTML>";
|
||||
String htmlPrefix = "<html>";
|
||||
if (title.startsWith(htmlPrefix)) {
|
||||
titlePanel.setTitleName(htmlPrefix + HTMLUtilities.friendlyEncodeHTML(titlePrefix) +
|
||||
title.substring(htmlPrefix.length()));
|
||||
|
@ -780,7 +780,7 @@ public abstract class DecompilerCodeComparisonPanel<T extends DualDecompilerFiel
|
|||
|
||||
ToggleOrientationAction() {
|
||||
super("Dual Decompiler Toggle Orientation", "FunctionComparison");
|
||||
setDescription("<HTML>Toggle the layout of the decompiler " +
|
||||
setDescription("<html>Toggle the layout of the decompiler " +
|
||||
"<BR>between side-by-side and one above the other.");
|
||||
setEnabled(true);
|
||||
setSelected(isSideBySide);
|
||||
|
|
|
@ -52,7 +52,8 @@ import ghidra.graph.viewer.vertex.VertexClickListener;
|
|||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import resources.Icons;
|
||||
|
@ -425,10 +426,10 @@ public class FcgProvider
|
|||
navigateIncomingToggleAction.setSelected(true);
|
||||
navigateIncomingToggleAction.setToolBarData(
|
||||
new ToolBarData(Icons.NAVIGATE_ON_INCOMING_EVENT_ICON, TOOLBAR_GROUP_A));
|
||||
navigateIncomingToggleAction.setDescription(HTMLUtilities.toHTML(
|
||||
"Incoming Navigation<br><br>Toggle <b>On</b> - change the graphed " +
|
||||
navigateIncomingToggleAction.setDescription(
|
||||
"<html>Incoming Navigation<br><br>Toggle <b>On</b> - change the graphed " +
|
||||
"function on Listing navigation events" +
|
||||
"<br>Toggled <b>Off</b> - don't change the graph on Listing navigation events"));
|
||||
"<br>Toggled <b>Off</b> - don't change the graph on Listing navigation events");
|
||||
navigateIncomingToggleAction.setHelpLocation(
|
||||
new HelpLocation(plugin.getName(), "Navigation_Incoming"));
|
||||
addLocalAction(navigateIncomingToggleAction);
|
||||
|
|
|
@ -79,7 +79,7 @@ public class AttributedToolTipInfo extends ToolTipInfo<Attributed> {
|
|||
}
|
||||
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append("<HTML>");
|
||||
buf.append("<html>");
|
||||
|
||||
if (graphObject instanceof AttributedVertex) {
|
||||
addToolTipTextForVertex(buf, (AttributedVertex) graphObject);
|
||||
|
|
|
@ -262,7 +262,7 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
createChoices();
|
||||
VariableHeightPanel panel = new VariableHeightPanel(false, 10, 3);
|
||||
|
||||
panel.setToolTipText("<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." +
|
||||
|
|
|
@ -51,68 +51,68 @@ public class ApplyMarkupPropertyEditor implements OptionsEditor {
|
|||
|
||||
// help tooltips
|
||||
private static final String DATA_MATCH_DATA_TYPE_TOOLTIP =
|
||||
"<HTML>The apply action for the <b>data type on a data match</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for the <b>data type on a data match</b> when performing bulk apply operations</html>";
|
||||
private static final String LABELS_TOOLTIP =
|
||||
"<HTML>The apply action for <b>labels</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for <b>labels</b> when performing bulk apply operations</html>";
|
||||
private static final String FUNCTION_NAME_TOOLTIP =
|
||||
"<HTML>The apply action for <b>function name</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for <b>function name</b> when performing bulk apply operations</html>";
|
||||
private static final String FUNCTION_SIGNATURE_TOOLTIP =
|
||||
"<HTML>The apply action for the <b>function signature</b> " +
|
||||
"when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for the <b>function signature</b> " +
|
||||
"when performing bulk apply operations</html>";
|
||||
private static final String PLATE_COMMENT_TOOLTIP =
|
||||
"<HTML>The apply action for <b>plate comments</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for <b>plate comments</b> when performing bulk apply operations</html>";
|
||||
private static final String PRE_COMMENT_TOOLTIP =
|
||||
"<HTML>The apply action for <b>pre comments</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for <b>pre comments</b> when performing bulk apply operations</html>";
|
||||
private static final String END_OF_LINE_COMMENT_TOOLTIP =
|
||||
"<HTML>The apply action for <b>end of line comments</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for <b>end of line comments</b> when performing bulk apply operations</html>";
|
||||
private static final String REPEATABLE_COMMENT_TOOLTIP =
|
||||
"<HTML>The apply action for <b>repeatable comments</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for <b>repeatable comments</b> when performing bulk apply operations</html>";
|
||||
private static final String POST_COMMENT_TOOLTIP =
|
||||
"<HTML>The apply action for <b>post comments</b> when performing bulk apply operations</HTML>";
|
||||
"<html>The apply action for <b>post comments</b> when performing bulk apply operations</html>";
|
||||
private static final String FUNCTION_RETURN_TYPE_TOOLTIP =
|
||||
"<HTML>The apply action for <b>function return type</b> when the function signature is applied</HTML>";
|
||||
"<html>The apply action for <b>function return type</b> when the function signature is applied</html>";
|
||||
private static final String INLINE_TOOLTIP =
|
||||
"<HTML>The apply action to use for the <b>function inline flag</b> " +
|
||||
"when applying the function signature</HTML>";
|
||||
"<html>The apply action to use for the <b>function inline flag</b> " +
|
||||
"when applying the function signature</html>";
|
||||
private static final String NO_RETURN_TOOLTIP =
|
||||
"<HTML>The apply action to use for the <b>function no return flag</b> " +
|
||||
"when applying the function signature</HTML>";
|
||||
"<html>The apply action to use for the <b>function no return flag</b> " +
|
||||
"when applying the function signature</html>";
|
||||
private static final String CALLING_CONVENTION_TOOLTIP =
|
||||
"<HTML>The apply action to use for the <b>function calling convention</b> " +
|
||||
"when applying the function signature</HTML>";
|
||||
"<html>The apply action to use for the <b>function calling convention</b> " +
|
||||
"when applying the function signature</html>";
|
||||
private static final String CALL_FIXUP_TOOLTIP =
|
||||
"<HTML>The apply action for <b>whether or not to apply call fixup</b> " +
|
||||
"when applying the function signature</HTML>";
|
||||
"<html>The apply action for <b>whether or not to apply call fixup</b> " +
|
||||
"when applying the function signature</html>";
|
||||
private static final String VAR_ARGS_TOOLTIP =
|
||||
"<HTML>The apply action to use for the <b>var args flag</b> " +
|
||||
"when applying the function signature</HTML>";
|
||||
"<html>The apply action to use for the <b>var args flag</b> " +
|
||||
"when applying the function signature</html>";
|
||||
private static final String PARAMETER_DATA_TYPES_TOOLTIP =
|
||||
"<HTML>The apply action for <b>function parameter data types</b> when applying the function signature</HTML>";
|
||||
"<html>The apply action for <b>function parameter data types</b> when applying the function signature</html>";
|
||||
private static final String PARAMETER_NAMES_TOOLTIP =
|
||||
"<HTML>The apply action for <b>function parameter names</b> when applying the function signature</HTML>";
|
||||
"<html>The apply action for <b>function parameter names</b> when applying the function signature</html>";
|
||||
private static final String PARAMETER_NAME_PRIORITY_TOOTIP =
|
||||
"<HTML>Choose whether a parameter name with a User source type or Import source type is highest " +
|
||||
"priority when determining whether to replace the name or not when using the priority.</HTML>";
|
||||
"<html>Choose whether a parameter name with a User source type or Import source type is highest " +
|
||||
"priority when determining whether to replace the name or not when using the priority.</html>";
|
||||
private static final String HIGHEST_NAME_PRIORITY_TOOLTIP =
|
||||
"<HTML>The apply action for <b>which source type is the highest priority</b> " +
|
||||
"when applying parameter names using a priority replace</HTML>";
|
||||
"<html>The apply action for <b>which source type is the highest priority</b> " +
|
||||
"when applying parameter names using a priority replace</html>";
|
||||
private static final String USER_PRIORITY_TOOLTIP =
|
||||
"<HTML>Parameter Name Source Type Priority <br>from highest to lowest:<br>" +
|
||||
"<blockquote>User Defined<br>Imported<br>Analysis<br>default (i.e. param_...)</blockquote></HTML>";
|
||||
"<html>Parameter Name Source Type Priority <br>from highest to lowest:<br>" +
|
||||
"<blockquote>User Defined<br>Imported<br>Analysis<br>default (i.e. param_...)</blockquote></html>";
|
||||
private static final String IMPORT_PRIORITY_TOOLTIP =
|
||||
"<HTML>Parameter Name Source Type Priority <br>from highest to lowest:<br>" +
|
||||
"<blockquote>Imported<br>User Defined<br>Analysis<br>default (i.e. param_...)</blockquote></HTML>";
|
||||
"<html>Parameter Name Source Type Priority <br>from highest to lowest:<br>" +
|
||||
"<blockquote>Imported<br>User Defined<br>Analysis<br>default (i.e. param_...)</blockquote></html>";
|
||||
private static final String PARAMETER_NAMES_REPLACE_IF_SAME_PRIORITY_TOOLTIP =
|
||||
"<HTML>When function signature parameter names are being replaced based on source type priority, " +
|
||||
"replace the destination name with the source name if their source types are the same.</HTML>";
|
||||
"<html>When function signature parameter names are being replaced based on source type priority, " +
|
||||
"replace the destination name with the source name if their source types are the same.</html>";
|
||||
private static final String PARAMETER_COMMENTS_TOOLTIP =
|
||||
"<HTML>The apply action for <b>parameter comments</b> when applying the function signature</HTML>";
|
||||
"<html>The apply action for <b>parameter comments</b> when applying the function signature</html>";
|
||||
private static final String IGNORE_EXCLUDED_TOOLTIP =
|
||||
"<HTML>Markup items whose \"apply option\" is set to <b>Do Not Apply</b> should be" +
|
||||
" changed to a status of <b>Ignored</b> by applying a match.</HTML>";
|
||||
"<html>Markup items whose \"apply option\" is set to <b>Do Not Apply</b> should be" +
|
||||
" changed to a status of <b>Ignored</b> by applying a match.</html>";
|
||||
private static final String IGNORE_INCOMPLETE_TOOLTIP =
|
||||
"<HTML>Markup items that are <b>incomplete</b> (for example, no destination address is specified) " +
|
||||
"should be changed to a status of <b>Ignored</b> by applying a match.</HTML>";
|
||||
"<html>Markup items that are <b>incomplete</b> (for example, no destination address is specified) " +
|
||||
"should be changed to a status of <b>Ignored</b> by applying a match.</html>";
|
||||
|
||||
private JComponent editorComponent;
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ public class StatusBar extends JPanel {
|
|||
@Override
|
||||
public String getToolTipText() {
|
||||
if (messageQueue.size() > 0) {
|
||||
StringBuffer buffer = new StringBuffer("<HTML>");
|
||||
StringBuffer buffer = new StringBuffer("<html>");
|
||||
|
||||
Iterator<String> iter = messageQueue.iterator();
|
||||
for (int i = 0; iter.hasNext(); i++) {
|
||||
|
|
|
@ -52,8 +52,8 @@ class DockingToolBarUtils {
|
|||
private static String combingToolTipTextWithKeyBinding(String toolTipText,
|
||||
String keyBindingText) {
|
||||
StringBuilder buffy = new StringBuilder(toolTipText);
|
||||
if (StringUtilities.startsWithIgnoreCase(toolTipText, "<HTML>")) {
|
||||
String endHTMLTag = "</HTML>";
|
||||
if (StringUtilities.startsWithIgnoreCase(toolTipText, "<html>")) {
|
||||
String endHTMLTag = "</html>";
|
||||
int closeTagIndex = StringUtils.indexOfIgnoreCase(toolTipText, endHTMLTag);
|
||||
if (closeTagIndex < 0) {
|
||||
// no closing tag, which is acceptable
|
||||
|
|
|
@ -56,13 +56,13 @@ public class HorizontalRuleAction extends DockingAction {
|
|||
String topHtml = HTMLUtilities.escapeHTML(topName);
|
||||
String bottomHtml = HTMLUtilities.escapeHTML(bottomName);
|
||||
menuData.setMenuItemNamePlain(String.format("""
|
||||
<HTML><CENTER><FONT SIZE=2 COLOR="%s">%s<BR>%s</FONT></CENTER>
|
||||
<html><CENTER><FONT SIZE=2 COLOR="%s">%s<BR>%s</FONT></CENTER>
|
||||
""", Palette.SILVER, topHtml, bottomHtml));
|
||||
setMenuBarData(menuData);
|
||||
|
||||
// the description is meant to be used for the tooltip and is larger
|
||||
setDescription(String.format("""
|
||||
<HTML><CENTER><B>%s</B><HR><B>%s</B></CENTER>
|
||||
<html><CENTER><B>%s</B><HR><B>%s</B></CENTER>
|
||||
""", PADDING + topHtml + PADDING, PADDING + bottomHtml + PADDING));
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ public class ColorEditor extends PropertyEditorSupport {
|
|||
String colorString =
|
||||
WebColors.toString(ColorUtils.contrastForegroundColor(newColor), false);
|
||||
previewLabel.setText(
|
||||
"<HTML><CENTER><I><FONT SIZE=2 COLOR=" + colorString + ">click</FONT></I></CENTER>");
|
||||
"<html><CENTER><I><FONT SIZE=2 COLOR=" + colorString + ">click</FONT></I></CENTER>");
|
||||
|
||||
previewLabel.setBackground(color);
|
||||
}
|
||||
|
|
|
@ -123,11 +123,13 @@ public class HTMLUtilities {
|
|||
private static final int MAX_TOOLTIP_LENGTH = 2000; // arbitrary
|
||||
private static final int TAB_SIZE = 4;
|
||||
|
||||
public static final String HTML = "<HTML>";
|
||||
public static final String HTML_CLOSE = "</HTML>";
|
||||
public static final String BR = "<BR>";
|
||||
public static final String PRE = "<PRE>";
|
||||
public static final String PRE_CLOSE = "</PRE>";
|
||||
// Intentionally lower-case to match external checks for isHtml(), some of which check
|
||||
// case-sensitive for "<html>"
|
||||
public static final String HTML = "<html>";
|
||||
public static final String HTML_CLOSE = "</html>";
|
||||
public static final String BR = "<br>";
|
||||
public static final String PRE = "<pre>";
|
||||
public static final String PRE_CLOSE = "</pre>";
|
||||
|
||||
/**
|
||||
* A tag to mark code that could be made into a hyperlink. This allows you to mark
|
||||
|
@ -171,35 +173,35 @@ public class HTMLUtilities {
|
|||
*/
|
||||
public static String colorString(Color color, String text) {
|
||||
String rgb = toHexString(color);
|
||||
return "<FONT COLOR=\"" + rgb + "\">" + text + "</FONT>";
|
||||
return "<font color=\"" + rgb + "\">" + text + "</font>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Surrounds the indicated text with HTML font coloring tags so that the
|
||||
* text will display in color within HTML.
|
||||
* @param rgbColor (eg. "#8c0000") a string indicating the RGB hexadecimal color
|
||||
* @param rgbColor (e.g., "#8c0000") a string indicating the RGB hexadecimal color
|
||||
* @param text the original text
|
||||
* @return the string for HTML colored text
|
||||
*/
|
||||
public static String colorString(String rgbColor, String text) {
|
||||
return "<FONT COLOR=\"" + rgbColor + "\">" + text + "</FONT>";
|
||||
return "<font color=\"" + rgbColor + "\">" + text + "</font>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Surrounds the indicated numeric value with HTML font coloring tags so that the
|
||||
* numeric value will display in color within HTML.
|
||||
* @param rgbColor (eg. "#8c0000") a string indicating the RGB hexadecimal color
|
||||
* @param rgbColor (e.g., "#8c0000") a string indicating the RGB hexadecimal color
|
||||
* @param value the numeric value to be converted to text and wrapped with color tags.
|
||||
* @return the string for the HTML colored number
|
||||
*/
|
||||
public static String colorString(String rgbColor, int value) {
|
||||
return "<FONT COLOR=\"" + rgbColor + "\">" + value + "</FONT>";
|
||||
return "<font color=\"" + rgbColor + "\">" + value + "</font>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string with the indicated number of HTML space characters (<code>&nbsp;</code>).
|
||||
* @param num the number of HTML spaces
|
||||
* @return the string o HTML spaces
|
||||
* @return the string of HTML spaces
|
||||
*/
|
||||
public static String spaces(int num) {
|
||||
StringBuilder buf = new StringBuilder(HTML_SPACE.length() * num);
|
||||
|
@ -289,7 +291,7 @@ public class HTMLUtilities {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the font size of the given text by wrapping it in <font> tags.
|
||||
* Sets the font size of the given text by wrapping it in <span> tags.
|
||||
*
|
||||
* @param text the text to size
|
||||
* @param ptSize the point size of the text
|
||||
|
@ -303,19 +305,19 @@ public class HTMLUtilities {
|
|||
}
|
||||
|
||||
StringBuilder buffy = new StringBuilder(text);
|
||||
buffy.insert(start, "<SPAN STYLE=\"font-size: " + ptSize + "pt\">");
|
||||
buffy.insert(start, "<span style=\"font-size: " + ptSize + "pt\">");
|
||||
|
||||
int end = buffy.length();
|
||||
if (StringUtilities.endsWithIgnoreCase(text, HTML_CLOSE)) {
|
||||
end = end - HTML_CLOSE.length();
|
||||
}
|
||||
|
||||
buffy.insert(end, "</SPAN>");
|
||||
buffy.insert(end, "</span>");
|
||||
return buffy.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the font size and color of the given text by wrapping it in <font> tags.
|
||||
* Sets the font size and color of the given text by wrapping it in <span> tags.
|
||||
*
|
||||
* @param text the text to size
|
||||
* @param color the color of the text
|
||||
|
@ -330,14 +332,14 @@ public class HTMLUtilities {
|
|||
}
|
||||
|
||||
StringBuilder buffy = new StringBuilder(text);
|
||||
buffy.insert(start, "<SPAN STYLE=\"font-size: " + ptSize + "pt; color: " + rgb + "\">");
|
||||
buffy.insert(start, "<span style=\"font-size: " + ptSize + "pt; color: " + rgb + "\">");
|
||||
|
||||
int end = buffy.length();
|
||||
if (StringUtilities.endsWithIgnoreCase(text, HTML_CLOSE)) {
|
||||
end = end - HTML_CLOSE.length();
|
||||
}
|
||||
|
||||
buffy.insert(end, "</SPAN>");
|
||||
buffy.insert(end, "</span>");
|
||||
return buffy.toString();
|
||||
}
|
||||
|
||||
|
@ -363,8 +365,8 @@ public class HTMLUtilities {
|
|||
|
||||
/**
|
||||
* Takes HTML text wrapped by {@link #wrapWithLinkPlaceholder(String, String)} and replaces
|
||||
* the custom link comment tags with HTML anchor (<code>A</code>) tags, where the <code>HREF</code>
|
||||
* value is the value that was in the <code>CONTENT</code> attribute.
|
||||
* the custom link comment tags with HTML anchor (<code>A</code>) tags, where the
|
||||
* <code>HREF</code> value is the value that was in the <code>CONTENT</code> attribute.
|
||||
*
|
||||
* @param text the text for which to replace the markup
|
||||
* @return the updated text
|
||||
|
@ -378,14 +380,14 @@ public class HTMLUtilities {
|
|||
while (matcher.find()) {
|
||||
String content = matcher.group(1);
|
||||
String escaped = content.replace("$", "\\$");
|
||||
String updated = "<A HREF=\"" + escaped + "\">";
|
||||
String updated = "<a href=\"" + escaped + "\">";
|
||||
matcher.appendReplacement(buffy, updated);
|
||||
}
|
||||
|
||||
matcher.appendTail(buffy);
|
||||
|
||||
String pass1 = buffy.toString();
|
||||
String pass2 = pass1.replaceAll(LINK_PLACEHOLDER_CLOSE, "</A>");
|
||||
String pass2 = pass1.replaceAll(LINK_PLACEHOLDER_CLOSE, "</a>");
|
||||
return pass2;
|
||||
}
|
||||
|
||||
|
@ -398,8 +400,7 @@ public class HTMLUtilities {
|
|||
*/
|
||||
public static String toHTML(String text) {
|
||||
int noMax = 0;
|
||||
String html = toWrappedHTML(text, noMax);
|
||||
return html;
|
||||
return toWrappedHTML(text, noMax);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -107,7 +107,7 @@ public class HTMLUtilitiesTest {
|
|||
|
||||
@Test
|
||||
public void testToLiteralHTML_AlreadyStartingWithHTML() {
|
||||
String s = "<HTML>Wrap<BR>here";
|
||||
String s = "<html>Wrap<BR>here";
|
||||
String html = HTMLUtilities.toLiteralHTML(s, 4);
|
||||
assertEquals(HTML + "<HTM<BR>\nL>Wr<BR>\nap<B<BR>\nR>he<BR>\nre", html);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ public class HTMLUtilitiesTest {
|
|||
|
||||
@Test
|
||||
public void testFromHTML() {
|
||||
String s = "<HTML><b>Bold</b>, <i>italics</i>, <font size='3'>sized font!</font>";
|
||||
String s = "<html><b>Bold</b>, <i>italics</i>, <font size='3'>sized font!</font>";
|
||||
String text = Swing.runNow(() -> HTMLUtilities.fromHTML(s));
|
||||
assertEquals("Bold, italics, sized font!", text);
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@
|
|||
*/
|
||||
package help.screenshot;
|
||||
|
||||
import help.GHelpBuilder;
|
||||
import help.HelpBuildUtils;
|
||||
import help.validator.UnusedHelpImageFileFinder;
|
||||
import help.validator.location.DirectoryHelpModuleLocation;
|
||||
import help.validator.location.HelpModuleLocation;
|
||||
import help.validator.model.HelpTopic;
|
||||
import help.validator.model.IMG;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -36,6 +28,14 @@ import java.util.Map.Entry;
|
|||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import help.GHelpBuilder;
|
||||
import help.HelpBuildUtils;
|
||||
import help.validator.UnusedHelpImageFileFinder;
|
||||
import help.validator.location.DirectoryHelpModuleLocation;
|
||||
import help.validator.location.HelpModuleLocation;
|
||||
import help.validator.model.HelpTopic;
|
||||
import help.validator.model.IMG;
|
||||
|
||||
public class HelpMissingScreenShotReportGenerator {
|
||||
|
||||
private static boolean debugEnabled;
|
||||
|
@ -68,17 +68,17 @@ public class HelpMissingScreenShotReportGenerator {
|
|||
generator.generateReport();
|
||||
}
|
||||
|
||||
private Set<HelpModuleLocation> helpDirectories = new HashSet<HelpModuleLocation>();
|
||||
private Map<String, HelpTopic> topicNameToTopic = new HashMap<String, HelpTopic>();
|
||||
private Set<HelpTestCase> testCases = new HashSet<HelpTestCase>();
|
||||
private Map<String, HelpTestCase> imageNameToTestCase = new HashMap<String, HelpTestCase>();
|
||||
private Set<HelpModuleLocation> helpDirectories = new HashSet<>();
|
||||
private Map<String, HelpTopic> topicNameToTopic = new HashMap<>();
|
||||
private Set<HelpTestCase> testCases = new HashSet<>();
|
||||
private Map<String, HelpTestCase> imageNameToTestCase = new HashMap<>();
|
||||
|
||||
private SortedSet<String> badlyNamedTestFiles = new TreeSet<String>();
|
||||
private SortedSet<HelpTestCase> badlyNamedTestCases = new TreeSet<HelpTestCase>();
|
||||
private SortedSet<String> badlyNamedTestFiles = new TreeSet<>();
|
||||
private SortedSet<HelpTestCase> badlyNamedTestCases = new TreeSet<>();
|
||||
// private Map<HelpDirectory, IMG> untestedImages = new TreeMap<HelpDirectory, IMG>();
|
||||
private Map<HelpTopic, Set<IMG>> untestedImages = new TreeMap<HelpTopic, Set<IMG>>();
|
||||
private Map<HelpTopic, Set<IMG>> untestedImages = new TreeMap<>();
|
||||
|
||||
private Set<Path> examinedImageFiles = new HashSet<Path>();
|
||||
private Set<Path> examinedImageFiles = new HashSet<>();
|
||||
|
||||
private File outputFile;
|
||||
|
||||
|
@ -432,7 +432,7 @@ public class HelpMissingScreenShotReportGenerator {
|
|||
|
||||
Set<IMG> set = untestedImages.get(topic);
|
||||
if (set == null) {
|
||||
set = new TreeSet<IMG>();
|
||||
set = new TreeSet<>();
|
||||
untestedImages.put(topic, set);
|
||||
}
|
||||
|
||||
|
@ -619,7 +619,7 @@ public class HelpMissingScreenShotReportGenerator {
|
|||
}
|
||||
|
||||
private void writeHeader(BufferedWriter writer) throws IOException {
|
||||
writer.write("<HTML>\n");
|
||||
writer.write("<html>\n");
|
||||
writer.write("<HEAD>\n");
|
||||
createStyleSheet(writer);
|
||||
writer.write("</HEAD>\n");
|
||||
|
@ -635,7 +635,7 @@ public class HelpMissingScreenShotReportGenerator {
|
|||
writer.write("<BR>\n");
|
||||
|
||||
writer.write("</BODY>\n");
|
||||
writer.write("</HTML>\n");
|
||||
writer.write("</html>\n");
|
||||
}
|
||||
|
||||
private void createStyleSheet(BufferedWriter writer) throws IOException {
|
||||
|
@ -643,11 +643,16 @@ public class HelpMissingScreenShotReportGenerator {
|
|||
writer.write("<!--\n");
|
||||
|
||||
writer.write("body { font-family:arial; font-size:22pt }\n");
|
||||
writer.write("h1 { color:#000080; font-family:times new roman; font-size:28pt; font-weight:bold; text-align:center; }\n");
|
||||
writer.write("h2 { color:#984c4c; font-family:times new roman; font-size:28pt; font-weight:bold; }\n");
|
||||
writer.write("h2.title { color:#000080; font-family:times new roman; font-size:14pt; font-weight:bold; text-align:center;}\n");
|
||||
writer.write("h3 { color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; margin-left:.5in }\n");
|
||||
writer.write("table { margin-left:1in; margin-right:1in; min-width:20em; width:90%; background-color:#EEEEFF }\n");
|
||||
writer.write(
|
||||
"h1 { color:#000080; font-family:times new roman; font-size:28pt; font-weight:bold; text-align:center; }\n");
|
||||
writer.write(
|
||||
"h2 { color:#984c4c; font-family:times new roman; font-size:28pt; font-weight:bold; }\n");
|
||||
writer.write(
|
||||
"h2.title { color:#000080; font-family:times new roman; font-size:14pt; font-weight:bold; text-align:center;}\n");
|
||||
writer.write(
|
||||
"h3 { color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; margin-left:.5in }\n");
|
||||
writer.write(
|
||||
"table { margin-left:1in; margin-right:1in; min-width:20em; width:90%; background-color:#EEEEFF }\n");
|
||||
writer.write("th { text-align:center; }\n");
|
||||
writer.write("td { text-align:left; padding: 20px }\n");
|
||||
|
||||
|
@ -665,7 +670,8 @@ public class HelpMissingScreenShotReportGenerator {
|
|||
private Path filePath;
|
||||
private HelpTopic helpTopic;
|
||||
|
||||
HelpTestFile(HelpModuleLocation helpDir, HelpTopic helpTopic, Path filePath, String filename) {
|
||||
HelpTestFile(HelpModuleLocation helpDir, HelpTopic helpTopic, Path filePath,
|
||||
String filename) {
|
||||
this.helpDir = helpDir;
|
||||
this.helpTopic = helpTopic;
|
||||
this.filePath = filePath;
|
||||
|
|
|
@ -146,7 +146,7 @@ public class HelpScreenShotReportGenerator {
|
|||
}
|
||||
|
||||
private void writeHeader(BufferedWriter writer) throws IOException {
|
||||
writer.write("<HTML>\n");
|
||||
writer.write("<html>\n");
|
||||
writer.write("<HEAD>\n");
|
||||
createStyleSheet(writer);
|
||||
writer.write("</HEAD>\n");
|
||||
|
@ -178,7 +178,7 @@ public class HelpScreenShotReportGenerator {
|
|||
writer.write("</P>\n");
|
||||
|
||||
writer.write("</BODY>\n");
|
||||
writer.write("</HTML>\n");
|
||||
writer.write("</html>\n");
|
||||
}
|
||||
|
||||
private void createStyleSheet(BufferedWriter writer) throws IOException {
|
||||
|
|
|
@ -115,7 +115,7 @@ public abstract class AbstractHelpTest extends AbstractGenericTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"help/shared/DefaultStyle.css\">\n" +
|
||||
|
@ -141,7 +141,7 @@ public abstract class AbstractHelpTest extends AbstractGenericTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"help/shared/DefaultStyle.css\">\n" +
|
||||
|
@ -152,7 +152,7 @@ public abstract class AbstractHelpTest extends AbstractGenericTest {
|
|||
" And this is a link <A HREF=\""+HREF+"\">Click Me</A>" +
|
||||
" \n" +
|
||||
"</BODY>\n" +
|
||||
"</HTML>\n";
|
||||
"</html>\n";
|
||||
//@formatter:on
|
||||
|
||||
Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE);
|
||||
|
@ -168,7 +168,7 @@ public abstract class AbstractHelpTest extends AbstractGenericTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"help/shared/DefaultStyle.css\">\n" +
|
||||
|
@ -179,7 +179,7 @@ public abstract class AbstractHelpTest extends AbstractGenericTest {
|
|||
" Some text with reference to shared image <IMG src=\""+SRC+"\">\n" +
|
||||
" \n" +
|
||||
"</BODY>\n" +
|
||||
"</HTML>\n";
|
||||
"</html>\n";
|
||||
//@formatter:on
|
||||
|
||||
Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE);
|
||||
|
|
|
@ -184,7 +184,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"help/shared/DefaultStyle.css\">\n" +
|
||||
|
@ -194,7 +194,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
"Some text with reference to shared image <a "+badAttr+">Click me</a>\n" +
|
||||
"\n" +
|
||||
"</BODY>\n" +
|
||||
"</HTML>\n";
|
||||
"</html>\n";
|
||||
//@formatter:on
|
||||
|
||||
Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE);
|
||||
|
@ -209,7 +209,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"help/shared/DefaultStyle.css\">\n" +
|
||||
|
@ -219,7 +219,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
"Some text with reference to shared image <IMG "+badAttr+"s>\n" +
|
||||
"\n" +
|
||||
"</BODY>\n" +
|
||||
"</HTML>\n";
|
||||
"</html>\n";
|
||||
//@formatter:on
|
||||
|
||||
Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE);
|
||||
|
@ -234,7 +234,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"help/shared/DefaultStyle.css\">\n" +
|
||||
|
@ -244,7 +244,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
"Some text with reference to shared image <a href=\""+badURI+"\">Click me</a>\n" +
|
||||
"\n" +
|
||||
"</BODY>\n" +
|
||||
"</HTML>\n";
|
||||
"</html>\n";
|
||||
//@formatter:on
|
||||
|
||||
Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE);
|
||||
|
@ -259,7 +259,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"../../shared/"+badName+".css\">\n" +
|
||||
|
@ -269,7 +269,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
"Some text with reference to shared image <IMG src=\"help/shared/DefaultStyle.css\">\n" +
|
||||
"\n" +
|
||||
"</BODY>\n" +
|
||||
"</HTML>\n";
|
||||
"</html>\n";
|
||||
//@formatter:on
|
||||
|
||||
Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE);
|
||||
|
@ -285,7 +285,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
|
||||
//@formatter:off
|
||||
String HTML =
|
||||
"<HTML>\n" +
|
||||
"<html>\n" +
|
||||
"<HEAD>\n" +
|
||||
"<TITLE>Configure Tool</TITLE>\n" +
|
||||
"<LINK rel=\"stylesheet\" type=\"text/css\" href=\"help/shared/DefaultStyle.css\">\n" +
|
||||
|
@ -297,7 +297,7 @@ public class HelpFileTest extends AbstractHelpTest {
|
|||
" -->" +
|
||||
"\n" +
|
||||
"</BODY>\n" +
|
||||
"</HTML>\n";
|
||||
"</html>\n";
|
||||
//@formatter:on
|
||||
|
||||
Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE);
|
||||
|
|
|
@ -54,9 +54,9 @@ public class ProjectDataTablePanel extends JPanel {
|
|||
public Set<DomainFile> filesPendingSelection;
|
||||
|
||||
private GHtmlLabel capacityExceededText =
|
||||
new GHtmlLabel("<HTML><CENTER><I>Table view disabled for very large projects, or<BR>" +
|
||||
new GHtmlLabel("<html><CENTER><I>Table view disabled for very large projects, or<BR>" +
|
||||
"if an older project/repository filesystem is in use.<BR>" +
|
||||
"View will remain disabled until project is closed.</I></CENTER></HTML>");
|
||||
"View will remain disabled until project is closed.</I></CENTER></html>");
|
||||
|
||||
private GGlassPanePainter painter = new TableGlassPanePainter();
|
||||
|
||||
|
@ -95,7 +95,8 @@ public class ProjectDataTablePanel extends JPanel {
|
|||
checkOpen(e);
|
||||
}
|
||||
});
|
||||
gTable.getSelectionModel().addListSelectionListener(
|
||||
gTable.getSelectionModel()
|
||||
.addListSelectionListener(
|
||||
e -> plugin.getTool().contextChanged(null));
|
||||
gTable.setDefaultRenderer(Date.class, new DateCellRenderer());
|
||||
gTable.setDefaultRenderer(DomainFileType.class, new TypeCellRenderer());
|
||||
|
|
|
@ -89,17 +89,17 @@ public class ProjectDataDeleteAction extends FrontendProjectTreeAction {
|
|||
if (fileCount == 1) {
|
||||
if (!selectedFiles.isEmpty()) {
|
||||
DomainFile file = CollectionUtils.any(selectedFiles);
|
||||
return "<HTML>Are you sure you want to <B><U>permanently</U></B> delete \"" +
|
||||
return "<html>Are you sure you want to <B><U>permanently</U></B> delete \"" +
|
||||
HTMLUtilities.escapeHTML(file.getName()) + "\"?";
|
||||
}
|
||||
|
||||
// only folders are selected, but they contain files
|
||||
return "<HTML>Are you sure you want to <B><U>permanently</U></B> delete the " +
|
||||
return "<html>Are you sure you want to <B><U>permanently</U></B> delete the " +
|
||||
" selected files and folders?";
|
||||
}
|
||||
|
||||
// multiple files selected
|
||||
return "<HTML>Are you sure you want to <B><U>permanently</U></B> delete the " + fileCount +
|
||||
return "<html>Are you sure you want to <B><U>permanently</U></B> delete the " + fileCount +
|
||||
" selected files?";
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class PluginDetailsPanel extends AbstractDetailsPanel {
|
|||
List<PluginDescription> dependencies = model.getDependencies(descriptor);
|
||||
Collections.sort(dependencies, (pd1, pd2) -> pd1.getName().compareTo(pd2.getName()));
|
||||
|
||||
StringBuilder buffer = new StringBuilder("<HTML>");
|
||||
StringBuilder buffer = new StringBuilder("<html>");
|
||||
|
||||
buffer.append("<TABLE cellpadding=2>");
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ class ExtensionDetailsPanel extends AbstractDetailsPanel {
|
|||
return;
|
||||
}
|
||||
|
||||
StringBuilder buffer = new StringBuilder("<HTML>");
|
||||
StringBuilder buffer = new StringBuilder("<html>");
|
||||
buffer.append("<TABLE cellpadding=2>");
|
||||
|
||||
insertRowTitle(buffer, "Name");
|
||||
|
|
|
@ -244,7 +244,7 @@ public class ProgramCompilerSpec extends BasicCompilerSpec {
|
|||
return;
|
||||
}
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
buffer.append("<HTML>User-defined extensions failed to parse: ");
|
||||
buffer.append("<html>User-defined extensions failed to parse: ");
|
||||
buffer.append("<ul>");
|
||||
for (String line : errorList) {
|
||||
buffer.append("<li>").append(line).append("</li>");
|
||||
|
|
|
@ -57,9 +57,9 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
|
|||
|
||||
private void setupDescription() {
|
||||
JLabel label = new GHtmlLabel(
|
||||
"<HTML>Specify the files for converting a new data type archive (.gdt)<BR>" +
|
||||
"<html>Specify the files for converting a new data type archive (.gdt)<BR>" +
|
||||
"to match the IDs of data types in an old data type archive.<BR>" +
|
||||
"The result will be saved to the destination archive.</HTML>");
|
||||
"The result will be saved to the destination archive.</html>");
|
||||
label.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));
|
||||
label.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
add(label, BorderLayout.NORTH);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue