public void targetPanelSelectionChanged(boolean validFunction) {

		boolean hasSelection = targetPanel.hasSelection();
		boolean isImmutable = targetPanel.isSelectionImmutable();

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

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

		deleteBtn.setEnabled(hasSelection && !isImmutable);
	}
Invoked when the user has selected an item in the target 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