[nbdev] Re: Listening for file open/close/save from a module

  • From: Geertjan Wielenga < >
  • To:
  • Subject: [nbdev] Re: Listening for file open/close/save from a module
  • Date: Tue, 05 Feb 2013 16:33:35 +0100

On 02/04/2013 08:46 PM, cmann wrote:
Geertjan Wielenga wrote:
However, I continue to wonder how this is going to work. How are you
going to save the folds? How are you going to restore the folds when the
file opens?
Are you saying that you know for a fact that the Netbeans plugin API does not 
contain the functionality required to implement this or are you just 
speculating?
Remember that I have absolutely no previous knowledge about Netbeans plugin 
development so the only way to find out was for me to try.

This is how I imagined the plugin would work (assuming that a plugin had 
access to the required data and the functionality needed to use it) :
First when a file is saved or closed, query the fold structure and get the 
folded nodes - assuming that there is some sort of id or index associated 
with a fold node. Then the plugin will have some sort of config/cache 
directory or database where it will write the id/indexes of the folded nodes 
to an entry associated with the opened file's full path.
When a file is opened the cache will be checked to find an entry matching the 
opened file's path, if one exists the nodes that were previously marked as 
folded will automatically be folded again.

So, you'd need to be able to write and restore code folds for hundreds, or thousands, or more, files? I.e., let's say I have 20 projects open, each with a few thousand Java source files. Should the fold state of each of those files be stored and then restored to the file once it opens?

Gj


[nbdev] Re: Listening for file open/close/save from a module

(continued)

[nbdev] Re: Listening for file open/close/save from a module

Thomas Schneider 02/04/2013

[nbdev] Re: Listening for file open/close/save from a module

Benno Markiewicz 02/03/2013

[nbdev] Listening for file open/close/save from a module

cmann 02/03/2013

[nbdev] Re: Listening for file open/close/save from a module

Geertjan Wielenga 02/03/2013

[nbdev] Re: Listening for file open/close/save from a module

Benno Markiewicz 02/03/2013

[nbdev] Listening for file open/close/save from a module

cmann 02/04/2013

[nbdev] Re: Listening for file open/close/save from a module

Geertjan Wielenga 02/04/2013

[nbdev] Listening for file open/close/save from a module

cmann 02/04/2013

[nbdev] Re: Listening for file open/close/save from a module

Geertjan Wielenga 02/05/2013

[nbdev] Re: Listening for file open/close/save from a module

Geertjan Wielenga 02/05/2013

[nbdev] Re: Listening for file open/close/save from a module

Geertjan Wielenga 02/05/2013

[nbdev] Listening for file open/close/save from a module

cmann 02/05/2013

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close