private boolean hasValidName() {
		if (blockName == null || blockName.length() == 0) {
			message = "Please enter a Block Name";
			return false;
		}
		if (!Memory.isValidMemoryBlockName(blockName)) {
			message = "Block Name is invalid";
			return false;
		}
		if (nameExists(blockName)) {
			message = "Warning! Duplicate Block Name";
		}
		return true;
	}
Model to manage adding a memory block.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/AddBlockModel.java