GT-2853 - remove docking ToolTipManager

This commit is contained in:
dev747368 2019-05-08 12:58:48 -04:00
parent 26b2dfef94
commit 0e8c083f41
44 changed files with 144 additions and 328 deletions

View file

@ -17,11 +17,12 @@ package ghidra;
import java.io.File; import java.io.File;
import javax.swing.ToolTipManager;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import docking.DockingWindowManager; import docking.DockingWindowManager;
import docking.ToolTipManager;
import docking.framework.SplashScreen; import docking.framework.SplashScreen;
import ghidra.base.help.GhidraHelpService; import ghidra.base.help.GhidraHelpService;
import ghidra.framework.Application; import ghidra.framework.Application;
@ -131,9 +132,8 @@ public class GhidraRun implements GhidraLaunchable {
} }
private void initializeTooltips() { private void initializeTooltips() {
ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); int currentDelay = ToolTipManager.sharedInstance().getDismissDelay();
int currentDelay = toolTipManager.getDismissDelay(); ToolTipManager.sharedInstance().setDismissDelay(currentDelay * 2);
toolTipManager.setDismissDelay(currentDelay * 2);
} }
/** /**

View file

@ -25,7 +25,6 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.Document; import javax.swing.text.Document;
import docking.ToolTipManager;
import docking.widgets.OptionDialog; import docking.widgets.OptionDialog;
import docking.widgets.button.GRadioButton; import docking.widgets.button.GRadioButton;
import docking.widgets.checkbox.GCheckBox; import docking.widgets.checkbox.GCheckBox;
@ -198,7 +197,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
infoPanel.add(nameLabel, gridBagConstraints); infoPanel.add(nameLabel, gridBagConstraints);
nameTextField = new JTextField(""); nameTextField = new JTextField("");
ToolTipManager.setToolTipText(nameTextField, "Structure Name"); nameTextField.setToolTipText("Structure Name");
nameTextField.setEditable(true); nameTextField.setEditable(true);
nameTextField.setMargin(TEXTFIELD_INSETS); nameTextField.setMargin(TEXTFIELD_INSETS);
gridBagConstraints.insets = VERTICAL_INSETS; gridBagConstraints.insets = VERTICAL_INSETS;
@ -230,7 +229,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
descriptionTextField = new JTextField(""); descriptionTextField = new JTextField("");
descriptionTextField.setMargin(TEXTFIELD_INSETS); descriptionTextField.setMargin(TEXTFIELD_INSETS);
ToolTipManager.setToolTipText(descriptionTextField, "Structure Description"); descriptionTextField.setToolTipText("Structure Description");
descriptionTextField.setEditable(true); descriptionTextField.setEditable(true);
gridBagConstraints.insets = VERTICAL_INSETS; gridBagConstraints.insets = VERTICAL_INSETS;
gridBagConstraints.anchor = GridBagConstraints.LINE_START; gridBagConstraints.anchor = GridBagConstraints.LINE_START;
@ -261,7 +260,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
categoryStatusTextField = new JTextField(" "); categoryStatusTextField = new JTextField(" ");
categoryStatusTextField.setEditable(false); categoryStatusTextField.setEditable(false);
ToolTipManager.setToolTipText(categoryStatusTextField, categoryStatusTextField.setToolTipText(
"Category of this composite data type."); "Category of this composite data type.");
categoryStatusTextField.setMargin(TEXTFIELD_INSETS); categoryStatusTextField.setMargin(TEXTFIELD_INSETS);
gridBagConstraints.insets = VERTICAL_INSETS; gridBagConstraints.insets = VERTICAL_INSETS;
@ -283,7 +282,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
gridBagConstraints.gridx = 4; gridBagConstraints.gridx = 4;
gridBagConstraints.gridy = 3; gridBagConstraints.gridy = 3;
internalAlignmentCheckBox.setSelected(model.viewComposite.isInternallyAligned()); internalAlignmentCheckBox.setSelected(model.viewComposite.isInternallyAligned());
ToolTipManager.setToolTipText(internalAlignmentCheckBox, internalAlignmentCheckBox.setToolTipText(
"Whether or not the internal components of this structure are aligned."); "Whether or not the internal components of this structure are aligned.");
internalAlignmentCheckBox.setEnabled(true); internalAlignmentCheckBox.setEnabled(true);
if (helpManager != null) { if (helpManager != null) {
@ -401,7 +400,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
"<HTML>" + "Sets this data type to have <B>no</B> minimum alignment<BR>" + "<HTML>" + "Sets this data type to have <B>no</B> minimum alignment<BR>" +
"when aligning this data type inside another data type.<BR>" + "when aligning this data type inside another data type.<BR>" +
"Align this data type based only on its components." + "</HTML>"; "Align this data type based only on its components." + "</HTML>";
ToolTipManager.setToolTipText(defaultMinAlignButton, alignmentToolTip); defaultMinAlignButton.setToolTipText(alignmentToolTip);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(defaultMinAlignButton, new HelpLocation( helpManager.registerHelp(defaultMinAlignButton, new HelpLocation(
provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum")); provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum"));
@ -413,7 +412,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
String alignmentToolTip = "<HTML>" + "Sets this data type to have a minimum alignment<BR>" + String alignmentToolTip = "<HTML>" + "Sets this data type to have a minimum alignment<BR>" +
"that is a multiple of the <B>machine</B> alignment<BR>" + "that is a multiple of the <B>machine</B> alignment<BR>" +
"when aligning this data type inside another data type." + "</HTML>"; "when aligning this data type inside another data type." + "</HTML>";
ToolTipManager.setToolTipText(machineMinAlignButton, alignmentToolTip); machineMinAlignButton.setToolTipText(alignmentToolTip);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(machineMinAlignButton, new HelpLocation( helpManager.registerHelp(machineMinAlignButton, new HelpLocation(
provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum")); provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum"));
@ -425,7 +424,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
String alignmentToolTip = "<HTML>" + "Sets this data type to have a minimum alignment<BR>" + String alignmentToolTip = "<HTML>" + "Sets this data type to have a minimum alignment<BR>" +
"that is a multiple of the <B>specified value</B><BR>" + "that is a multiple of the <B>specified value</B><BR>" +
"when aligning this data type inside another data type." + "</HTML>"; "when aligning this data type inside another data type." + "</HTML>";
ToolTipManager.setToolTipText(byValueMinAlignButton, alignmentToolTip); byValueMinAlignButton.setToolTipText(alignmentToolTip);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(byValueMinAlignButton, new HelpLocation( helpManager.registerHelp(byValueMinAlignButton, new HelpLocation(
provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum")); provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum"));
@ -434,7 +433,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
minAlignValueTextField.setName("Minimum Alignment Value"); minAlignValueTextField.setName("Minimum Alignment Value");
minAlignValueTextField.setEditable(true); minAlignValueTextField.setEditable(true);
minAlignValueTextField.setMargin(TEXTFIELD_INSETS); minAlignValueTextField.setMargin(TEXTFIELD_INSETS);
ToolTipManager.setToolTipText(minAlignValueTextField, alignmentToolTip); minAlignValueTextField.setToolTipText(alignmentToolTip);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(minAlignValueTextField, new HelpLocation( helpManager.registerHelp(minAlignValueTextField, new HelpLocation(
provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum")); provider.getHelpTopic(), provider.getHelpName() + "_" + "AlignMinimum"));
@ -495,13 +494,13 @@ public class CompEditorPanel extends CompositeEditorPanel {
gridBagConstraints.fill = GridBagConstraints.NONE; gridBagConstraints.fill = GridBagConstraints.NONE;
gridBagConstraints.gridx = 2; gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 3; gridBagConstraints.gridy = 3;
ToolTipManager.setToolTipText(actualAlignmentLabel, actualAlignmentToolTip); actualAlignmentLabel.setToolTipText(actualAlignmentToolTip);
actualAlignmentPanel.add(actualAlignmentLabel, BorderLayout.EAST); actualAlignmentPanel.add(actualAlignmentLabel, BorderLayout.EAST);
infoPanel.add(actualAlignmentPanel, gridBagConstraints); infoPanel.add(actualAlignmentPanel, gridBagConstraints);
actualAlignmentValueTextField = new JTextField(8); actualAlignmentValueTextField = new JTextField(8);
actualAlignmentValueTextField.setText("" + ((CompEditorModel) model).getMinimumAlignment()); actualAlignmentValueTextField.setText("" + ((CompEditorModel) model).getMinimumAlignment());
ToolTipManager.setToolTipText(actualAlignmentValueTextField, actualAlignmentToolTip); actualAlignmentValueTextField.setToolTipText(actualAlignmentToolTip);
actualAlignmentValueTextField.setEditable(false); actualAlignmentValueTextField.setEditable(false);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(actualAlignmentValueTextField, new HelpLocation( helpManager.registerHelp(actualAlignmentValueTextField, new HelpLocation(
@ -587,7 +586,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
} }
}); });
ToolTipManager.setToolTipText(noPackingButton, packingToolTipText); noPackingButton.setToolTipText(packingToolTipText);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(noPackingButton, new HelpLocation(provider.getHelpTopic(), helpManager.registerHelp(noPackingButton, new HelpLocation(provider.getHelpTopic(),
provider.getHelpName() + "_" + "PackMaximum")); provider.getHelpName() + "_" + "PackMaximum"));
@ -602,7 +601,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
"Note: An individual data type's alignment may override this value.</HTML>"; "Note: An individual data type's alignment may override this value.</HTML>";
byValuePackingButton.addActionListener(e -> chooseByValuePacking()); byValuePackingButton.addActionListener(e -> chooseByValuePacking());
ToolTipManager.setToolTipText(byValuePackingButton, packingToolTipText); byValuePackingButton.setToolTipText(packingToolTipText);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(byValuePackingButton, new HelpLocation(provider.getHelpTopic(), helpManager.registerHelp(byValuePackingButton, new HelpLocation(provider.getHelpTopic(),
provider.getHelpName() + "_" + "PackMaximum")); provider.getHelpName() + "_" + "PackMaximum"));
@ -630,7 +629,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
} }
}); });
ToolTipManager.setToolTipText(packingValueTextField, packingToolTipText); packingValueTextField.setToolTipText(packingToolTipText);
if (helpManager != null) { if (helpManager != null) {
helpManager.registerHelp(packingValueTextField, new HelpLocation( helpManager.registerHelp(packingValueTextField, new HelpLocation(
provider.getHelpTopic(), provider.getHelpName() + "_" + "PackMaximum")); provider.getHelpTopic(), provider.getHelpName() + "_" + "PackMaximum"));
@ -722,7 +721,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
GridBagConstraints gridBagConstraints = new GridBagConstraints(); GridBagConstraints gridBagConstraints = new GridBagConstraints();
sizeLabel = new GDLabel("Size:"); sizeLabel = new GDLabel("Size:");
ToolTipManager.setToolTipText(sizeLabel, "The current size in bytes."); sizeLabel.setToolTipText("The current size in bytes.");
gridBagConstraints.anchor = GridBagConstraints.LINE_END; gridBagConstraints.anchor = GridBagConstraints.LINE_END;
gridBagConstraints.fill = GridBagConstraints.NONE; gridBagConstraints.fill = GridBagConstraints.NONE;
gridBagConstraints.gridx = 0; gridBagConstraints.gridx = 0;
@ -732,7 +731,7 @@ public class CompEditorPanel extends CompositeEditorPanel {
sizeStatusTextField = new JTextField(10); sizeStatusTextField = new JTextField(10);
sizeStatusTextField.setName("Total Length"); sizeStatusTextField.setName("Total Length");
sizeStatusTextField.setEditable(false); sizeStatusTextField.setEditable(false);
ToolTipManager.setToolTipText(sizeStatusTextField, "The current size in bytes."); sizeStatusTextField.setToolTipText("The current size in bytes.");
sizeStatusTextField.setMargin(TEXTFIELD_INSETS); sizeStatusTextField.setMargin(TEXTFIELD_INSETS);
gridBagConstraints.ipadx = 60; gridBagConstraints.ipadx = 60;
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;

View file

@ -32,7 +32,6 @@ import javax.swing.event.ChangeEvent;
import javax.swing.table.*; import javax.swing.table.*;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
import docking.ToolTipManager;
import docking.action.DockingActionIf; import docking.action.DockingActionIf;
import docking.dnd.*; import docking.dnd.*;
import docking.help.Help; import docking.help.Help;
@ -647,10 +646,10 @@ public abstract class CompositeEditorPanel extends JPanel
messageWidth = fm.stringWidth(text); messageWidth = fm.stringWidth(text);
} }
if (messageWidth > statusLabel.getWidth()) { if (messageWidth > statusLabel.getWidth()) {
ToolTipManager.setToolTipText(statusLabel, text); statusLabel.setToolTipText(text);
} }
else { else {
ToolTipManager.setToolTipText(statusLabel, "Editor messages appear here."); statusLabel.setToolTipText("Editor messages appear here.");
} }
} }

View file

@ -25,7 +25,6 @@ import javax.swing.event.DocumentListener;
import docking.ActionContext; import docking.ActionContext;
import docking.DialogComponentProvider; import docking.DialogComponentProvider;
import docking.ToolTipManager;
import docking.action.*; import docking.action.*;
import docking.widgets.checkbox.GCheckBox; import docking.widgets.checkbox.GCheckBox;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
@ -126,7 +125,7 @@ public class AddressTableDialog extends DialogComponentProvider {
JPanel makeTablePanel = new JPanel(new FlowLayout()); JPanel makeTablePanel = new JPanel(new FlowLayout());
makeTableButton = new JButton("Make Table"); makeTableButton = new JButton("Make Table");
ToolTipManager.setToolTipText(makeTableButton, makeTableButton.setToolTipText(
"Make a table of addresses at the selected location(s)."); "Make a table of addresses at the selected location(s).");
makeTablePanel.add(makeTableButton); makeTablePanel.add(makeTableButton);
makeTableButton.setEnabled(false); makeTableButton.setEnabled(false);
@ -134,7 +133,7 @@ public class AddressTableDialog extends DialogComponentProvider {
JPanel disassemblePanel = new JPanel(new FlowLayout()); JPanel disassemblePanel = new JPanel(new FlowLayout());
disassembleTableButton = new JButton("Disassemble"); disassembleTableButton = new JButton("Disassemble");
ToolTipManager.setToolTipText(disassembleTableButton, disassembleTableButton.setToolTipText(
"Disassemble at all locations pointed to by the selected address table(s) members."); "Disassemble at all locations pointed to by the selected address table(s) members.");
disassembleTableButton.setEnabled(false); disassembleTableButton.setEnabled(false);
disassemblePanel.add(disassembleTableButton); disassemblePanel.add(disassembleTableButton);
@ -152,7 +151,7 @@ public class AddressTableDialog extends DialogComponentProvider {
searchOptionsPanel.setBorder(BorderFactory.createTitledBorder("Search Options")); searchOptionsPanel.setBorder(BorderFactory.createTitledBorder("Search Options"));
JLabel minLengthLabel = new GLabel("Minimum Length: "); JLabel minLengthLabel = new GLabel("Minimum Length: ");
ToolTipManager.setToolTipText(minLengthLabel, minLengthLabel.setToolTipText(
"The minimum number of consecutive addresses that will make an address table."); "The minimum number of consecutive addresses that will make an address table.");
minLengthField = new JTextField(5); minLengthField = new JTextField(5);
minLengthField.setName("Minimum Length"); minLengthField.setName("Minimum Length");
@ -165,7 +164,7 @@ public class AddressTableDialog extends DialogComponentProvider {
alignLabel = new GDLabel("Alignment: "); alignLabel = new GDLabel("Alignment: ");
alignField = new JTextField(5); alignField = new JTextField(5);
alignField.setName("Alignment"); alignField.setName("Alignment");
ToolTipManager.setToolTipText(alignLabel, alignLabel.setToolTipText(
"Alignment that address tables and what they are pointing to must satisfy."); "Alignment that address tables and what they are pointing to must satisfy.");
int align = plugin.getProgram().getLanguage().getInstructionAlignment(); int align = plugin.getProgram().getLanguage().getInstructionAlignment();
if (PseudoDisassembler.hasLowBitCodeModeInAddrValues(plugin.getProgram())) { if (PseudoDisassembler.hasLowBitCodeModeInAddrValues(plugin.getProgram())) {
@ -176,7 +175,7 @@ public class AddressTableDialog extends DialogComponentProvider {
skipLabel = new GDLabel("Skip Length: "); skipLabel = new GDLabel("Skip Length: ");
skipField = new JTextField(5); skipField = new JTextField(5);
skipField.setName("Skip"); skipField.setName("Skip");
ToolTipManager.setToolTipText(skipLabel, skipLabel.setToolTipText(
"Number of bytes to skip between found addresses in a table."); "Number of bytes to skip between found addresses in a table.");
skipField.setText("0"); skipField.setText("0");
@ -195,7 +194,7 @@ public class AddressTableDialog extends DialogComponentProvider {
selectionButton = new GCheckBox("Search Selection"); selectionButton = new GCheckBox("Search Selection");
selectionButton.setSelected(false); selectionButton.setSelected(false);
ToolTipManager.setToolTipText(selectionButton, selectionButton.setToolTipText(
"If checked, search only the current selection."); "If checked, search only the current selection.");
JPanel searchOptionsWestPanel = new JPanel(new GridLayout(2, 1)); JPanel searchOptionsWestPanel = new JPanel(new GridLayout(2, 1));
searchOptionsWestPanel.add(selectionButton); searchOptionsWestPanel.add(selectionButton);
@ -213,7 +212,7 @@ public class AddressTableDialog extends DialogComponentProvider {
shiftedAddressButton.setVisible(false); shiftedAddressButton.setVisible(false);
} }
ToolTipManager.setToolTipText(shiftedAddressButton, shiftedAddressButton.setToolTipText(
"Search for tables of four byte values that when shifted left by two, are valid " + "Search for tables of four byte values that when shifted left by two, are valid " +
"addresses in the current program."); "addresses in the current program.");
searchOptionsWestPanel.add(shiftedAddressButton); searchOptionsWestPanel.add(shiftedAddressButton);
@ -230,11 +229,11 @@ public class AddressTableDialog extends DialogComponentProvider {
autoLabelCB = new GCheckBox("Auto Label"); autoLabelCB = new GCheckBox("Auto Label");
autoLabelCB.setSelected(true); autoLabelCB.setSelected(true);
autoLabelCB.setEnabled(false); autoLabelCB.setEnabled(false);
ToolTipManager.setToolTipText(autoLabelCB, autoLabelCB.setToolTipText(
"Label the top of the address table and all members of the table."); "Label the top of the address table and all members of the table.");
offsetLabel = new GDLabel("Offset: "); offsetLabel = new GDLabel("Offset: ");
ToolTipManager.setToolTipText(offsetLabel, offsetLabel.setToolTipText(
"Offset from the beginning of the selected table(s)"); "Offset from the beginning of the selected table(s)");
offsetLabel.setEnabled(false); offsetLabel.setEnabled(false);
@ -243,7 +242,7 @@ public class AddressTableDialog extends DialogComponentProvider {
viewOffset = new HintTextField(20); viewOffset = new HintTextField(20);
viewOffset.setName("viewOffset"); viewOffset.setName("viewOffset");
ToolTipManager.setToolTipText(viewOffset, viewOffset.setToolTipText(
"Address of the selected table starting at the given offset"); "Address of the selected table starting at the given offset");
viewOffset.setHintText("table start address"); viewOffset.setHintText("table start address");
viewOffset.showHint(); viewOffset.showHint();
@ -257,8 +256,7 @@ public class AddressTableDialog extends DialogComponentProvider {
offsetField = new JTextField(2); offsetField = new JTextField(2);
offsetField.setName("offset"); offsetField.setName("offset");
ToolTipManager.setToolTipText(offsetField, offsetField.setToolTipText("Offset from the beginning of the selected table(s)");
"Offset from the beginning of the selected table(s)");
offsetField.setText("0"); offsetField.setText("0");
offsetField.setEnabled(false); offsetField.setEnabled(false);
offsetField.addActionListener( offsetField.addActionListener(

View file

@ -26,7 +26,6 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import docking.DialogComponentProvider; import docking.DialogComponentProvider;
import docking.ToolTipManager;
import docking.widgets.button.GRadioButton; 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;
@ -239,7 +238,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
model.defaultSelected(); model.defaultSelected();
} }
}); });
ToolTipManager.setToolTipText(defaultRB, "Use default fallthrough address"); defaultRB.setToolTipText("Use default fallthrough address");
userRB = new GRadioButton("User", false); userRB = new GRadioButton("User", false);
userRB.addActionListener(new ActionListener() { userRB.addActionListener(new ActionListener() {
@ -248,7 +247,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
model.userSelected(); model.userSelected();
} }
}); });
ToolTipManager.setToolTipText(userRB, "Override default fallthrough address"); userRB.setToolTipText("Override default fallthrough address");
group.add(defaultRB); group.add(defaultRB);
group.add(userRB); group.add(userRB);
@ -273,7 +272,7 @@ class FallThroughDialog extends DialogComponentProvider implements ChangeListene
else { else {
button = new JButton(altText); button = new JButton(altText);
} }
ToolTipManager.setToolTipText(button, "Go back to home address"); button.setToolTipText("Go back to home address");
return button; return button;
} }

View file

@ -20,11 +20,11 @@ import java.awt.event.*;
import java.util.Iterator; import java.util.Iterator;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ToolTipManager;
import org.jdesktop.animation.timing.Animator; import org.jdesktop.animation.timing.Animator;
import docking.DockingWindowManager; import docking.DockingWindowManager;
import docking.ToolTipManager;
import docking.util.AnimationUtils; import docking.util.AnimationUtils;
import docking.util.SwingAnimationCallback; import docking.util.SwingAnimationCallback;
import ghidra.program.model.address.*; import ghidra.program.model.address.*;

View file

@ -22,7 +22,7 @@ import java.util.List;
import javax.swing.*; import javax.swing.*;
import docking.ToolTipManager; import docking.DockingUtils;
import docking.widgets.PopupWindow; import docking.widgets.PopupWindow;
import docking.widgets.fieldpanel.field.Field; import docking.widgets.fieldpanel.field.Field;
import docking.widgets.fieldpanel.support.FieldLocation; import docking.widgets.fieldpanel.support.FieldLocation;
@ -104,7 +104,7 @@ public abstract class AbstractHoverProvider implements HoverProvider {
activeHoverService = null; activeHoverService = null;
lastField = null; lastField = null;
ToolTipManager.sharedInstance().hideTipWindow(); DockingUtils.hideTipWindow();
if (popupWindow != null) { if (popupWindow != null) {
popupWindow.dispose(); popupWindow.dispose();

View file

@ -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.
@ -20,6 +19,7 @@ import java.awt.Graphics;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ToolTipManager;
/** /**
* Panel to display markers. Normally placed to the left hand side * Panel to display markers. Normally placed to the left hand side
@ -33,7 +33,7 @@ public class MarkerPanel extends JPanel {
super(); super();
this.manager = manager; this.manager = manager;
docking.ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().registerComponent(this);
} }
@Override @Override

View file

@ -22,10 +22,8 @@ import java.math.BigInteger;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.swing.JComponent; import javax.swing.*;
import javax.swing.JPanel;
import docking.ToolTipManager;
import docking.action.DockingActionIf; import docking.action.DockingActionIf;
import docking.help.Help; import docking.help.Help;
import ghidra.app.services.GoToService; import ghidra.app.services.GoToService;

View file

@ -28,7 +28,6 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import docking.ActionContext; import docking.ActionContext;
import docking.ToolTipManager;
import docking.action.DockingAction; import docking.action.DockingAction;
import docking.action.MenuData; import docking.action.MenuData;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
@ -99,7 +98,7 @@ public class ShowInstructionInfoPlugin extends ProgramPlugin {
instructionLabel = new GDLabel(" "); instructionLabel = new GDLabel(" ");
instructionPanel.setPreferredSize( instructionPanel.setPreferredSize(
new Dimension(200, instructionLabel.getPreferredSize().height)); new Dimension(200, instructionLabel.getPreferredSize().height));
ToolTipManager.setToolTipText(instructionLabel, CURRENT_INSTRUCTION_PREPEND_STRING); instructionLabel.setToolTipText(CURRENT_INSTRUCTION_PREPEND_STRING);
instructionPanel.add(instructionLabel); instructionPanel.add(instructionLabel);
instructionPanel.setName("Current Instruction"); instructionPanel.setName("Current Instruction");
tool.addStatusComponent(instructionPanel, true, false); tool.addStatusComponent(instructionPanel, true, false);
@ -117,7 +116,7 @@ public class ShowInstructionInfoPlugin extends ProgramPlugin {
} }
}); });
functionPanel.setPreferredSize(new Dimension(130, functionLabel.getPreferredSize().height)); functionPanel.setPreferredSize(new Dimension(130, functionLabel.getPreferredSize().height));
ToolTipManager.setToolTipText(functionLabel, "Current Function"); functionLabel.setToolTipText("Current Function");
functionPanel.add(functionLabel); functionPanel.add(functionLabel);
functionPanel.setName("Current Function"); functionPanel.setName("Current Function");
tool.addStatusComponent(functionPanel, true, false); tool.addStatusComponent(functionPanel, true, false);
@ -125,7 +124,7 @@ public class ShowInstructionInfoPlugin extends ProgramPlugin {
addressPanel = new JPanel(new BorderLayout()); addressPanel = new JPanel(new BorderLayout());
addressLabel = new GDLabel(" "); addressLabel = new GDLabel(" ");
addressPanel.setPreferredSize(new Dimension(95, addressLabel.getPreferredSize().height)); addressPanel.setPreferredSize(new Dimension(95, addressLabel.getPreferredSize().height));
ToolTipManager.setToolTipText(addressLabel, "Current Address"); addressLabel.setToolTipText("Current Address");
addressPanel.add(addressLabel); addressPanel.add(addressLabel);
addressPanel.setName("Current Address"); addressPanel.setName("Current Address");
tool.addStatusComponent(addressPanel, true, false); tool.addStatusComponent(addressPanel, true, false);
@ -338,25 +337,25 @@ public class ShowInstructionInfoPlugin extends ProgramPlugin {
boolean insideFunction = currentFunction != null; boolean insideFunction = currentFunction != null;
if (insideFunction) { if (insideFunction) {
functionLabel.setText(" " + currentFunction.getName() + " "); functionLabel.setText(" " + currentFunction.getName() + " ");
ToolTipManager.setToolTipText(functionLabel, functionLabel.setToolTipText(
currentFunction.getName() + CURRENT_FUNCTION_APPEND_STRING); currentFunction.getName() + CURRENT_FUNCTION_APPEND_STRING);
} }
else { else {
functionLabel.setText(""); functionLabel.setText("");
ToolTipManager.setToolTipText(functionLabel, ""); functionLabel.setToolTipText("");
} }
/// code added // /// code added //
Instruction instr = getInstructionForCurrentProgram(); Instruction instr = getInstructionForCurrentProgram();
if (instr == null) { if (instr == null) {
instructionLabel.setText(""); instructionLabel.setText("");
ToolTipManager.setToolTipText(instructionLabel, ""); instructionLabel.setToolTipText("");
return; return;
} }
String representation = instr.toString(); String representation = instr.toString();
instructionLabel.setText(" " + representation + " "); instructionLabel.setText(" " + representation + " ");
ToolTipManager.setToolTipText(instructionLabel, instructionLabel.setToolTipText(
CURRENT_INSTRUCTION_PREPEND_STRING + representation); CURRENT_INSTRUCTION_PREPEND_STRING + representation);
// end code added /// // end code added ///
@ -381,7 +380,7 @@ public class ShowInstructionInfoPlugin extends ProgramPlugin {
@Override @Override
protected void programDeactivated(Program program) { protected void programDeactivated(Program program) {
instructionLabel.setText(""); instructionLabel.setText("");
ToolTipManager.setToolTipText(instructionLabel, ""); instructionLabel.setToolTipText("");
if (connectedProvider != null) { if (connectedProvider != null) {
connectedProvider.setProgram(null); connectedProvider.setProgram(null);
} }

View file

@ -15,21 +15,19 @@
*/ */
package ghidra.app.plugin.core.progmgr; package ghidra.app.plugin.core.progmgr;
import java.awt.Dimension;
import java.awt.Graphics;
import java.util.Iterator;
import java.util.List;
import javax.swing.*;
import ghidra.framework.data.DomainObjectAdapterDB; import ghidra.framework.data.DomainObjectAdapterDB;
import ghidra.framework.model.Transaction; import ghidra.framework.model.Transaction;
import ghidra.framework.model.TransactionListener; import ghidra.framework.model.TransactionListener;
import ghidra.program.database.ProgramDB; import ghidra.program.database.ProgramDB;
import ghidra.program.model.listing.Program; import ghidra.program.model.listing.Program;
import ghidra.util.HTMLUtilities; import ghidra.util.HTMLUtilities;
import java.awt.Dimension;
import java.awt.Graphics;
import java.util.Iterator;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import resources.ResourceManager; import resources.ResourceManager;
class TransactionMonitor extends JComponent implements TransactionListener { class TransactionMonitor extends JComponent implements TransactionListener {
@ -44,7 +42,7 @@ class TransactionMonitor extends JComponent implements TransactionListener {
super(); super();
busyIcon = ResourceManager.loadImage("images/editbytes.gif"); busyIcon = ResourceManager.loadImage("images/editbytes.gif");
prefSize = new Dimension(busyIcon.getIconWidth(), busyIcon.getIconHeight()); prefSize = new Dimension(busyIcon.getIconWidth(), busyIcon.getIconHeight());
docking.ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().registerComponent(this);
} }
void setProgram(Program p) { void setProgram(Program p) {

View file

@ -22,7 +22,6 @@ import java.util.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
import docking.ToolTipManager;
import docking.widgets.GComponent; import docking.widgets.GComponent;
import ghidra.program.model.listing.Group; import ghidra.program.model.listing.Group;
import resources.ResourceManager; import resources.ResourceManager;
@ -163,12 +162,12 @@ class DnDTreeCellRenderer extends DefaultTreeCellRenderer {
setBackgroundSelectionColor(defaultSelectionColor); setBackgroundSelectionColor(defaultSelectionColor);
setBackgroundNonSelectionColor(defaultNonSelectionColor); setBackgroundNonSelectionColor(defaultNonSelectionColor);
} }
ToolTipManager.setToolTipText(this, null); setToolTipText(null);
} }
else { else {
setBackgroundSelectionColor(defaultSelectionColor); setBackgroundSelectionColor(defaultSelectionColor);
setBackgroundNonSelectionColor(defaultNonSelectionColor); setBackgroundNonSelectionColor(defaultNonSelectionColor);
ToolTipManager.setToolTipText(this, dtree.getToolTipText(node)); setToolTipText(dtree.getToolTipText(node));
} }
} }

View file

@ -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.
@ -85,7 +84,7 @@ public abstract class DragNDropTree extends JTree implements Draggable, Droppabl
plafSelectionColor = dndCellRenderer.getBackgroundSelectionColor(); plafSelectionColor = dndCellRenderer.getBackgroundSelectionColor();
nonSelectionDragColor = new Color(204, 204, 255); nonSelectionDragColor = new Color(204, 204, 255);
initDragNDrop(); initDragNDrop();
docking.ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().registerComponent(this);
autoscroller = new AutoscrollAdapter(this, getRowHeight()); autoscroller = new AutoscrollAdapter(this, getRowHeight());
disableJTreeTransferActions(); disableJTreeTransferActions();
} }

View file

@ -25,7 +25,6 @@ import javax.swing.border.*;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import docking.ToolTipManager;
import docking.widgets.combobox.GhidraComboBox; import docking.widgets.combobox.GhidraComboBox;
import docking.widgets.label.GLabel; import docking.widgets.label.GLabel;
import ghidra.app.util.AddressInput; import ghidra.app.util.AddressInput;
@ -103,7 +102,7 @@ class EditExternalReferencePanel extends EditReferencePanel {
extLibPath.setFocusable(false); extLibPath.setFocusable(false);
clearButton = new JButton("Clear"); clearButton = new JButton("Clear");
ToolTipManager.setToolTipText(clearButton, "Remove Link to External Program"); clearButton.setToolTipText("Remove Link to External Program");
clearButton.addActionListener(new ActionListener() { clearButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -112,7 +111,7 @@ class EditExternalReferencePanel extends EditReferencePanel {
}); });
editButton = new JButton("Edit"); editButton = new JButton("Edit");
ToolTipManager.setToolTipText(editButton, "Edit Link to External Program"); editButton.setToolTipText("Edit Link to External Program");
editButton.addActionListener(new ActionListener() { editButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

View file

@ -668,7 +668,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
col.setMaxWidth(80); col.setMaxWidth(80);
col.setResizable(false); col.setResizable(false);
docking.ToolTipManager.sharedInstance().registerComponent(refsTable); ToolTipManager.sharedInstance().registerComponent(refsTable);
dropTargetAdapter = new DropTgtAdapter(dropHandler, DnDConstants.ACTION_COPY_OR_MOVE, dropTargetAdapter = new DropTgtAdapter(dropHandler, DnDConstants.ACTION_COPY_OR_MOVE,
ACCEPTABLE_DROP_FLAVORS); ACCEPTABLE_DROP_FLAVORS);

View file

@ -146,7 +146,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
JScrollPane sp = new JScrollPane(table); JScrollPane sp = new JScrollPane(table);
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
docking.ToolTipManager.sharedInstance().registerComponent(table); ToolTipManager.sharedInstance().registerComponent(table);
panel.add(sp, BorderLayout.CENTER); panel.add(sp, BorderLayout.CENTER);

View file

@ -86,7 +86,7 @@ class RelocationProvider extends ComponentProviderAdapter {
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN); table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
docking.ToolTipManager.sharedInstance().registerComponent(table); ToolTipManager.sharedInstance().registerComponent(table);
panel.add(threadedPanel, BorderLayout.CENTER); panel.add(threadedPanel, BorderLayout.CENTER);

View file

@ -26,7 +26,6 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import docking.DockingWindowManager; import docking.DockingWindowManager;
import docking.ToolTipManager;
import docking.widgets.OptionDialog; import docking.widgets.OptionDialog;
import docking.widgets.checkbox.GCheckBox; import docking.widgets.checkbox.GCheckBox;
import docking.widgets.combobox.GhidraComboBox; import docking.widgets.combobox.GhidraComboBox;
@ -155,11 +154,11 @@ class EditExternalLocationPanel extends JPanel {
extLibPathTextField.setFocusable(false); extLibPathTextField.setFocusable(false);
clearButton = new JButton("Clear"); clearButton = new JButton("Clear");
ToolTipManager.setToolTipText(clearButton, "Remove Link to External Program"); clearButton.setToolTipText("Remove Link to External Program");
clearButton.addActionListener(e -> extLibPathTextField.setText(null)); clearButton.addActionListener(e -> extLibPathTextField.setText(null));
editButton = new JButton("Edit"); editButton = new JButton("Edit");
ToolTipManager.setToolTipText(editButton, "Edit Link to External Program"); editButton.setToolTipText("Edit Link to External Program");
editButton.addActionListener(e -> popupProgramChooser()); editButton.addActionListener(e -> popupProgramChooser());
JPanel pathPanel = new JPanel(new BorderLayout()); JPanel pathPanel = new JPanel(new BorderLayout());

View file

@ -19,9 +19,9 @@ import java.awt.Component;
import java.beans.PropertyEditorSupport; import java.beans.PropertyEditorSupport;
import java.math.BigInteger; import java.math.BigInteger;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import docking.ToolTipManager;
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;
@ -63,9 +63,9 @@ public class AddressFieldOptionsPropertyEditor extends PropertyEditorSupport
private AddressFieldOptionsWrappedOption addressFieldOptionsWrappedOption; private AddressFieldOptionsWrappedOption addressFieldOptionsWrappedOption;
private Component editorComponent; private Component editorComponent;
private JCheckBox padCheckBox; private GCheckBox padCheckBox;
private IntegerTextField minDigitsField; private IntegerTextField minDigitsField;
private JCheckBox showBlocknameCheckbox; private GCheckBox showBlocknameCheckbox;
private GhidraComboBox<String> justificationCombobox; private GhidraComboBox<String> justificationCombobox;
public AddressFieldOptionsPropertyEditor() { public AddressFieldOptionsPropertyEditor() {
@ -76,38 +76,38 @@ public class AddressFieldOptionsPropertyEditor extends PropertyEditorSupport
// we want to have a panel with our options so that we may group them together // we want to have a panel with our options so that we may group them together
JPanel panel = new JPanel(new PairLayout(6, 10)); JPanel panel = new JPanel(new PairLayout(6, 10));
JLabel label = new GDLabel(SHOW_BLOCK_NAME_LABEL, SwingConstants.RIGHT); GDLabel label = new GDLabel(SHOW_BLOCK_NAME_LABEL, SwingConstants.RIGHT);
ToolTipManager.setToolTipText(label, SHOW_BLOCKNAME_TOOLTIP); label.setToolTipText(SHOW_BLOCKNAME_TOOLTIP);
panel.add(label); panel.add(label);
showBlocknameCheckbox = new GCheckBox(); showBlocknameCheckbox = new GCheckBox();
ToolTipManager.setToolTipText(showBlocknameCheckbox, SHOW_BLOCKNAME_TOOLTIP); showBlocknameCheckbox.setToolTipText(SHOW_BLOCKNAME_TOOLTIP);
panel.add(showBlocknameCheckbox); panel.add(showBlocknameCheckbox);
// the namespace checkbox will disable the text field options when it is not used // the namespace checkbox will disable the text field options when it is not used
label = new GDLabel(PADDING_LABEL, SwingConstants.RIGHT); label = new GDLabel(PADDING_LABEL, SwingConstants.RIGHT);
ToolTipManager.setToolTipText(label, ADDRESS_PADDING_TOOLTIP); label.setToolTipText(ADDRESS_PADDING_TOOLTIP);
panel.add(label); panel.add(label);
padCheckBox = new GCheckBox(); padCheckBox = new GCheckBox();
panel.add(padCheckBox); panel.add(padCheckBox);
padCheckBox.setSelected(false); padCheckBox.setSelected(false);
ToolTipManager.setToolTipText(padCheckBox, ADDRESS_PADDING_TOOLTIP); padCheckBox.setToolTipText(ADDRESS_PADDING_TOOLTIP);
label = new GDLabel(ADDRESS_DIGITS_LABEL, SwingConstants.RIGHT); label = new GDLabel(ADDRESS_DIGITS_LABEL, SwingConstants.RIGHT);
ToolTipManager.setToolTipText(label, MIN_HEX_DIGITS_TOOLTIP); label.setToolTipText(MIN_HEX_DIGITS_TOOLTIP);
panel.add(label); panel.add(label);
minDigitsField = new IntegerTextField(2); minDigitsField = new IntegerTextField(2);
minDigitsField.setAllowNegativeValues(false); minDigitsField.setAllowNegativeValues(false);
minDigitsField.setDecimalMode(); minDigitsField.setDecimalMode();
minDigitsField.setMaxValue(BigInteger.valueOf(32)); minDigitsField.setMaxValue(BigInteger.valueOf(32));
ToolTipManager.setToolTipText(minDigitsField.getComponent(), MIN_HEX_DIGITS_TOOLTIP); minDigitsField.getComponent().setToolTipText(MIN_HEX_DIGITS_TOOLTIP);
panel.add(minDigitsField.getComponent()); panel.add(minDigitsField.getComponent());
label = new GDLabel(JUSTIFICATION_LABEL, SwingConstants.RIGHT); label = new GDLabel(JUSTIFICATION_LABEL, SwingConstants.RIGHT);
ToolTipManager.setToolTipText(label, RIGHT_JUSTIFY_TOOLTIP); label.setToolTipText(RIGHT_JUSTIFY_TOOLTIP);
panel.add(label); panel.add(label);
justificationCombobox = new GhidraComboBox<>(new String[] { "Left", "Right" }); justificationCombobox = new GhidraComboBox<>(new String[] { "Left", "Right" });
ToolTipManager.setToolTipText(justificationCombobox, RIGHT_JUSTIFY_TOOLTIP); justificationCombobox.setToolTipText(RIGHT_JUSTIFY_TOOLTIP);
panel.add(justificationCombobox); panel.add(justificationCombobox);
showBlocknameCheckbox.addItemListener(evt -> firePropertyChange()); showBlocknameCheckbox.addItemListener(evt -> firePropertyChange());

View file

@ -26,7 +26,6 @@ import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import docking.ToolTipManager;
import docking.widgets.checkbox.GCheckBox; import docking.widgets.checkbox.GCheckBox;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
import docking.widgets.textfield.IntegerTextField; import docking.widgets.textfield.IntegerTextField;
@ -69,13 +68,13 @@ public class ArrayElementPropertyEditor extends PropertyEditorSupport
// the namespace checkbox will disable the text field options when it is not used // the namespace checkbox will disable the text field options when it is not used
groupElementsCheckBox = new GCheckBox(SHOW_MULTI_ELEMENTS_LABEL); groupElementsCheckBox = new GCheckBox(SHOW_MULTI_ELEMENTS_LABEL);
groupElementsCheckBox.setSelected(true); groupElementsCheckBox.setSelected(true);
ToolTipManager.setToolTipText(groupElementsCheckBox, SHOW_MULTI_ELEMENTS_TOOLTIP); groupElementsCheckBox.setToolTipText(SHOW_MULTI_ELEMENTS_TOOLTIP);
panel.add(groupElementsCheckBox); panel.add(groupElementsCheckBox);
elementsPerLineField = elementsPerLineField =
createLocalPrefixTextField(GROUP_SIZE_LABEL, GROUP_SIZE_LABEL_TOOLTIP, panel); createLocalPrefixTextField(GROUP_SIZE_LABEL, GROUP_SIZE_LABEL_TOOLTIP, panel);
ToolTipManager.setToolTipText(elementsLabel, GROUP_SIZE_LABEL_TOOLTIP); elementsLabel.setToolTipText(GROUP_SIZE_LABEL_TOOLTIP);
groupElementsCheckBox.addItemListener(new ItemListener() { groupElementsCheckBox.addItemListener(new ItemListener() {
@Override @Override

View file

@ -24,7 +24,6 @@ import javax.swing.border.TitledBorder;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import docking.ToolTipManager;
import docking.widgets.checkbox.GCheckBox; import docking.widgets.checkbox.GCheckBox;
import ghidra.framework.options.CustomOptionsEditor; import ghidra.framework.options.CustomOptionsEditor;
import ghidra.util.HTMLUtilities; import ghidra.util.HTMLUtilities;
@ -76,15 +75,15 @@ public class NamespacePropertyEditor extends PropertyEditorSupport implements Cu
// the namespace checkbox will disable the text field options when it is not used // the namespace checkbox will disable the text field options when it is not used
showNonLocalCheckBox = new GCheckBox(DISPLAY_NON_LOCAL_NAMESPACE_LABEL); showNonLocalCheckBox = new GCheckBox(DISPLAY_NON_LOCAL_NAMESPACE_LABEL);
showNonLocalCheckBox.setSelected(false); showNonLocalCheckBox.setSelected(false);
ToolTipManager.setToolTipText(showNonLocalCheckBox, SHOW_NON_LOCAL_NAMESPACE_TOOLTIP); showNonLocalCheckBox.setToolTipText(SHOW_NON_LOCAL_NAMESPACE_TOOLTIP);
showLocalCheckBox = new GCheckBox(DISPLAY_LOCAL_NAMESPACE_LABEL); showLocalCheckBox = new GCheckBox(DISPLAY_LOCAL_NAMESPACE_LABEL);
showLocalCheckBox.setSelected(false); showLocalCheckBox.setSelected(false);
ToolTipManager.setToolTipText(showLocalCheckBox, SHOW_LOCAL_NAMESPACE_TOOLTIP); showLocalCheckBox.setToolTipText(SHOW_LOCAL_NAMESPACE_TOOLTIP);
showLibraryInNamespaceCheckBox = new GCheckBox(DISPLAY_LIBRARY_IN_NAMESPACE_LABEL); showLibraryInNamespaceCheckBox = new GCheckBox(DISPLAY_LIBRARY_IN_NAMESPACE_LABEL);
showLibraryInNamespaceCheckBox.setSelected(true); showLibraryInNamespaceCheckBox.setSelected(true);
ToolTipManager.setToolTipText(showLocalCheckBox, SHOW_LIBRARY_IN_NAMESPACE_TOOLTIP); showLocalCheckBox.setToolTipText(SHOW_LIBRARY_IN_NAMESPACE_TOOLTIP);
panel.add(showNonLocalCheckBox); panel.add(showNonLocalCheckBox);
panel.add(showLocalCheckBox); panel.add(showLocalCheckBox);
@ -118,7 +117,7 @@ public class NamespacePropertyEditor extends PropertyEditorSupport implements Cu
textFieldPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); textFieldPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
useLocalPrefixCheckBox = new GCheckBox("Use Local Namespace Override"); useLocalPrefixCheckBox = new GCheckBox("Use Local Namespace Override");
ToolTipManager.setToolTipText(useLocalPrefixCheckBox, tooltipText); useLocalPrefixCheckBox.setToolTipText(tooltipText);
useLocalPrefixCheckBox.addItemListener(e -> { useLocalPrefixCheckBox.addItemListener(e -> {
textField.setEnabled(useLocalPrefixCheckBox.isSelected()); textField.setEnabled(useLocalPrefixCheckBox.isSelected());
firePropertyChange(); firePropertyChange();

View file

@ -27,7 +27,6 @@ import javax.swing.border.BevelBorder;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import docking.ToolTipManager;
import docking.widgets.combobox.GComboBox; import docking.widgets.combobox.GComboBox;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
import ghidra.framework.options.CustomOptionsEditor; import ghidra.framework.options.CustomOptionsEditor;
@ -206,15 +205,15 @@ public class ManualViewerCommandEditor extends PropertyEditorSupport
workPanel.setLayout(new PairLayout()); workPanel.setLayout(new PairLayout());
JLabel commandLabel = new GDLabel(COMMAND_STRING_LABEL); JLabel commandLabel = new GDLabel(COMMAND_STRING_LABEL);
ToolTipManager.setToolTipText(commandLabel, COMMAND_STRING_DESCRIPTION); commandLabel.setToolTipText(COMMAND_STRING_DESCRIPTION);
commandField = new JTextField(30); commandField = new JTextField(30);
JLabel argumentsLabel = new GDLabel(COMMAND_ARGUMENTS_LABEL); JLabel argumentsLabel = new GDLabel(COMMAND_ARGUMENTS_LABEL);
ToolTipManager.setToolTipText(argumentsLabel, COMMAND_ARGUMENTS_DESCRIPTION); argumentsLabel.setToolTipText(COMMAND_ARGUMENTS_DESCRIPTION);
argumentsField = new JTextField(20); argumentsField = new JTextField(20);
JLabel formatLabel = new GDLabel(FILE_FORMAT_LABEL); JLabel formatLabel = new GDLabel(FILE_FORMAT_LABEL);
ToolTipManager.setToolTipText(formatLabel, FILE_FORMAT_DESCRIPTION); formatLabel.setToolTipText(FILE_FORMAT_DESCRIPTION);
fileFormatComboBox = new GComboBox<>(); fileFormatComboBox = new GComboBox<>();
fileFormatComboBox.addItem( fileFormatComboBox.addItem(
ManualViewerCommandWrappedOption.HTTP_URL_REPLACEMENT_STRING); ManualViewerCommandWrappedOption.HTTP_URL_REPLACEMENT_STRING);

View file

@ -25,7 +25,6 @@ import javax.swing.border.TitledBorder;
import docking.DialogComponentProvider; import docking.DialogComponentProvider;
import docking.DockingUtils; import docking.DockingUtils;
import docking.ToolTipManager;
import docking.widgets.checkbox.GCheckBox; import docking.widgets.checkbox.GCheckBox;
import ghidra.program.model.address.*; import ghidra.program.model.address.*;
import ghidra.program.model.listing.Program; import ghidra.program.model.listing.Program;
@ -180,7 +179,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
limitToSelectionCB = new GCheckBox("Limit To Selection"); limitToSelectionCB = new GCheckBox("Limit To Selection");
limitToSelectionCB.setName("LimitToSelectionDiffCB"); limitToSelectionCB.setName("LimitToSelectionDiffCB");
ToolTipManager.setToolTipText(limitToSelectionCB, "Limits the Diff to the selection."); limitToSelectionCB.setToolTipText("Limits the Diff to the selection.");
limitToSelectionCB.addActionListener(ev -> { limitToSelectionCB.addActionListener(ev -> {
limitToSelection = limitToSelectionCB.isSelected(); limitToSelection = limitToSelectionCB.isSelected();
updateDiffSetText(); updateDiffSetText();
@ -197,7 +196,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
*/ */
private JPanel createDiffFilterPanel() { private JPanel createDiffFilterPanel() {
JPanel checkBoxPanel = new JPanel(); JPanel checkBoxPanel = new JPanel();
ToolTipManager.setToolTipText(checkBoxPanel, checkBoxPanel.setToolTipText(
"Check the types of differences between the two " + "Check the types of differences between the two " +
"programs that you want detected and highlighted."); "programs that you want detected and highlighted.");
@ -238,7 +237,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createBytesCheckBox() { private void createBytesCheckBox() {
diffBytesCB = new GCheckBox("Bytes", diffBytes); diffBytesCB = new GCheckBox("Bytes", diffBytes);
diffBytesCB.setName("BytesDiffCB"); diffBytesCB.setName("BytesDiffCB");
ToolTipManager.setToolTipText(diffBytesCB, "Highlight byte differences."); diffBytesCB.setToolTipText("Highlight byte differences.");
diffBytesCB.addItemListener(event -> { diffBytesCB.addItemListener(event -> {
diffBytes = (event.getStateChange() == ItemEvent.SELECTED); diffBytes = (event.getStateChange() == ItemEvent.SELECTED);
diffFilter.setFilter(ProgramDiffFilter.BYTE_DIFFS, diffBytes); diffFilter.setFilter(ProgramDiffFilter.BYTE_DIFFS, diffBytes);
@ -249,7 +248,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createLabelsCheckBox() { private void createLabelsCheckBox() {
diffLabelsCB = new GCheckBox("Labels", diffLabels); diffLabelsCB = new GCheckBox("Labels", diffLabels);
diffLabelsCB.setName("LabelsDiffCB"); diffLabelsCB.setName("LabelsDiffCB");
ToolTipManager.setToolTipText(diffLabelsCB, "Highlight label differences."); diffLabelsCB.setToolTipText("Highlight label differences.");
diffLabelsCB.addItemListener(event -> { diffLabelsCB.addItemListener(event -> {
diffLabels = (event.getStateChange() == ItemEvent.SELECTED); diffLabels = (event.getStateChange() == ItemEvent.SELECTED);
diffFilter.setFilter(ProgramDiffFilter.SYMBOL_DIFFS, diffLabels); diffFilter.setFilter(ProgramDiffFilter.SYMBOL_DIFFS, diffLabels);
@ -260,7 +259,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createCodeUnitsCheckBox() { private void createCodeUnitsCheckBox() {
diffCodeUnitsCB = new GCheckBox("Code Units", diffCodeUnits); diffCodeUnitsCB = new GCheckBox("Code Units", diffCodeUnits);
diffCodeUnitsCB.setName("CodeUnitsDiffCB"); diffCodeUnitsCB.setName("CodeUnitsDiffCB");
ToolTipManager.setToolTipText(diffCodeUnitsCB, diffCodeUnitsCB.setToolTipText(
"Highlight the instruction, data, " + "and equate differences."); "Highlight the instruction, data, " + "and equate differences.");
diffCodeUnitsCB.addItemListener(event -> { diffCodeUnitsCB.addItemListener(event -> {
diffCodeUnits = (event.getStateChange() == ItemEvent.SELECTED); diffCodeUnits = (event.getStateChange() == ItemEvent.SELECTED);
@ -273,7 +272,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createReferencesCheckBox() { private void createReferencesCheckBox() {
diffReferencesCB = new GCheckBox("References", diffReferences); diffReferencesCB = new GCheckBox("References", diffReferences);
diffReferencesCB.setName("ReferencesDiffCB"); diffReferencesCB.setName("ReferencesDiffCB");
ToolTipManager.setToolTipText(diffReferencesCB, "Highlight the reference differences."); diffReferencesCB.setToolTipText("Highlight the reference differences.");
diffReferencesCB.addItemListener(event -> { diffReferencesCB.addItemListener(event -> {
diffReferences = (event.getStateChange() == ItemEvent.SELECTED); diffReferences = (event.getStateChange() == ItemEvent.SELECTED);
diffFilter.setFilter(ProgramDiffFilter.REFERENCE_DIFFS, diffReferences); diffFilter.setFilter(ProgramDiffFilter.REFERENCE_DIFFS, diffReferences);
@ -284,8 +283,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createProgramContextCheckBox() { private void createProgramContextCheckBox() {
diffProgramContextCB = new GCheckBox("Program Context", diffProgramContext); diffProgramContextCB = new GCheckBox("Program Context", diffProgramContext);
diffProgramContextCB.setName("ProgramContextDiffCB"); diffProgramContextCB.setName("ProgramContextDiffCB");
ToolTipManager.setToolTipText(diffProgramContextCB, diffProgramContextCB.setToolTipText("Highlight the program context register differences.");
"Highlight the program context register differences.");
diffProgramContextCB.addItemListener(event -> { diffProgramContextCB.addItemListener(event -> {
diffProgramContext = (event.getStateChange() == ItemEvent.SELECTED); diffProgramContext = (event.getStateChange() == ItemEvent.SELECTED);
diffFilter.setFilter(ProgramDiffFilter.PROGRAM_CONTEXT_DIFFS, diffProgramContext); diffFilter.setFilter(ProgramDiffFilter.PROGRAM_CONTEXT_DIFFS, diffProgramContext);
@ -296,7 +294,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createCommentsCheckBox() { private void createCommentsCheckBox() {
diffCommentsCB = new GCheckBox("Comments", diffComments); diffCommentsCB = new GCheckBox("Comments", diffComments);
diffCommentsCB.setName("CommentsDiffCB"); diffCommentsCB.setName("CommentsDiffCB");
ToolTipManager.setToolTipText(diffCommentsCB, "Highlight comment differences."); diffCommentsCB.setToolTipText("Highlight comment differences.");
diffCommentsCB.addItemListener(event -> { diffCommentsCB.addItemListener(event -> {
diffComments = (event.getStateChange() == ItemEvent.SELECTED); diffComments = (event.getStateChange() == ItemEvent.SELECTED);
diffFilter.setFilter(ProgramDiffFilter.COMMENT_DIFFS, diffComments); diffFilter.setFilter(ProgramDiffFilter.COMMENT_DIFFS, diffComments);
@ -307,7 +305,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createBookmarksCheckBox() { private void createBookmarksCheckBox() {
diffBookmarksCB = new GCheckBox("Bookmarks", diffBookmarks); diffBookmarksCB = new GCheckBox("Bookmarks", diffBookmarks);
diffBookmarksCB.setName("BookmarksDiffCB"); diffBookmarksCB.setName("BookmarksDiffCB");
ToolTipManager.setToolTipText(diffBookmarksCB, diffBookmarksCB.setToolTipText(
"Highlight bookmark differences. " + "(for example, bookmark differences)"); "Highlight bookmark differences. " + "(for example, bookmark differences)");
diffBookmarksCB.addItemListener(event -> { diffBookmarksCB.addItemListener(event -> {
diffBookmarks = (event.getStateChange() == ItemEvent.SELECTED); diffBookmarks = (event.getStateChange() == ItemEvent.SELECTED);
@ -319,8 +317,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createPropertiesCheckBox() { private void createPropertiesCheckBox() {
diffPropertiesCB = new GCheckBox("Properties", diffProperties); diffPropertiesCB = new GCheckBox("Properties", diffProperties);
diffPropertiesCB.setName("PropertiesDiffCB"); diffPropertiesCB.setName("PropertiesDiffCB");
ToolTipManager.setToolTipText(diffPropertiesCB, diffPropertiesCB.setToolTipText("Highlight user defined property differences. " +
"Highlight user defined property differences. " +
"(for example, Format (space) differences)"); "(for example, Format (space) differences)");
diffPropertiesCB.addItemListener(event -> { diffPropertiesCB.addItemListener(event -> {
diffProperties = (event.getStateChange() == ItemEvent.SELECTED); diffProperties = (event.getStateChange() == ItemEvent.SELECTED);
@ -332,7 +329,7 @@ public class ExecuteDiffDialog extends DialogComponentProvider {
private void createFunctionsCheckBox() { private void createFunctionsCheckBox() {
diffFunctionsCB = new GCheckBox("Functions", diffFunctions); diffFunctionsCB = new GCheckBox("Functions", diffFunctions);
diffFunctionsCB.setName("FunctionsDiffCB"); diffFunctionsCB.setName("FunctionsDiffCB");
ToolTipManager.setToolTipText(diffFunctionsCB, "Highlight function differences."); diffFunctionsCB.setToolTipText("Highlight function differences.");
diffFunctionsCB.addItemListener(event -> { diffFunctionsCB.addItemListener(event -> {
diffFunctions = (event.getStateChange() == ItemEvent.SELECTED); diffFunctions = (event.getStateChange() == ItemEvent.SELECTED);
// Functions check box controls both functions and function tags. // Functions check box controls both functions and function tags.

View file

@ -29,7 +29,6 @@ import javax.swing.event.TableModelListener;
import javax.swing.table.JTableHeader; import javax.swing.table.JTableHeader;
import docking.ActionContext; import docking.ActionContext;
import docking.ToolTipManager;
import docking.WindowPosition; import docking.WindowPosition;
import docking.action.*; import docking.action.*;
import docking.menu.ActionState; import docking.menu.ActionState;
@ -629,10 +628,10 @@ public class VTFunctionAssociationProvider extends ComponentProviderAdapter
messageWidth = fm.stringWidth(text); messageWidth = fm.stringWidth(text);
} }
if (messageWidth > statusLabel.getWidth()) { if (messageWidth > statusLabel.getWidth()) {
ToolTipManager.setToolTipText(statusLabel, text); statusLabel.setToolTipText(text);
} }
else { else {
ToolTipManager.setToolTipText(statusLabel, null); statusLabel.setToolTipText(null);
} }
} }

View file

@ -490,7 +490,7 @@ public class DialogComponentProvider
*/ */
protected void setApplyToolTip(String tooltip) { protected void setApplyToolTip(String tooltip) {
if (applyButton != null) { if (applyButton != null) {
ToolTipManager.setToolTipText(applyButton, tooltip); applyButton.setToolTipText(tooltip);
} }
} }
@ -506,7 +506,7 @@ public class DialogComponentProvider
*/ */
protected void setOkToolTip(String tooltip) { protected void setOkToolTip(String tooltip) {
if (okButton != null) { if (okButton != null) {
ToolTipManager.setToolTipText(okButton, tooltip); okButton.setToolTipText(tooltip);
} }
} }
@ -516,7 +516,7 @@ public class DialogComponentProvider
*/ */
protected void setCancelToolTip(String tooltip) { protected void setCancelToolTip(String tooltip) {
if (cancelButton != null) { if (cancelButton != null) {
ToolTipManager.setToolTipText(cancelButton, tooltip); cancelButton.setToolTipText(tooltip);
} }
} }
@ -532,7 +532,7 @@ public class DialogComponentProvider
*/ */
protected void setDismissToolTip(String tooltip) { protected void setDismissToolTip(String tooltip) {
if (dismissButton != null) { if (dismissButton != null) {
ToolTipManager.setToolTipText(dismissButton, tooltip); dismissButton.setToolTipText(tooltip);
} }
} }
@ -785,10 +785,10 @@ public class DialogComponentProvider
messageWidth = fm.stringWidth(text); messageWidth = fm.stringWidth(text);
} }
if (messageWidth > statusLabel.getWidth()) { if (messageWidth > statusLabel.getWidth()) {
ToolTipManager.setToolTipText(statusLabel, text); statusLabel.setToolTipText(text);
} }
else { else {
ToolTipManager.setToolTipText(statusLabel, null); statusLabel.setToolTipText(null);
} }
} }

View file

@ -351,4 +351,14 @@ public class DockingUtils {
c.setBackground(new Color(0, 0, 0, 0)); c.setBackground(new Color(0, 0, 0, 0));
} }
/** Hides any open tooltip window */
public static void hideTipWindow() {
// This is a hack, since Java's manager doesn't have this method
javax.swing.ToolTipManager.sharedInstance().setEnabled(false);
javax.swing.ToolTipManager.sharedInstance().setEnabled(true);
// TODO: Ultimately, the ESCAPE key binding in the Java TTM should hide any visible tooltips. We
// need to look into why this isn't working.
}
} }

View file

@ -111,7 +111,7 @@ public class EmptyBorderToggleButton extends EmptyBorderButton {
setEnabled(((Boolean) e.getNewValue()).booleanValue()); setEnabled(((Boolean) e.getNewValue()).booleanValue());
} }
else if (name.equals(Action.SHORT_DESCRIPTION)) { else if (name.equals(Action.SHORT_DESCRIPTION)) {
ToolTipManager.setToolTipText(this, (String) e.getNewValue()); setToolTipText((String) e.getNewValue());
} }
else if (name.equals(Action.SMALL_ICON)) { else if (name.equals(Action.SMALL_ICON)) {
setIcon((Icon) e.getNewValue()); setIcon((Icon) e.getNewValue());

View file

@ -386,7 +386,7 @@ public class GenericHeader extends JPanel {
*/ */
void setTitle(String s) { void setTitle(String s) {
titleLabel.setText(s); titleLabel.setText(s);
ToolTipManager.setToolTipText(titleLabel, s); titleLabel.setToolTipText(s);
} }
/** /**

View file

@ -1,161 +0,0 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* 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;
import javax.swing.JComponent;
/**
* A tooltip manager that simply delegates to the Swing tooltip manager. This class replaces
* the previous tooltip manager that overrode much of the Swing tooltip manager's functionality.
*/
public class ToolTipManager {
private javax.swing.ToolTipManager delegate = javax.swing.ToolTipManager.sharedInstance();
private static ToolTipManager sharedInstance = new ToolTipManager();
/**
* Registers a component for tooltip management.
* <p>
* This will register key bindings to show and hide the tooltip text
* only if <code>component</code> has focus bindings. This is done
* so that components that are not normally focus traversable, such
* as <code>JLabel</code>, are not made focus traversable as a result
* of invoking this method.
*
* @param component a <code>JComponent</code> object to add
* @see JComponent#isFocusTraversable
*/
public void registerComponent(JComponent component) {
delegate.registerComponent( component );
}
/**
* Removes a component from tooltip control.
*
* @param component a <code>JComponent</code> object to remove
*/
public void unregisterComponent(JComponent component) {
delegate.unregisterComponent( component );
}
public int getDismissDelay() {
return delegate.getDismissDelay();
}
public int getReshowDelay() {
return delegate.getReshowDelay();
}
public boolean isEnabled() {
return delegate.isEnabled();
}
public int getInitialDelay() {
return delegate.getInitialDelay();
}
public boolean isLightWeightPopupEnabled() {
return delegate.isLightWeightPopupEnabled();
}
public void setLightWeightPopupEnabled( boolean aFlag ) {
delegate.setLightWeightPopupEnabled( aFlag );
}
@Override
public String toString() {
return delegate.toString();
}
public static void setToolTipText( JComponent c, String text ) {
String oldText = (String) c.getClientProperty(JComponent.TOOL_TIP_TEXT_KEY);
c.putClientProperty(JComponent.TOOL_TIP_TEXT_KEY, text);
if (text != null) {
if (oldText == null) {
sharedInstance.registerComponent(c);
}
} else {
sharedInstance.unregisterComponent(c);
}
}
public static ToolTipManager sharedInstance() {
javax.swing.ToolTipManager.sharedInstance();
return sharedInstance;
}
/**
* Enables or disables the tooltip.
*
* @param flag true to enable the tip, false otherwise
*/
public void setEnabled( boolean flag ) {
delegate.setEnabled( flag );
}
/**
* Specifies the initial delay value.
*
* @param milliseconds the number of milliseconds to delay
* (after the cursor has paused) before displaying the
* tooltip
* @see #getInitialDelay
*/
public void setInitialDelay( int milliseconds ) {
delegate.setInitialDelay( milliseconds );
}
/**
* Specifies the dismissal delay value.
*
* @param milliseconds the number of milliseconds to delay
* before taking away the tooltip
* @see #getDismissDelay
*/
public void setDismissDelay( int milliseconds ) {
delegate.setDismissDelay( milliseconds );
}
/**
* Used to specify the amount of time before the user has to wait
* <code>initialDelay</code> milliseconds before a tooltip will be
* shown. That is, if the tooltip is hidden, and the user moves into
* a region of the same Component that has a valid tooltip within
* <code>milliseconds</code> milliseconds the tooltip will immediately
* be shown. Otherwise, if the user moves into a region with a valid
* tooltip after <code>milliseconds</code> milliseconds, the user
* will have to wait an additional <code>initialDelay</code>
* milliseconds before the tooltip is shown again.
*
* @param milliseconds time in milliseconds
* @see #getReshowDelay
*/
public void setReshowDelay( int milliseconds ) {
delegate.setReshowDelay( milliseconds );
}
/** Hides any open tooltip window */
public void hideTipWindow() {
// This is a hack, since Java's manager doesn't have this method
delegate.setEnabled( false );
delegate.setEnabled( true );
// TODO: Ultimately, the ESCAPE key binding in the Java TTM should hide any visible tooltips. We
// need to look into why this isn't working.
}
}

View file

@ -22,7 +22,6 @@ import java.awt.event.MouseEvent;
import javax.swing.*; import javax.swing.*;
import docking.ToolTipManager;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
import ghidra.framework.options.EditorState; import ghidra.framework.options.EditorState;
import ghidra.util.HTMLUtilities; import ghidra.util.HTMLUtilities;
@ -56,9 +55,9 @@ public class DefaultOptionComponent extends GenericOptionsComponent {
String description = editorState.getDescription(); String description = editorState.getDescription();
if (description != null) { if (description != null) {
String htmlDescription = HTMLUtilities.toWrappedHTML(description); String htmlDescription = HTMLUtilities.toWrappedHTML(description);
ToolTipManager.setToolTipText(label, htmlDescription); label.setToolTipText(htmlDescription);
if (component instanceof JComponent) { if (component instanceof JComponent) {
ToolTipManager.setToolTipText((JComponent) component, htmlDescription); ((JComponent) component).setToolTipText(htmlDescription);
} }
} }
add(label); add(label);

View file

@ -24,9 +24,8 @@ import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import resources.ResourceManager;
import docking.ToolTipManager;
import ghidra.docking.util.DockingWindowsLookAndFeelUtils; import ghidra.docking.util.DockingWindowsLookAndFeelUtils;
import resources.ResourceManager;
/** /**
* Class that is a JButton that has an empty border and adds a mouse listener * Class that is a JButton that has an empty border and adds a mouse listener

View file

@ -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.
@ -20,6 +19,7 @@ import java.awt.Rectangle;
import java.awt.event.*; import java.awt.event.*;
import javax.swing.Timer; import javax.swing.Timer;
import javax.swing.ToolTipManager;
import docking.widgets.fieldpanel.field.Field; import docking.widgets.fieldpanel.field.Field;
import docking.widgets.fieldpanel.support.FieldLocation; import docking.widgets.fieldpanel.support.FieldLocation;
@ -63,7 +63,7 @@ public class HoverHandler implements ActionListener {
public void setHoverProvider(HoverProvider hoverProvider) { public void setHoverProvider(HoverProvider hoverProvider) {
this.hoverProvider = hoverProvider; this.hoverProvider = hoverProvider;
if (hoverProvider != null && hoverTimer == null) { if (hoverProvider != null && hoverTimer == null) {
int timeout = docking.ToolTipManager.sharedInstance().getInitialDelay(); int timeout = ToolTipManager.sharedInstance().getInitialDelay();
hoverTimer = new Timer(timeout, this); hoverTimer = new Timer(timeout, this);
hoverTimer.setRepeats(false); hoverTimer.setRepeats(false);
hoverTimer.stop(); hoverTimer.stop();

View file

@ -551,8 +551,8 @@ public class GTable extends JTable implements KeyStrokeConsumer, DockingActionPr
} }
private void init(boolean allowAutoEdit) { private void init(boolean allowAutoEdit) {
docking.ToolTipManager.sharedInstance().unregisterComponent(this); ToolTipManager.sharedInstance().unregisterComponent(this);
docking.ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().registerComponent(this);
setTableHeader(new GTableHeader(this)); setTableHeader(new GTableHeader(this));
if (!allowAutoEdit) { if (!allowAutoEdit) {
putClientProperty("JTable.autoStartsEdit", Boolean.FALSE); putClientProperty("JTable.autoStartsEdit", Boolean.FALSE);

View file

@ -18,8 +18,7 @@ package docking.widgets.table;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import javax.swing.Icon; import javax.swing.*;
import javax.swing.JComponent;
import javax.swing.table.*; import javax.swing.table.*;
import docking.DockingWindowManager; import docking.DockingWindowManager;
@ -54,7 +53,7 @@ public class GTableHeader extends JTableHeader {
GTableHeader(GTable table) { GTableHeader(GTable table) {
super(table.getColumnModel()); super(table.getColumnModel());
gTable = table; gTable = table;
docking.ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().registerComponent(this);
addMouseListener(new MouseAdapter() { addMouseListener(new MouseAdapter() {
@Override @Override

View file

@ -21,13 +21,11 @@ import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.swing.JComponent; import javax.swing.*;
import javax.swing.JTextField;
import javax.swing.event.*; import javax.swing.event.*;
import javax.swing.text.*; import javax.swing.text.*;
import docking.DockingUtils; import docking.DockingUtils;
import docking.ToolTipManager;
import docking.util.GraphicsUtils; import docking.util.GraphicsUtils;
import ghidra.util.SystemUtilities; import ghidra.util.SystemUtilities;

View file

@ -208,7 +208,7 @@ public class GTree extends JPanel implements BusyListener {
tree.setRowHeight(-1);// variable size rows tree.setRowHeight(-1);// variable size rows
tree.setSelectionModel(new GTreeSelectionModel()); tree.setSelectionModel(new GTreeSelectionModel());
tree.setInvokesStopCellEditing(true);// clicking outside the cell editor will trigger a save, not a cancel tree.setInvokesStopCellEditing(true);// clicking outside the cell editor will trigger a save, not a cancel
docking.ToolTipManager.sharedInstance().registerComponent(tree); ToolTipManager.sharedInstance().registerComponent(tree);
setLayout(new BorderLayout()); setLayout(new BorderLayout());

View file

@ -23,7 +23,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.*; import javax.swing.*;
import docking.ToolTipManager;
import docking.util.AnimatedIcon; import docking.util.AnimatedIcon;
import docking.widgets.EmptyBorderButton; import docking.widgets.EmptyBorderButton;
import docking.widgets.OptionDialog; import docking.widgets.OptionDialog;
@ -387,7 +386,7 @@ public class TaskMonitorComponent extends JPanel implements TaskMonitor {
} }
private void updateToolTip() { private void updateToolTip() {
ToolTipManager.setToolTipText(cancelButton, "Cancel " + getTaskName()); cancelButton.setToolTipText("Cancel " + getTaskName());
} }
private String getTaskName() { private String getTaskName() {

View file

@ -24,8 +24,8 @@ import javax.swing.*;
import com.google.common.base.Function; import com.google.common.base.Function;
import docking.DockingUtils;
import docking.DockingWindowManager; import docking.DockingWindowManager;
import docking.ToolTipManager;
import docking.help.HelpService; import docking.help.HelpService;
import docking.widgets.EmptyBorderButton; import docking.widgets.EmptyBorderButton;
import docking.widgets.PopupWindow; import docking.widgets.PopupWindow;
@ -175,8 +175,8 @@ public class GraphComponent<V extends VisualVertex, E extends VisualEdge<V>, G e
createGUIComponents(primaryViewer, satelliteViewer); createGUIComponents(primaryViewer, satelliteViewer);
docking.ToolTipManager.sharedInstance().registerComponent(primaryViewer); ToolTipManager.sharedInstance().registerComponent(primaryViewer);
docking.ToolTipManager.sharedInstance().registerComponent(satelliteViewer); ToolTipManager.sharedInstance().registerComponent(satelliteViewer);
} }
// template method // template method
@ -406,7 +406,7 @@ public class GraphComponent<V extends VisualVertex, E extends VisualEdge<V>, G e
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
PopupWindow.hideAllWindows(); PopupWindow.hideAllWindows();
ToolTipManager.sharedInstance().hideTipWindow(); DockingUtils.hideTipWindow();
} }
} }
}; };

View file

@ -21,7 +21,6 @@ import java.awt.event.*;
import javax.swing.JComponent; import javax.swing.JComponent;
import docking.DockingUtils; import docking.DockingUtils;
import docking.ToolTipManager;
import edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin; import edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin;
import ghidra.graph.viewer.*; import ghidra.graph.viewer.*;
@ -179,7 +178,7 @@ public class VisualGraphEventForwardingGraphMousePlugin<V extends VisualVertex,
return; return;
} }
ToolTipManager.sharedInstance().hideTipWindow(); DockingUtils.hideTipWindow();
} }
/* /*

View file

@ -32,7 +32,6 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import docking.DialogComponentProvider; import docking.DialogComponentProvider;
import docking.ToolTipManager;
import docking.options.editor.ButtonPanelFactory; import docking.options.editor.ButtonPanelFactory;
import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.filechooser.GhidraFileChooser;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
@ -409,8 +408,8 @@ class EditPluginPathDialog extends DialogComponentProvider {
// tooltip text problem where the text is obscured by a component // tooltip text problem where the text is obscured by a component
// added after tooltip has been added // added after tooltip has been added
// //
ToolTipManager.setToolTipText(upButton, "Changes the order of search for plugins"); upButton.setToolTipText("Changes the order of search for plugins");
ToolTipManager.setToolTipText(downButton, "Changes the order of search for plugins"); downButton.setToolTipText("Changes the order of search for plugins");
pluginPathListPanel.validate(); pluginPathListPanel.validate();
return pluginPathListPanel; return pluginPathListPanel;

View file

@ -25,7 +25,6 @@ import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.Configuration;
import docking.StatusBarSpacer; import docking.StatusBarSpacer;
import docking.ToolTipManager;
import docking.help.Help; import docking.help.Help;
import docking.help.HelpService; import docking.help.HelpService;
import docking.widgets.EmptyBorderButton; import docking.widgets.EmptyBorderButton;
@ -67,7 +66,7 @@ public class LogPanel extends JPanel implements LogListener {
button.setPreferredSize(new Dimension(24, 24)); button.setPreferredSize(new Dimension(24, 24));
button.setFocusable(false); button.setFocusable(false);
ToolTipManager.setToolTipText(button, "Show Console (Refresh Open Console)"); button.setToolTipText("Show Console (Refresh Open Console)");
button.addActionListener(e -> { button.addActionListener(e -> {
FrontEndTool tool = (FrontEndTool) plugin.getTool(); FrontEndTool tool = (FrontEndTool) plugin.getTool();
tool.showGhidraUserLogFile(); tool.showGhidraUserLogFile();
@ -96,7 +95,7 @@ public class LogPanel extends JPanel implements LogListener {
label.setForeground(Color.RED); label.setForeground(Color.RED);
} }
label.setText(message); label.setText(message);
ToolTipManager.setToolTipText(label, message); label.setToolTipText(message);
}); });
} }

View file

@ -22,7 +22,6 @@ import java.awt.event.ActionListener;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.*; import javax.swing.event.*;
import docking.ToolTipManager;
import docking.widgets.label.GDLabel; import docking.widgets.label.GDLabel;
import ghidra.framework.model.ServerInfo; import ghidra.framework.model.ServerInfo;
import ghidra.framework.remote.GhidraServerHandle; import ghidra.framework.remote.GhidraServerHandle;
@ -151,7 +150,7 @@ public class ServerInfoComponent extends JPanel {
}; };
portNumberField.getDocument().addDocumentListener(portDocListener); portNumberField.getDocument().addDocumentListener(portDocListener);
ToolTipManager.setToolTipText(portNumberField, "Enter port number"); portNumberField.setToolTipText("Enter port number");
JPanel panel = new JPanel(new PairLayout(5, 10)); JPanel panel = new JPanel(new PairLayout(5, 10));
panel.add(nameLabel); panel.add(nameLabel);
panel.add(nameField); panel.add(nameField);

View file

@ -18,8 +18,7 @@ package ghidra.framework.main.datatree;
import java.awt.Component; import java.awt.Component;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import javax.swing.JTree; import javax.swing.*;
import javax.swing.KeyStroke;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import docking.DockingUtils; import docking.DockingUtils;
@ -43,7 +42,7 @@ public class DataTree extends GTree {
setCellRenderer(new DataTreeCellRenderer()); setCellRenderer(new DataTreeCellRenderer());
setShowsRootHandles(true); // need this to "drill down" setShowsRootHandles(true); // need this to "drill down"
docking.ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().registerComponent(this);
if (tool != null) { if (tool != null) {
dragNDropHandler = new DataTreeDragNDropHandler(tool, this, isActive); dragNDropHandler = new DataTreeDragNDropHandler(tool, this, isActive);

View file

@ -21,7 +21,6 @@ import java.text.NumberFormat;
import javax.swing.*; import javax.swing.*;
import docking.ToolTipManager;
import docking.util.AnimatedIcon; import docking.util.AnimatedIcon;
import docking.widgets.EmptyBorderButton; import docking.widgets.EmptyBorderButton;
import docking.widgets.label.GDHtmlLabel; import docking.widgets.label.GDHtmlLabel;