Create toolWindow with tree

Hi,
i'm trying to create a new toolWindow and inside it build a tree, something like:

a
|-b
| |- filename1-path
| |- filename2-path
|-c
| |- filename3-path
...

What i want is to build a plugin so that when you are working on a set of files you add them and associate them with a topic (in the tree example, b or c).
Then, i could navigate throug the topics and double click a filename3-path and open that file.
I already create the tree but i'm using JTree and DefaultMutableTreeNode classes so the layout is not the same has Intellij.
Can anyone tell me how to have the layout as intellij and how do i associate mouse clicks to the nodes so that the file is opened when i double click it?
Thanks in advance

Raul




2 comments

Hello Raul,

First of all - this sounds very much like the "Favorites" feature added in
IDEA 5.0. Have you tried using it? Maybe it will suit you and you won't need
writing a plugin?

R> i'm trying to create a new toolWindow and inside it build a tree,
R> something like:
R> a
R> |-b
R> | |- filename1-path
R> | |- filename2-path
R> |-c
R> | |- filename3-path
R> ..
R> What i want is to build a plugin so that when you are working on a
R> set of files you add them and associate them with a topic (in the
R> tree example, b or c).
R>
R> Then, i could navigate throug the topics and double click a
R> filename3-path and open that file.
R>
R> I already create the tree but i'm using JTree and
R> DefaultMutableTreeNode classes so the layout is not the same has
R> Intellij.
R>
R> Can anyone tell me how to have the layout as intellij and how do i
R> associate mouse clicks to the nodes so that the file is opened when i
R> double click it?
R>
R> Thanks in advance
R>
R> Raul
R>
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Ho Dmitry,
thanks for your reply.
I wanted this pluggin because at work we still use the 4.5 version and i think we will be using it for a while. If it's ok, can you still answer me how i could do it?
But I have the 5.0 installed at home so I'll see how the favorites plugin work.

Raul

0

Please sign in to leave a comment.