private void addLocationToView(ProgramLocation loc) {
		ProgramFragment fragment =
			program.getListing().getFragment(treePanel.getTreeName(), loc.getAddress());
		if (fragment == null) {
			return;
		}
		LinkedList<String> list = new LinkedList<>();
		list.add(fragment.getName());
		Group group = fragment;
		while (group != null) {
			ProgramModule[] parents = group.getParents();
			group = null;
			if ((parents != null) && (parents.length > 0)) {
				group = parents[0];
				list.addFirst(group.getName());
			}
		}
		String[] groupNames = new String[list.size()];
		list.toArray(groupNames);
		treePanel.addGroupViewPath(new GroupPath(groupNames));
		notifyListeners();
	}
Add to the view the group that corresponds to the address
in the program location.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/TreeViewProvider.java