 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nicholas Sherlock Guest
|
Posted: Wed May 24, 2006 5:15 am Post subject: Persist code folding |
|
|
Hey all,
Is there some setting I can toggle or add-on I can get that would
remember the blocks of code that I've folded when I save & reopen my
project? As far as I'm concerned, this feature has little benefit if I
have to refold code every time I open the IDE.
Cheers,
Nicholas Sherlock
--
http://www.sherlocksoftware.org |
|
| Back to top |
|
 |
Lori M Olson [TeamB] Guest
|
Posted: Thu May 25, 2006 8:15 pm Post subject: Re: Persist code folding |
|
|
Nicholas Sherlock wrote:
| Quote: | Hey all,
Is there some setting I can toggle or add-on I can get that would
remember the blocks of code that I've folded when I save & reopen my
project? As far as I'm concerned, this feature has little benefit if I
have to refold code every time I open the IDE.
Cheers,
Nicholas Sherlock
|
Nicolas,
This lack bothers me, too. If I fold specific pieces that I don't need
to look at most of the time, I'd rather that JBuilder remember. But
AFAIK, it does not.
It would make a good OpenTool, if the code-folding info is exposed in
the OpenTool API. I'm afraid I don't have that level of knowledge of
the OT API.
Gillmer or Paul? You guys know more than I about OT API...
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html |
|
| Back to top |
|
 |
Gillmer J. Derge [TeamB] Guest
|
Posted: Fri May 26, 2006 12:17 am Post subject: Re: Persist code folding |
|
|
Lori M Olson [TeamB] wrote:
| Quote: | Gillmer or Paul? You guys know more than I about OT API...
|
Not about that part. ;-)
--
Gillmer J. Derge [TeamB] |
|
| Back to top |
|
 |
Paul Furbacher [TeamB] Guest
|
Posted: Fri May 26, 2006 6:27 am Post subject: Re: Persist code folding |
|
|
Gillmer J. Derge [TeamB] wrote:
| Quote: | Lori M Olson [TeamB] wrote:
Gillmer or Paul? You guys know more than I about OT API...
Not about that part.
|
Me neither. I'd say that at this point, the original poster
should log the issue in Quality Central as a feature request
for Peleton (JBuilder on Eclipse).
For what it's worth, Eclipse 3.2 M5 doesn't remember either,
at least not in the little comparison test I just did. (I
don't have IDEA, so I cannot compare with that.)
Regardless, it would be a nice feature.
As for writing an open tool, if the code folding API
is not too inscrutable (because of a lack of documentation
or something), you'd create a new property group and
read/write that info upon file closing and opening events.
But that's about all I can say about that ... except that
I'm always too curious about OTAPI, so I just did a little
snooping. At a glance, it looks as though com.borland.
jbuilder.editor.folding.JavaFolder provides a
public FoldBlock[] getAllFolds(
EditorPane editorPane,
NodeInfoEvent nodeInfoEvent,
boolean _boolean)
method. Seems like this could provide just about everything
one would need. Two of the four classes found in a "Find Classes"
search using the pattern *.borland.*.folding.* have JavaDoc.
Not too bad. The info encapsulated in FoldBlock objects would
be the properties saved.
The only problem I see is that saving this info for the files
in a big project could mushroom the size of the .jpx file.
One might want to add the ability to expel entries which are
too old, or limit the info to just the most recent X files
opened.
--
Paul Furbacher (TeamB)
Save time, search the archives:
http://info.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you. |
|
| Back to top |
|
 |
Gillmer J. Derge [TeamB] Guest
|
Posted: Fri May 26, 2006 6:40 am Post subject: Re: Persist code folding |
|
|
Paul Furbacher [TeamB] wrote:
| Quote: | The only problem I see is that saving this info for the files
in a big project could mushroom the size of the .jpx file.
One might want to add the ability to expel entries which are
too old, or limit the info to just the most recent X files
opened.
|
That's one problem. Another is how you deal with files that change via
some non-editor action that invalidates your saved code folding information.
That isn't as obscure a problem as it seems at first glance. It's not
just about running an external editor on the files, which you can chalk
up to user error / don't do that. You also need to think about: you use
the VCS to revert to a previous version or undo changes, one of
JBuilder's designers (ex. EJB, Web Service, etc.) updates the code, you
run code formatting on a package or the whole project, etc. Any sort of
action like that which changes the file without opening it for editing
has the potential to really muck up your code folding data.
I suspect that you'd have much better luck if you forget about saving
the full state and instead implement something like Eclipse's folding
preferences where you can specify certain types of structural elements
that are automatically folded when a file is opened.
--
Gillmer J. Derge [TeamB] |
|
| Back to top |
|
 |
Nicholas Sherlock Guest
|
Posted: Fri May 26, 2006 4:31 pm Post subject: Re: Persist code folding |
|
|
Gillmer J. Derge [TeamB] wrote:
| Quote: | That's one problem. Another is how you deal with files that change via
some non-editor action that invalidates your saved code folding
information.
|
Yes, I assume that this problem is exactly the reason why this feature
hasn't been implemented yet. What if the IDE supported a new source-code
format, say .XJava, which marked folded regions and structural features
with XML?
| Quote: | I suspect that you'd have much better luck if you forget about saving
the full state and instead implement something like Eclipse's folding
preferences where you can specify certain types of structural elements
that are automatically folded when a file is opened.
|
Ah, but that has the opposite problem: I have to manually expand nodes
that I want to look at every time. Not an improvement .
Cheers,
Nicholas Sherlock
--
http://www.sherlocksoftware.org |
|
| Back to top |
|
 |
Lori M Olson [TeamB] Guest
|
Posted: Fri May 26, 2006 7:43 pm Post subject: Re: Persist code folding |
|
|
Gillmer J. Derge [TeamB] wrote:
| Quote: | Paul Furbacher [TeamB] wrote:
The only problem I see is that saving this info for the files
in a big project could mushroom the size of the .jpx file.
One might want to add the ability to expel entries which are
too old, or limit the info to just the most recent X files
opened.
That's one problem. Another is how you deal with files that change via
some non-editor action that invalidates your saved code folding
information.
|
I agree this is a difficult problem. But if Visual Studio can do it...
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html |
|
| Back to top |
|
 |
Doychin Bondzhev Guest
|
Posted: Sat May 27, 2006 2:58 pm Post subject: Re: Persist code folding |
|
|
I think that a solution to this could be the use of javadoc tags to mark
these blocks that you want to be collapsed after file was opened.
In this case you will have full control on this feature.
Doychin
Lori M Olson [TeamB] wrote:
| Quote: | Gillmer J. Derge [TeamB] wrote:
Paul Furbacher [TeamB] wrote:
The only problem I see is that saving this info for the files
in a big project could mushroom the size of the .jpx file.
One might want to add the ability to expel entries which are
too old, or limit the info to just the most recent X files
opened.
That's one problem. Another is how you deal with files that change
via some non-editor action that invalidates your saved code folding
information.
I agree this is a difficult problem. But if Visual Studio can do it...
|
|
|
| Back to top |
|
 |
Alexey N. Solofnenko Guest
|
Posted: Sun May 28, 2006 10:07 pm Post subject: Re: Persist code folding |
|
|
Actually in VisualStudio each block has a name or XPath. Manually
created blocks have names "#region XXX", function/class/special(like
imports and comments) blocks also have automatic names. Their state
persistence is straightforward. "Inner" blocks persistence is more
tricky, because their XPaths can change at any time.
- Alexey.
Doychin Bondzhev wrote:
| Quote: | I think that a solution to this could be the use of javadoc tags to mark
these blocks that you want to be collapsed after file was opened.
In this case you will have full control on this feature.
Doychin
Lori M Olson [TeamB] wrote:
Gillmer J. Derge [TeamB] wrote:
Paul Furbacher [TeamB] wrote:
The only problem I see is that saving this info for the files
in a big project could mushroom the size of the .jpx file.
One might want to add the ability to expel entries which are
too old, or limit the info to just the most recent X files
opened.
That's one problem. Another is how you deal with files that change
via some non-editor action that invalidates your saved code folding
information.
I agree this is a difficult problem. But if Visual Studio can do it...
|
--
Alexey N. Solofnenko
home: http://trelony.cjb.net/ |
|
| Back to top |
|
 |
Jeroen Wenting Guest
|
Posted: Thu Jun 01, 2006 5:58 pm Post subject: Re: Persist code folding |
|
|
That would mean embedding metadata (and worse still, custom metadata that's relevant only to a specific editor and not the compiler or runtime) into sourcecode.
Very very bad idea. Annotations were a Bad Thing, this would be even worse.
The only realistic option that doesn't change the language to include editor specific information into sourcefiles (which has always one of the main strong points of JBuilder over things like Netbeans and Visual AIDS for Java) is to save the information externally to the sourcefile.
And if the fold is stored on method signature it'll persist if the location of the method in the source file changes. The editor could automatically update the stored information to remove stale information (for methods and sources removed outside of the project for example).
That would of course limit the types of folds that can be persisted to high level ones, as there's no way to store such information about blocks inside methods, but it's better than nothing.
Doychin Bondzhev <doychin@dsoft-bg.com> wrote:
| Quote: | I think that a solution to this could be the use of javadoc tags to mark
these blocks that you want to be collapsed after file was opened.
In this case you will have full control on this feature.
Doychin
Lori M Olson [TeamB] wrote:
Gillmer J. Derge [TeamB] wrote:
Paul Furbacher [TeamB] wrote:
The only problem I see is that saving this info for the files
in a big project could mushroom the size of the .jpx file.
One might want to add the ability to expel entries which are
too old, or limit the info to just the most recent X files
opened.
That's one problem. Another is how you deal with files that change
via some non-editor action that invalidates your saved code folding
information.
I agree this is a difficult problem. But if Visual Studio can do it...
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|