private void createDefaultTreeView() {
		Listing listing = currentProgram.getListing();

		String baseName = DEFAULT_TREE_NAME;
		int index = 1;
		String viewName = baseName;
		boolean done = false;
		while (!done) {
			ProgramModule root = listing.getRootModule(viewName);
			if (root == null) {
				CreateDefaultTreeCmd cmd = new CreateDefaultTreeCmd(viewName);
				if (!tool.execute(cmd, currentProgram)) {
					tool.setStatusInfo(cmd.getStatusMsg());
				}
				break;
			}
			viewName = baseName + "(" + index + ")";
			++index;
		}
		TreeViewProvider provider = addTreeView(viewName);
		viewManagerService.setCurrentViewProvider(viewName);
		currentProvider = provider;
	}
Callback from the create default view action in the provider. Add a
one-up number to the default name.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePlugin.java