mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-24 21:50:11 +08:00
Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-9-25'
This commit is contained in:
+6
-3
@@ -48,8 +48,10 @@ public class GhidraTableFilterTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
public void setUp() throws Exception {
|
||||
|
||||
tool = new DummyTool();
|
||||
winMgr = new DockingWindowManager(tool, null);
|
||||
winMgr.setVisible(true);
|
||||
runSwing(() -> {
|
||||
winMgr = new DockingWindowManager(tool, null);
|
||||
winMgr.setVisible(true);
|
||||
});
|
||||
|
||||
buildTable();
|
||||
}
|
||||
@@ -63,9 +65,10 @@ public class GhidraTableFilterTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
filteredModel = filterPanel.getTableFilterModel();
|
||||
table.setAutoLookupColumn(4);
|
||||
provider = new TestTableComponentProvider(tool);
|
||||
|
||||
winMgr.addComponent(provider);
|
||||
});
|
||||
|
||||
winMgr.addComponent(provider);
|
||||
waitForSwing();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.action.DockingActionIf;
|
||||
import ghidra.util.CascadedDropTarget;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.*;
|
||||
import help.HelpService;
|
||||
|
||||
/**
|
||||
@@ -150,6 +149,10 @@ public class DockableComponent extends JPanel implements ContainerListener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!e.isPopupTrigger()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Component component = e.getComponent();
|
||||
if (component == null) {
|
||||
return; // not sure this can happen
|
||||
@@ -162,12 +165,22 @@ public class DockableComponent extends JPanel implements ContainerListener {
|
||||
}
|
||||
|
||||
Point point = e.getPoint();
|
||||
boolean withinBounds = bounds.contains(point);
|
||||
if (e.isPopupTrigger() && withinBounds) {
|
||||
if (!bounds.contains(point)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Consume the event so that Java UI listeners do not process it. This fixes issues with
|
||||
// UI classes (e.g., listeners change table selection). We want to run this code later to
|
||||
// allow trailing application mouse listeners to have a chance to update the context. If
|
||||
// the delayed nature causes any timing issues, then we will need a more robust way of
|
||||
// registering mouse listeners to work around this issue.
|
||||
//
|
||||
e.consume();
|
||||
Swing.runLater(() -> {
|
||||
PopupMenuContext popupContext = new PopupMenuContext(e);
|
||||
actionMgr.showPopupMenu(placeholder, popupContext);
|
||||
e.consume();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user