private void addTreeViews() {
		deregisterService(ViewProviderService.class, defaultProvider);

		if (currentProgram == null) {
			// unexplained exception case seen in the wild
			addDefaultProvider();
			return;
		}

		String[] treeNames = currentProgram.getListing().getTreeNames();
		TreeViewProvider firstProvider = null;
		for (String element : treeNames) {
			TreeViewProvider p = addTreeView(element);
			if (firstProvider == null) {
				firstProvider = p;
			}
		}

		if (firstProvider == null) {
			addDefaultProvider();
			return;
		}

		viewManagerService.setCurrentViewProvider(firstProvider.getViewName());
		actionManager.setProgramTreeView(firstProvider.getViewName(),
			firstProvider.getProgramDnDTree());
	}
Add tree views that are in the program; if no trees exist (unlikely),
then add the default provider.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePlugin.java