mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Change reuse/append display to choose a display that is currently visible. This will be the one in the open tab.
This commit is contained in:
@@ -51,7 +51,7 @@ public class DefaultGraphDisplayProvider implements GraphDisplayProvider {
|
|||||||
TaskMonitor monitor) {
|
TaskMonitor monitor) {
|
||||||
|
|
||||||
if (reuseGraph && !displays.isEmpty()) {
|
if (reuseGraph && !displays.isEmpty()) {
|
||||||
return getExistingGraph();
|
return getVisibleGraph();
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultGraphDisplay display =
|
DefaultGraphDisplay display =
|
||||||
@@ -66,9 +66,16 @@ public class DefaultGraphDisplayProvider implements GraphDisplayProvider {
|
|||||||
this.options = graphOptions;
|
this.options = graphOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GraphDisplay getExistingGraph() {
|
/**
|
||||||
DefaultGraphDisplay display = displays.iterator().next();
|
* Get a {@code GraphDisplay} that is 'showing', assuming that is the one the user
|
||||||
return display;
|
* wishes to append to.
|
||||||
|
* Called only when displays is not empty. If there are no 'showing' displays,
|
||||||
|
* return one from the Set via its iterator
|
||||||
|
* @return a display that is showing
|
||||||
|
*/
|
||||||
|
private GraphDisplay getVisibleGraph() {
|
||||||
|
return displays.stream().filter(d -> d.getComponent().isShowing())
|
||||||
|
.findAny().orElse(displays.iterator().next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user