tease out GhidraScriptUtil state, clarify headless and headed cases

- GhidraScriptUtil how has (static) initialize & dispose
  - initialize is either through (headed/GUI) GhidraScriptMgrPlugin or
    directly (headless)
- BundleHost
  - now owns bundle paths (script dirs)
  - save and restore to SaveState for use by GUI
  - no static instances
  - GhidraScriptUtil BundleHost coincides with GUI's when both are used
  - generates events
  - conservative use of auto-vivification
- BundleStatusCompoentProvider / PathManager
  - better split between GUI & model
  - subscribes to GUI's BundleHost for events
  - provider registers for generated events, controls BundleHost
This commit is contained in:
Jason P. Leasure 2020-04-13 17:30:43 -04:00
parent 2c27ca1376
commit 49e3d6dcdc
19 changed files with 849 additions and 743 deletions

View file

@ -27,7 +27,7 @@ import docking.widgets.tree.GTree;
import docking.widgets.tree.GTreeNode;
import generic.jar.ResourceFile;
import ghidra.app.plugin.core.console.ConsoleComponentProvider;
import ghidra.app.plugin.core.osgi.BundleStatusProvider;
import ghidra.app.plugin.core.osgi.BundleStatusComponentProvider;
import ghidra.app.plugin.core.script.*;
import ghidra.app.script.GhidraScriptUtil;
import ghidra.app.services.ConsoleService;
@ -115,11 +115,11 @@ public class GhidraScriptMgrPluginScreenShots extends GhidraScreenShotGenerator
paths.add("$GHIDRA_HOME/Features/Base/ghidra_scripts");
paths.add("/User/defined/invalid/directory");
BundleStatusProvider bundleStatusProvider = showProvider(BundleStatusProvider.class);
bundleStatusProvider.getModel().setPathsForTesting(paths);
BundleStatusComponentProvider bundleStatusComponentProvider = showProvider(BundleStatusComponentProvider.class);
bundleStatusComponentProvider.getModel().setPathsForTesting(paths);
waitForComponentProvider(BundleStatusProvider.class);
captureComponent(bundleStatusProvider.getComponent());
waitForComponentProvider(BundleStatusComponentProvider.class);
captureComponent(bundleStatusComponentProvider.getComponent());
}
@Test