@Override
    public void decorate(ProjectViewNode<?> node, PresentationData data) {
      Object value = node.getValue();
      RootType rootType;
      VirtualFile virtualFile = null;
      if (value instanceof RootType) {
        rootType = (RootType)value;
      }
      else {
        virtualFile = node.getVirtualFile();
        if (virtualFile == null || !virtualFile.isValid()) return;
        rootType = ScratchFileService.getInstance().getRootType(virtualFile);
        if (rootType == null) return;
      }
      ScratchFileService scratchFileService = ScratchFileService.getInstance();
      VirtualFile rootFile = LocalFileSystem.getInstance().findFileByPath(scratchFileService.getRootPath(rootType));
      String text;
      if (virtualFile == null || virtualFile.isDirectory() && virtualFile.equals(rootFile)) {
        text = rootType.getDisplayName();
      }
      else {
        Project project = Objects.requireNonNull(node.getProject());
        text = rootType.substituteName(project, virtualFile);
      }
      if (text != null) {
        data.clearText();
        data.addText(text, SimpleTextAttributes.REGULAR_ATTRIBUTES);
        data.setPresentableText(text);
      }
    }
@Override
    public void decorate(ProjectViewNode<?> node, PresentationData data)