How to create my own diagram represents some file structure

93 views Asked by At

I would like to add a feature into my internal Intellij IDEA plugin. The feature is about to create diagram representing some relationships between lines in one concrete file. I cannot explain whole background, but lets assume that I have txt file with lines and every single line should represent a Node in final diagram.

I have strated to implement this, but It seems that Intellij doesnt support this?

My idea was to create DiagramProvider with

  @Override
  public DiagramDataModel<Node> createDataModel(@NotNull Project project, @Nullable Node node, @Nullable VirtualFile virtualFile, DiagramPresentationModel diagramPresentationModel) {
    return new FileDiagramDataModel(project, Parser.getNodes(virtualFile));
  }

I expected that in virtualFile I will have the file that I right-clicked. But it doesn't work that way.

The problem is cause by VfsResolver I think. I dont exactly know what it does, but I want to work only with one file.

Do you have any idea how to solve my issue?

Thanks, Ondrej

0

There are 0 answers