mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Merge remote-tracking branch 'origin/GP-2057_ghidramonster_accessibleToolChestButtons--SQUASHED'
This commit is contained in:
commit
efb77383de
1 changed files with 10 additions and 12 deletions
|
@ -18,7 +18,8 @@ package ghidra.framework.main;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.datatransfer.*;
|
import java.awt.datatransfer.*;
|
||||||
import java.awt.dnd.*;
|
import java.awt.dnd.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ class ToolButton extends EmptyBorderButton implements Draggable, Droppable {
|
||||||
associatedRunningTool = tool;
|
associatedRunningTool = tool;
|
||||||
this.template = template;
|
this.template = template;
|
||||||
setUpDragDrop();
|
setUpDragDrop();
|
||||||
|
setToolTipText(generateToolTipText());
|
||||||
|
|
||||||
// configure the look and feel of the button
|
// configure the look and feel of the button
|
||||||
setVerticalTextPosition(SwingConstants.BOTTOM);
|
setVerticalTextPosition(SwingConstants.BOTTOM);
|
||||||
|
@ -133,15 +135,11 @@ class ToolButton extends EmptyBorderButton implements Draggable, Droppable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private String generateToolTipText() {
|
||||||
* Get the tool tip text.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getToolTipText(MouseEvent event) {
|
|
||||||
if (associatedRunningTool != null) {
|
if (associatedRunningTool != null) {
|
||||||
if (associatedRunningTool instanceof PluginTool) {
|
if (associatedRunningTool instanceof PluginTool) {
|
||||||
return "<html>" + HTMLUtilities.escapeHTML(
|
return "<html>" +
|
||||||
((PluginTool) associatedRunningTool).getToolFrame().getTitle());
|
HTMLUtilities.escapeHTML(associatedRunningTool.getToolFrame().getTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
return "<html>" + HTMLUtilities.escapeHTML(associatedRunningTool.getName());
|
return "<html>" + HTMLUtilities.escapeHTML(associatedRunningTool.getName());
|
||||||
|
@ -180,13 +178,13 @@ class ToolButton extends EmptyBorderButton implements Draggable, Droppable {
|
||||||
try {
|
try {
|
||||||
for (DataFlavor element : flavors) {
|
for (DataFlavor element : flavors) {
|
||||||
if (element.equals(DataTreeDragNDropHandler.localDomainFileFlavor)) {
|
if (element.equals(DataTreeDragNDropHandler.localDomainFileFlavor)) {
|
||||||
Object draggedData = e.getTransferable().getTransferData(
|
Object draggedData = e.getTransferable()
|
||||||
DataTreeDragNDropHandler.localDomainFileFlavor);
|
.getTransferData(DataTreeDragNDropHandler.localDomainFileFlavor);
|
||||||
return containsSupportedDataTypes((List<DomainFile>) draggedData);
|
return containsSupportedDataTypes((List<DomainFile>) draggedData);
|
||||||
}
|
}
|
||||||
else if (element.equals(ToolButtonTransferable.localToolButtonFlavor)) {
|
else if (element.equals(ToolButtonTransferable.localToolButtonFlavor)) {
|
||||||
Object draggedData = e.getTransferable().getTransferData(
|
Object draggedData = e.getTransferable()
|
||||||
ToolButtonTransferable.localToolButtonFlavor);
|
.getTransferData(ToolButtonTransferable.localToolButtonFlavor);
|
||||||
ToolButton draggedButton = (ToolButton) draggedData;
|
ToolButton draggedButton = (ToolButton) draggedData;
|
||||||
if (draggedButton != null) {
|
if (draggedButton != null) {
|
||||||
if (draggedButton.associatedRunningTool == associatedRunningTool) {
|
if (draggedButton.associatedRunningTool == associatedRunningTool) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue