Fixed tools unable to restore Console location information

This commit is contained in:
dragonmacher 2019-07-16 11:35:13 -04:00
parent 0792417979
commit 7b5b1fb542
5 changed files with 52 additions and 27 deletions

View file

@ -28,7 +28,7 @@ import docking.help.HelpService;
import docking.widgets.OptionDialog;
import docking.widgets.tabbedpane.DockingTabRenderer;
import ghidra.util.HelpLocation;
import ghidra.util.SystemUtilities;
import ghidra.util.Swing;
/**
* Node object for managing one or more components. If more that one managed component
@ -36,9 +36,6 @@ import ghidra.util.SystemUtilities;
*/
class ComponentNode extends Node {
private static final String OLD_LISTING_NAME = "CodeBrowserPlugin";
private static final String NEW_LISTING_NAME = "Listing";
private ComponentPlaceholder top;
private List<ComponentPlaceholder> windowPlaceholders;
private JComponent comp;
@ -52,7 +49,7 @@ class ComponentNode extends Node {
break;
}
}
SystemUtilities.runSwingLater(() -> {
Swing.runLater(() -> {
if (top != null) {
top.requestFocus();
}
@ -95,12 +92,6 @@ class ComponentNode extends Node {
group = ComponentProvider.DEFAULT_WINDOW_GROUP;
}
// TODO remove this in a few major releases after 9.1; this prevents existing tools
// from losing layout positioning information due to a recent rename
if (OLD_LISTING_NAME.equals(name)) {
name = NEW_LISTING_NAME;
}
boolean isActive = Boolean.valueOf(e.getAttributeValue("ACTIVE")).booleanValue();
long uniqueID = getUniqueID(e, 0);

View file

@ -756,9 +756,14 @@ public abstract class ComponentProvider implements HelpDescriptor, ActionContext
}
/**
* Register a name and/or owner change to a provider so that old tools can restore those provider windows
* to their old position and size. Note you must supply all four arguments. If the name or owner did not
* change, use the name or owner that did not change for both the old and new values.
* Register a name and/or owner change to a provider so that old tools can restore those
* provider windows to their old position and size. Note you must supply all four
* arguments. If the name or owner did not change, use the name or owner that did not change
* for both the old and new values.
*
* <p>Note: when you make use of this method, please signal when it is safe to remove
* its usage.
*
* @param oldName the old name of the provider.
* @param oldOwner the old owner of the provider.
* @param newName the new name of the provider. If the name did not change, use the old name here.