private void sendEvents() {

		Swing.assertSwingThread("Events must be sent on the Swing thread");

		synchronized (eventQ) {
			currentEvent = eventQ.poll();
		}

		while (currentEvent != null) {
			Class<? extends PluginEvent> eventClass = currentEvent.getClass();
			lastEventsByType.put(eventClass, currentEvent);

			for (PluginEventListener listener : getListeners(eventClass)) {
				try {
					listener.eventSent(currentEvent);
				}
				catch (Throwable t) {
					Msg.showError(this, tool.getToolFrame(), "Plugin Event Error",
						"Error in plugin event listener", t);
				}
			}

			sendToolEvent(currentEvent);

			synchronized (eventQ) {
				currentEvent = eventQ.poll();
			}
		}
		tool.contextChanged(null);
	}
Return an array of the last plugin events fired. EventManager maps the event class to the
last event fired.

@return array of plugin events
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/mgr/EventManager.java