private void updateVertexName(
			java.util.function.Function<AttributedVertex, Address> addressFunction,
			VertexGraphActionContext context) {

		AttributedVertex vertex = context.getClickedVertex();
		Address address = addressFunction.apply(vertex);
		Symbol symbol = program.getSymbolTable().getPrimarySymbol(address);

		if (symbol == null) {
			AddEditDialog dialog = new AddEditDialog("Create Label", tool);
			dialog.addLabel(address, program, context.getComponentProvider());
		}
		else {
			AddEditDialog dialog = new AddEditDialog("Edit Label", tool);
			dialog.editLabel(symbol, program, context.getComponentProvider());
		}
	}
<CODE>GraphTask</CODE> is a threaded task creating either a block or call graph.
Ghidra/Features/ProgramGraph/src/main/java/ghidra/graph/program/BlockGraphTask.java