TreeModelBuilder (@Nullable Map<VirtualFile, @NlsSafe String> switchedRoots) { if (ContainerUtil.isEmpty(switchedRoots)) return this; ChangesBrowserNode<?> rootsHeadNode = createTagNode(ChangesBrowserNode.SWITCHED_ROOTS_TAG, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES, true); List<VirtualFile> files = sorted(switchedRoots.keySet(), FILE_COMPARATOR); for (VirtualFile vf : files) { final ContentRevision cr = new CurrentContentRevision(VcsUtil.getFilePath(vf)); final Change change = new Change(cr, cr, FileStatus.NOT_CHANGED); final String branchName = switchedRoots.get(vf); insertChangeNode(vf, rootsHeadNode, createChangeNode(change, new ChangeNodeDecorator() { @Override public void decorate(@NotNull Change change1, @NotNull SimpleColoredComponent component, boolean isShowFlatten) { } @Override public void preDecorate(@NotNull Change change1, @NotNull ChangesBrowserNodeRenderer renderer, boolean showFlatten) { renderer.append("[" + branchName + "] ", SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES); } })); } return this; }