How to persist a DefaultMutableTreeNode ?

Answered

Hi there,

I'm developing a plguin,and i  get a problem,  i build a tree by DefaultMutableTreeNode ,when i use @State、@Storage to persist this data, it doesn't work well,  So i read the document of DefaultMutableTreeNode , it shows me that i can use XMLEnocoer.

I persist the data successfully with XMLEncoder,and I store the file  in  the respective folder  .idea,  

however, when i open two intellj idea tools , i persist the data in the first idea tool , and the data is showed in the second idea  idea tool,it should has been showed in the first tool

i don't  know why and could you give some advice, Thank you in advance

0
4 comments

Not sure I understand. Do you open the same project in two different IDEs simultaneously? That's expected behavior then.

0

Yann Cebron
Let me describe this situation in detail

  1.  I open the first IDE
  2.  I open the second IDE
  3. i use my plugin-in in the first IDE , and store a tree structure successfully  by  using XMLEncoder ,the file is  correctly put in its own  folder  named  .IDEA,
  4. but the data is not shown in the first IDE's toolwindow, it's in the second IDE  

btw , these two IDES open two different projects

0

and i draw  a picture to help you to understand what i am saying  :)

0

Nothing to add to my previous answer. Config files are not "per open IDE instance".

0

Please sign in to leave a comment.