public void sourcePanelSelectionChanged(boolean validFunction) {

		boolean hasSelection = sourcePanel.hasSelection();
		boolean isImmutable = sourcePanel.isSelectionImmutable();
		boolean isEnabled = sourcePanel.isSelectionEnabled();

		addBtn.setEnabled(hasSelection && validFunction && isEnabled);
		removeBtn.setEnabled(false);

		if (!hasSelection) {
			sourcePanel.clearSelection();
		}

		deleteBtn.setEnabled(hasSelection && !isImmutable);
	}
Invoked when the user has selected an item in the source panel.

@param validFunction true if a function is selected in the listing
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/tags/FunctionTagButtonPanel.java