public static void performAction(DockingActionIf action, boolean waitForCompletion) {

		ActionContext context = runSwing(() -> {
			ActionContext actionContext = new DefaultActionContext();
			DockingWindowManager activeInstance = DockingWindowManager.getActiveInstance();
			if (activeInstance == null) {
				return actionContext;
			}

			ComponentProvider provider = activeInstance.getActiveComponentProvider();
			if (provider == null) {
				return actionContext;
			}

			ActionContext providerContext = provider.getActionContext(null);
			if (providerContext != null) {
				return providerContext;
			}

			return actionContext;
		});

		doPerformAction(action, context, waitForCompletion);
	}
Performs the specified action within the Swing Thread.  If the action results
in a modal dialog, waitForCompletion must be false.

@param action action to be performed
@param waitForCompletion if true wait for action to complete before returning,
otherwise schedule action to be performed and return immediately.
Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java