Possible to enrich Project tool window content

I'm planning to write a plugin which shows on module level the loaded CVS tag for this module.

The best solution would be to enrich the module nodes in the project tool window to show up the CVS tag information.
Is it possible to provide such feature by implementing a plugin?

The second best solution is to provide a separate tool window showing all modules and the correspondig CVS tags.

Thanks in advance!

Helge

6 comments

Hi Helge,

Checked the code and it seems that there is at least brute force solution:

  1. Get project view tree via 'ProjectView.getInstance(myProject).getProjectViewPaneById(ProjectViewPane.ID)';
  2. Wrap its cell renderer into the custom one via 'projectViewPane.getTree().setCellRenderer(new MyWrapCellRenderer(projectViewPane.getTree().getCellRenderer()))'


I'll ask our UI guy to have a look here as well. He might provide better solution.

Denis

0

Thanks for having a quick look into my problem.
It seems that it is at least possible to implement.

Your solution is to modify the "view". Is there any hook into the lifecycle of the tool window?

0

As far as I see, the only hook is com.intellij.openapi.wm.ex.ToolWindowManagerListener (registered via com.intellij.openapi.wm.ex.ToolWindowManagerEx#addToolWindowManagerListener())

Denis

0

You can try to use com.intellij.ide.projectView.TreeStructureProvider and return modified nodes containing to present additional information via com.intellij.ide.projectView.PresentationData#addText()

0

Thanks for the info!

I tried this out but when looking deeper in the related code I found an extension called projectViewNodeDecorator. I think this extension let me implement this much easier.

0

Indeed, this is the proper way.


0

Please sign in to leave a comment.