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 javax.swing.ToolTipManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import docking.DockingWindowManager;
import docking.ToolTipManager;
import docking.framework.SplashScreen;
import ghidra.base.help.GhidraHelpService;
import ghidra.framework.Application;
@ -131,9 +132,8 @@ public class GhidraRun implements GhidraLaunchable {
}
private void initializeTooltips() {
ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
int currentDelay = toolTipManager.getDismissDelay();
toolTipManager.setDismissDelay(currentDelay * 2);
int currentDelay = ToolTipManager.sharedInstance().getDismissDelay();
ToolTipManager.sharedInstance().setDismissDelay(currentDelay * 2);
}
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,21 +15,19 @@
*/
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.model.Transaction;
import ghidra.framework.model.TransactionListener;
import ghidra.program.database.ProgramDB;
import ghidra.program.model.listing.Program;
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;
class TransactionMonitor extends JComponent implements TransactionListener {
@ -44,7 +42,7 @@ class TransactionMonitor extends JComponent implements TransactionListener {
super();
busyIcon = ResourceManager.loadImage("images/editbytes.gif");
prefSize = new Dimension(busyIcon.getIconWidth(), busyIcon.getIconHeight());
docking.ToolTipManager.sharedInstance().registerComponent(this);
ToolTipManager.sharedInstance().registerComponent(this);
}
void setProgram(Program p) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,7 +26,6 @@ import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import docking.ToolTipManager;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.label.GDLabel;
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
groupElementsCheckBox = new GCheckBox(SHOW_MULTI_ELEMENTS_LABEL);
groupElementsCheckBox.setSelected(true);
ToolTipManager.setToolTipText(groupElementsCheckBox, SHOW_MULTI_ELEMENTS_TOOLTIP);
groupElementsCheckBox.setToolTipText(SHOW_MULTI_ELEMENTS_TOOLTIP);
panel.add(groupElementsCheckBox);
elementsPerLineField =
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() {
@Override

View File

@ -24,7 +24,6 @@ import javax.swing.border.TitledBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import docking.ToolTipManager;
import docking.widgets.checkbox.GCheckBox;
import ghidra.framework.options.CustomOptionsEditor;
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
showNonLocalCheckBox = new GCheckBox(DISPLAY_NON_LOCAL_NAMESPACE_LABEL);
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.setSelected(false);
ToolTipManager.setToolTipText(showLocalCheckBox, SHOW_LOCAL_NAMESPACE_TOOLTIP);
showLocalCheckBox.setToolTipText(SHOW_LOCAL_NAMESPACE_TOOLTIP);
showLibraryInNamespaceCheckBox = new GCheckBox(DISPLAY_LIBRARY_IN_NAMESPACE_LABEL);
showLibraryInNamespaceCheckBox.setSelected(true);
ToolTipManager.setToolTipText(showLocalCheckBox, SHOW_LIBRARY_IN_NAMESPACE_TOOLTIP);
showLocalCheckBox.setToolTipText(SHOW_LIBRARY_IN_NAMESPACE_TOOLTIP);
panel.add(showNonLocalCheckBox);
panel.add(showLocalCheckBox);
@ -118,7 +117,7 @@ public class NamespacePropertyEditor extends PropertyEditorSupport implements Cu
textFieldPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
useLocalPrefixCheckBox = new GCheckBox("Use Local Namespace Override");
ToolTipManager.setToolTipText(useLocalPrefixCheckBox, tooltipText);
useLocalPrefixCheckBox.setToolTipText(tooltipText);
useLocalPrefixCheckBox.addItemListener(e -> {
textField.setEnabled(useLocalPrefixCheckBox.isSelected());
firePropertyChange();

View File

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

View File

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

View File

@ -490,7 +490,7 @@ public class DialogComponentProvider
*/
protected void setApplyToolTip(String tooltip) {
if (applyButton != null) {
ToolTipManager.setToolTipText(applyButton, tooltip);
applyButton.setToolTipText(tooltip);
}
}
@ -506,7 +506,7 @@ public class DialogComponentProvider
*/
protected void setOkToolTip(String tooltip) {
if (okButton != null) {
ToolTipManager.setToolTipText(okButton, tooltip);
okButton.setToolTipText(tooltip);
}
}
@ -516,7 +516,7 @@ public class DialogComponentProvider
*/
protected void setCancelToolTip(String tooltip) {
if (cancelButton != null) {
ToolTipManager.setToolTipText(cancelButton, tooltip);
cancelButton.setToolTipText(tooltip);
}
}
@ -532,7 +532,7 @@ public class DialogComponentProvider
*/
protected void setDismissToolTip(String tooltip) {
if (dismissButton != null) {
ToolTipManager.setToolTipText(dismissButton, tooltip);
dismissButton.setToolTipText(tooltip);
}
}
@ -785,10 +785,10 @@ public class DialogComponentProvider
messageWidth = fm.stringWidth(text);
}
if (messageWidth > statusLabel.getWidth()) {
ToolTipManager.setToolTipText(statusLabel, text);
statusLabel.setToolTipText(text);
}
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));
}
/** 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());
}
else if (name.equals(Action.SHORT_DESCRIPTION)) {
ToolTipManager.setToolTipText(this, (String) e.getNewValue());
setToolTipText((String) e.getNewValue());
}
else if (name.equals(Action.SMALL_ICON)) {
setIcon((Icon) e.getNewValue());

View File

@ -386,7 +386,7 @@ public class GenericHeader extends JPanel {
*/
void setTitle(String 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 docking.ToolTipManager;
import docking.widgets.label.GDLabel;
import ghidra.framework.options.EditorState;
import ghidra.util.HTMLUtilities;
@ -56,9 +55,9 @@ public class DefaultOptionComponent extends GenericOptionsComponent {
String description = editorState.getDescription();
if (description != null) {
String htmlDescription = HTMLUtilities.toWrappedHTML(description);
ToolTipManager.setToolTipText(label, htmlDescription);
label.setToolTipText(htmlDescription);
if (component instanceof JComponent) {
ToolTipManager.setToolTipText((JComponent) component, htmlDescription);
((JComponent) component).setToolTipText(htmlDescription);
}
}
add(label);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -208,7 +208,7 @@ public class GTree extends JPanel implements BusyListener {
tree.setRowHeight(-1);// variable size rows
tree.setSelectionModel(new GTreeSelectionModel());
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());

View File

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

View File

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

View File

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

View File

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

View File

@ -25,7 +25,6 @@ import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import docking.StatusBarSpacer;
import docking.ToolTipManager;
import docking.help.Help;
import docking.help.HelpService;
import docking.widgets.EmptyBorderButton;
@ -67,7 +66,7 @@ public class LogPanel extends JPanel implements LogListener {
button.setPreferredSize(new Dimension(24, 24));
button.setFocusable(false);
ToolTipManager.setToolTipText(button, "Show Console (Refresh Open Console)");
button.setToolTipText("Show Console (Refresh Open Console)");
button.addActionListener(e -> {
FrontEndTool tool = (FrontEndTool) plugin.getTool();
tool.showGhidraUserLogFile();
@ -96,7 +95,7 @@ public class LogPanel extends JPanel implements LogListener {
label.setForeground(Color.RED);
}
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.event.*;
import docking.ToolTipManager;
import docking.widgets.label.GDLabel;
import ghidra.framework.model.ServerInfo;
import ghidra.framework.remote.GhidraServerHandle;
@ -151,7 +150,7 @@ public class ServerInfoComponent extends JPanel {
};
portNumberField.getDocument().addDocumentListener(portDocListener);
ToolTipManager.setToolTipText(portNumberField, "Enter port number");
portNumberField.setToolTipText("Enter port number");
JPanel panel = new JPanel(new PairLayout(5, 10));
panel.add(nameLabel);
panel.add(nameField);

View File

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

View File

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