Recreate BranchesTreeComponent

Answered

What is the easiest way to recreate the BranchesTreeComponent?

I would like to have this in my new version of the Git Scope plugin as Branch chooser as Scrollable Pane in the Toolwindow. Exactly as-is under Git -> Log. The only thing i need to extend is the Click-Listener. As far as i understand all of these classes are internal. I already have a similar Pop-Up for this. I was forced to copy-paste many classes and make them "my own". So i thought it is a good idea if you can give me an advice how to do this better. Maybe a Factory or something exists for this.

0
5 comments

There's no way for 3rd party plugins to re-use this component and we do not plan to expose any API for it in the future.

0

Yes i already thought so. I am currently trying to rebuilding this panel by creating a JBList and just want to match the look and feel of JetBrains UI. The Documentation do not cover that part (https://plugins.jetbrains.com/docs/intellij/lists-and-trees.html). Do i really need to create my own cellRenderer with margin, spacing, hover effect, ect? Furthermore i also need the Collapsable Group. There has to be something to reuse to not re-invent the wheel all the time, right? How to do that the shortest/cleanest way?

Thanks for your help (Please consider: I am usually not a Java/Jetbrains developer; This is very challenging for me to figure out everything by my own; I am spending a lot of time now to polish my Plugin to be bug-free and having a good looking UI - Thanks again)

0

I'm afraid, but we don't have any documentation for such detailed questions. I can only recommend to browse the existing components in the UI and inspect their code. You can use UI Inspector https://plugins.jetbrains.com/docs/intellij/internal-ui-inspector.html and the tips collected in https://plugins.jetbrains.com/docs/intellij/explore-api.html.

0

Thanks for the links. I think this isnt a very specific question. The question is basically: "How to create a JList which looks like a native intellij Component" (or similar). I think this is something that should be covered if you want that plugins also looks like the rest of the Editor especially with the new UI.

0

Almost no plugin has the need to re-create or "copy" existing UI components from the IDE's user interface. Thus the lack of guidelines. Maybe you can find other existing components in the UI that you can use without problems.

0

Please sign in to leave a comment.