mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +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
|
@ -182,7 +182,7 @@ public class StatusBar extends JPanel {
|
|||
*/
|
||||
public void setStatusText(String text) {
|
||||
// Run this later in case we are in the midst of a Java focus transition, such as when a
|
||||
// dialog is closing. If we don't let the focus transition finish, then we will not
|
||||
// dialog is closing. If we don't let the focus transition finish, then we will not
|
||||
// correctly locate the active window.
|
||||
Swing.runLater(() -> doSetStatusText(text));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue