@Override
	public void setSelection(ProgramSelection selection) {
		currentSelection = selection;
		if (isVisible()) {
			contextChanged();
			controller.setSelection(selection);
		}

		clipboardProvider.setSelection(selection);
	}
Sets the current program and adds/removes itself as a domainObjectListener

@param newProgram the new program or null to clear out the current program.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java