This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 216669 - Support for defaultstate="expanded" in the editor
Summary: Support for defaultstate="expanded" in the editor
Status: REOPENED
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-10 17:11 UTC by Martin Fousek
Modified: 2016-07-07 07:47 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fousek 2012-08-10 17:11:14 UTC
It would be nice to support defaultstate="expanded" to be able to expand some parts of code by default. Like in this example for collapsed code:
// <editor-fold defaultstate="collapsed">
   Your code goes here...
// </editor-fold>

Thanks in advance.
Comment 1 Svata Dedic 2012-12-06 15:05:29 UTC
I don't quite understand the use-cases. Do you suppose that code will be collapsed by default (e.g. all methods) and the user would force expansion of a specific method using such a comment ?
Comment 2 Martin Fousek 2012-12-07 10:10:32 UTC
(In reply to comment #1)
> I don't quite understand the use-cases. Do you suppose that code will be
> collapsed by default (e.g. all methods) and the user would force expansion of a
> specific method using such a comment ?

Actually I'm not using this feature but I reported that since it sounds reasonable to me what she (CCed hlupec) complains about...

It's exactly as you wrote. You are in the PHP and all methods are collapsed by default. You are using object oriented design so your class handles many basic things which mustn't be often changed together with some frequently used method like #createMenu(). So since you are working in 80% on that one method, it would make sense to have only this one expanded.
Comment 3 Svata Dedic 2015-04-28 05:27:50 UTC
A question - what approach better satisfies the scenario: a marker in the source, as requested in comment #1 (versioned, affects all users), or an invisible marker = persisted folding state (not versioned with file, affects just single user) ?
Comment 4 hlupec 2015-04-28 07:59:21 UTC
Hmmmm, it's hard to choose:) Your idea with persisted folding state is also good, but for my purposes the alternative of <editor-fold defaultstate="collapsed"> is good enough. I think it's also easier to implement:)
Comment 5 Svata Dedic 2015-04-28 13:17:38 UTC
(In reply to hlupec from comment #4)
> Hmmmm, it's hard to choose:) Your idea with persisted folding state is also
> good, but for my purposes the alternative of <editor-fold
> defaultstate="collapsed"> is good enough. I think it's also easier to
> implement:)

Currently <editor-fold> creates a new fold and defines its state. In order to satisfy your scenario I think the <editor-fold> needs to alter other fold's state (the one created for a method/function/inner class, ...) -- this is not supported at the moment. Similar API would be useful to read fold state from some preferences for the persistent folding feature.

But you're right - at least the implementors do not need to invent some fold monikers/IDs :) in order to save their state.
Comment 6 Martin Balin 2016-07-07 07:26:46 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 7 hlupec 2016-07-07 07:47:54 UTC
It's not a bug but a feature request and as far as I know it's not implemented yet ;)