I was also wondering if a facility that could similarly mask sensitive
information when copying a screen image might also be a feature. I know
there have been times in the past when I have wanted to demonstrate
something by taking screen shots, but have decided against it because I
risked capturing sensitive information along with screen shot.

  Owen.

---------- Forwarded message ---------
From: Owen Thomas <[email protected]>
Date: Tue, 25 Dec 2018 at 10:31
Subject: Re: Code folding in versions later than 8.2.
To: Pieter van den Hombergh <[email protected]>


Thanks for the tips.

Folding does work when I move the lines of the comment that I want to
obscure into their own comment, even though I need to close and reopen the
editor on the file to observe the fold doing its thing. Still, alas, when I
copy the folded text from the editor, I see that the text obscured by the
fold is also copied.

Is there any way to stop text within a fold being copied by ctrl-c? Is
there some parameter one can put in the <editor-fold> markup perhaps? It
would be a convenient touch in that it would provide an opportunity to
protect information disclosed in the comments from inadvertently being
dispersed through a naive quotation of code in, say, a forum like this.

On Tue, 25 Dec 2018 at 00:52, Pieter van den Hombergh <
[email protected]> wrote:

> I read "I try to inset a fold into my comment", which I understand as
> nesting it inside a comment. I think code folds cannot be nested inside
> comments. We use these kinds of code fols extensively in our exams, and
> work just fine OUTSIDE
> of comments. The can be used to collapse comments though, and that works
> just fine.
> Do not know what you really want to fold, but a complete java doc block is
> no problem. If your javadoc blocks get large, e.g. have examples, you may
> consider to move these to a package-info.java file.
>
> Example that works for us:
> //<editor-fold defaultstate="collapsed" desc=" large comment block">
> /**
>  * Base class for all statewalker state machine contexts.
>  *
>  * @author Pieter van den Hombergh
>  * @param <C> Context for this state machine. This
>  * @param <D> Device for all operations
>  * @param <S> State to maintain.
>  */
> //</editor-fold>
> public abstract class ContextBase<C extends ContextBase<C, D, S>, D
> extends Device<C, D, S>, S extends StateBase<C, D, S>> {
>
> Note that when in collapsed state, it will show the doc when your mouse
> hovers over the desc text.
>
> On Mon, Dec 24, 2018 at 12:48 AM Owen Thomas <[email protected]>
> wrote:
>
>> Hi.
>>
>> I'm trying to insert a code fold in a Java comment because I am hoping
>> that using this feature will be a convenience that help obscure bits of the
>> code (and comments) that one wouldn't wish to copy to another document
>> using ctrl-c for instance. Have I understood the use of code folding
>> correctly?
>>
>> Anyway, I try to inset a fold into my comment. It is bounded by the lines:
>>
>> //<editor-fold defaultstate="collapsed" desc="comment">
>> //</editor-fold>
>>
>> When I try this, I do not see the lines I wish to be obscured disappear,
>> nor do I see a fold control ([+]) appear in the left margin of the editor
>> window.
>>
>> Is this a known issue with Netbeans 8.2, and if so, has it been solved in
>> later versions? Do I need to turn a setting on somewhere? I've closed and
>> re-opened the Java file, and this makes no difference. Because the fold is
>> in a comment, the fold would be nested within the fold that appears for the
>> whole comment (fold controls for the whole comment do appear). Is this a
>> bug?
>>
>> Help appreciated...
>>
>> Thanks,
>>
>>   Owen.
>>
>
>
> --
> Pieter Van den Hombergh.
> No software documentation is complete with out it's source code.
>

Reply via email to