@Override
	public void processEvent(PluginEvent event) {
		if (event instanceof ProgramClosedPluginEvent) {
			ProgramClosedPluginEvent ev = (ProgramClosedPluginEvent) event;
			programClosed(ev.getProgram());
		}
		else if (event instanceof ProgramOpenedPluginEvent) {
			ProgramOpenedPluginEvent ev = (ProgramOpenedPluginEvent) event;
			programOpened(ev.getProgram());
		}
		else if (event instanceof ProgramActivatedPluginEvent) {
			ProgramActivatedPluginEvent ev = (ProgramActivatedPluginEvent) event;
			Program oldProgram = currentProgram;
			currentProgram = ev.getActiveProgram();
			if (oldProgram != null) {
				programDeactivated(oldProgram);
				currentLocation = null;
				currentSelection = null;
				currentHighlight = null;
				locationChanged(null);
				selectionChanged(null);
				highlightChanged(null);
			}
			if (currentProgram != null) {
				programActivated(currentProgram);
			}

		}
		else if (event instanceof ProgramLocationPluginEvent) {

			ProgramLocationPluginEvent ev = (ProgramLocationPluginEvent) event;
			currentLocation = ev.getLocation();
			if (currentLocation != null && currentLocation.getAddress() == null ||
				(currentProgram == null && ev.getProgram() == null)) {
				currentLocation = null;
			}
			if (currentProgram == null) {
				// currentProgram is null because we haven't gotten the open program event yet (a
				// plugin is firing location change in response to open program that we haven't
				// gotten yet)
				return;
			}
			locationChanged(currentLocation);
		}
		else if (event instanceof ProgramSelectionPluginEvent) {
			ProgramSelectionPluginEvent ev = (ProgramSelectionPluginEvent) event;
			currentSelection = ev.getSelection();
			if (currentSelection != null && currentSelection.isEmpty()) {
				currentSelection = null;
			}
			selectionChanged(currentSelection);
		}
		else if (event instanceof ProgramHighlightPluginEvent) {
			ProgramHighlightPluginEvent ev = (ProgramHighlightPluginEvent) event;
			currentHighlight = ev.getHighlight();
			if (currentHighlight != null && currentHighlight.isEmpty()) {
				currentHighlight = null;
			}
			highlightChanged(currentHighlight);
		}
		else if (event instanceof ProgramPostActivatedPluginEvent ev) {
			postProgramActivated(ev.getActiveProgram());
		}

	}
Process the plugin event.
<p>
When a program closed event or focus changed event comes in, the locationChanged() and
selectionChanged() methods are called with null arguments; currentProgram and
currentLocation are cleared.
<p>
Note: if the subclass overrides processEvent(), it should call super.processEvent().
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/ProgramPlugin.java