@Override
	public void actionPerformed(SymbolTreeActionContext context) {
		TreePath[] selectionPaths = context.getSelectedSymbolTreePaths();
		if (selectionPaths.length != 1) {
			return;
		}
		Object object = selectionPaths[0].getLastPathComponent();
		if (!(object instanceof LibrarySymbolNode) && !(object instanceof ImportsCategoryNode)) {
			return;
		}

		String externalName = null;
		if (object instanceof LibrarySymbolNode) {
			LibrarySymbolNode libraryNode = (LibrarySymbolNode) object;
			externalName = libraryNode.getName();
		}

		final EditExternalLocationDialog dialog =
			new EditExternalLocationDialog(context.getProgram(), externalName);

		dialog.setHelpLocation(new HelpLocation("SymbolTreePlugin", "CreateExternalLocation"));
		plugin.getTool().showDialog(dialog);
	}
Creates the action for creating a new external location or external function in the 
symbol tree.
@param plugin the symbol tree plugin, which owns this action.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symboltree/actions/CreateExternalLocationAction.java