mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Test fixes
This commit is contained in:
parent
c58647b7d2
commit
dad56dfcbe
2 changed files with 25 additions and 9 deletions
|
@ -48,8 +48,10 @@ public class GhidraTableFilterTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
|
||||||
tool = new DummyTool();
|
tool = new DummyTool();
|
||||||
winMgr = new DockingWindowManager(tool, null);
|
runSwing(() -> {
|
||||||
winMgr.setVisible(true);
|
winMgr = new DockingWindowManager(tool, null);
|
||||||
|
winMgr.setVisible(true);
|
||||||
|
});
|
||||||
|
|
||||||
buildTable();
|
buildTable();
|
||||||
}
|
}
|
||||||
|
@ -63,9 +65,10 @@ public class GhidraTableFilterTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
filteredModel = filterPanel.getTableFilterModel();
|
filteredModel = filterPanel.getTableFilterModel();
|
||||||
table.setAutoLookupColumn(4);
|
table.setAutoLookupColumn(4);
|
||||||
provider = new TestTableComponentProvider(tool);
|
provider = new TestTableComponentProvider(tool);
|
||||||
|
|
||||||
|
winMgr.addComponent(provider);
|
||||||
});
|
});
|
||||||
|
|
||||||
winMgr.addComponent(provider);
|
|
||||||
waitForSwing();
|
waitForSwing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,7 @@ import java.awt.event.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import docking.action.DockingActionIf;
|
import docking.action.DockingActionIf;
|
||||||
import ghidra.util.CascadedDropTarget;
|
import ghidra.util.*;
|
||||||
import ghidra.util.HelpLocation;
|
|
||||||
import help.HelpService;
|
import help.HelpService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -150,6 +149,10 @@ public class DockableComponent extends JPanel implements ContainerListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!e.isPopupTrigger()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Component component = e.getComponent();
|
Component component = e.getComponent();
|
||||||
if (component == null) {
|
if (component == null) {
|
||||||
return; // not sure this can happen
|
return; // not sure this can happen
|
||||||
|
@ -162,12 +165,22 @@ public class DockableComponent extends JPanel implements ContainerListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
Point point = e.getPoint();
|
Point point = e.getPoint();
|
||||||
boolean withinBounds = bounds.contains(point);
|
if (!bounds.contains(point)) {
|
||||||
if (e.isPopupTrigger() && withinBounds) {
|
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);
|
PopupMenuContext popupContext = new PopupMenuContext(e);
|
||||||
actionMgr.showPopupMenu(placeholder, popupContext);
|
actionMgr.showPopupMenu(placeholder, popupContext);
|
||||||
e.consume();
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue