Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34518
| From | Nigel Wade <nmw@ion.le.ac.uk> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Moving code in Netbeans |
| Date | 2016-06-07 09:26 +0100 |
| Message-ID | <drneplFord2U1@mid.individual.net> (permalink) |
| References | (2 earlier) <5755F82F.7090709@fastmail.fm> <d5080771-13d0-4bfb-b5d5-34639e05b201@googlegroups.com> <nj5dj7$nlp$3@gioia.aioe.org> <nj5f4u$6mh$1@dont-email.me> <nj5hq0$s34$1@gioia.aioe.org> |
On 07/06/16 05:16, Dave wrote: > On 06/06/2016 11:30 PM, Eric Sosman wrote: >> On 6/6/2016 11:04 PM, Dave wrote: >>> On 06/06/2016 07:52 PM, Lew wrote: >>>> On Monday, June 6, 2016 at 3:24:58 PM UTC-7, Dave wrote: >>>>> On 06/06/2016 04:47 PM, Lew wrote: >>>>>> Sounds like you're trying to rearrange generated code, which NB >>>>>> locks. As a rule NB allows moving code blocks. >>>>>> >>>>> Yes. NB seems to want to put things in its order, but I have a >>>>> different idea of how things need to be. I like to organize things >>>>> Property, Method, Event, support functions. Within each group, I do >>>>> them alphabetically to make finding them easier. Is there an easy way >>>>> to do this? >>>> >>>> So this is NOT about protected code blocks, but just the default order >>>> of things? >>> >>> That order is configurable, to a degree. Have you played with the >>> options? You should. >>>> >>>> Past a certain point, if you are depending on the IDE to organize your >>>> code your way >>> >>> and leave you no work to do at all, you will be disappointed. No IDE can >>> account for >>> >>> your every personal quirk. You're just going to have to get off your >>> butt and >>> >>> rearrange things for yourself if it comes to that. Tough luck, kid. >>>> >>> That is what I want to do - just don't know how. I don't give a crap >>> how NB structures things. I just want to be able to re-structure them >>> when I have finished a class. So how?? >> >> It's still not clear (to me, anyhow) whether you're talking about >> code generated by NB or code you wrote yourself. The latter -- well, >> you're certainly free to move it around, rename things, delete things, >> and basically bash on it to your heart's content. But the code created >> from a sketch of a GUI? No, sorry: NetBeans "owns" that code, basically >> because you asked NetBeans to write it for you -- and if you modify the >> sketch, NetBeans needs to be able to find re-write the code. This last >> would be difficult if in the meantime you'd made arbitrary modifications >> to it, no? >> >> If you don't like NetBeans "owning" the code, write it yourself >> instead of auto-generating it. And if that's not what you're having >> trouble with, please explain your situation more completely. >> > Actually, I was very clear. I'm creating a GUI, which means that some of the code is auto-created and located where NB > wants to place them. I would like to restructure the class so all properties are together, all events are together, > etc. How? > Very simple. There are two methods. You either cut the method body and paste it into a new method. Or you delete the code "protection" comments from before and after the method. ( // <editor-fold defaultstate="collapsed" desc="Generated Code">) Either way will result in you no longer being able to use Matisse to change anything. Also, whilst you are at it you probably want to delete the .form file which Matisse uses to generate the GUI since this will no longer serve any useful function and will probably confuse NetBeans. I fail to see why you would want to do this. If you are generating the code, and maintaining the code there's some logic to ordering the code so you can more easily locate things. But, since you are not creating the code, nor maintaining the code, I don't see how it matters what order the code is actually written in. NetBeans even helps you in this respect by collapsing/folding the generated code so you don't get to see it. If you want to have complete control then forget about using Matisse and design the GUI by hand. That way you get to decide exactly how the code is ordered. Trying to merge the two concepts, using Matisse to generate the code then editing it yourself, will lead to much frustration and eventual insanity. Don't go there. Choose one path and stick to it.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Moving code in Netbeans Dave <dboland9@fastmail.fm> - 2016-06-06 16:03 -0400
Moving code in Netbeans Lew <lewbloch@gmail.com> - 2016-06-06 13:47 -0700
Re: Moving code in Netbeans Dave <dboland9@fastmail.fm> - 2016-06-06 18:24 -0400
Re: Moving code in Netbeans Lew <lewbloch@gmail.com> - 2016-06-06 16:52 -0700
Re: Moving code in Netbeans Dave <dboland9@fastmail.fm> - 2016-06-06 23:04 -0400
Re: Moving code in Netbeans Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-06 23:30 -0400
Re: Moving code in Netbeans Dave <dboland9@fastmail.fm> - 2016-06-07 00:16 -0400
Re: Moving code in Netbeans Andreas Leitgeb <avl@logic.at> - 2016-06-07 06:53 +0000
Re: Moving code in Netbeans Nigel Wade <nmw@ion.le.ac.uk> - 2016-06-07 09:26 +0100
Re: Moving code in Netbeans Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-07 07:44 -0400
Re: Moving code in Netbeans Dave <dboland9@fastmail.fm> - 2016-06-07 07:53 -0400
Re: Moving code in Netbeans Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-07 08:24 -0400
Re: Moving code in Netbeans Martin Gregorie <martin@address-in-sig.invalid> - 2016-06-07 13:22 +0000
Re: Moving code in Netbeans Eric Douglas <e.d.programmer@gmail.com> - 2016-06-07 06:23 -0700
Re: Moving code in Netbeans Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-07 10:10 -0400
Re: Moving code in Netbeans Eric Douglas <e.d.programmer@gmail.com> - 2016-06-07 07:36 -0700
Re: Moving code in Netbeans Arne Vajhøj <arne@vajhoej.dk> - 2016-06-07 20:23 -0400
Re: Moving code in Netbeans Lew <lewbloch@gmail.com> - 2016-06-07 13:43 -0700
Re: Moving code in Netbeans Arne Vajhøj <arne@vajhoej.dk> - 2016-06-07 20:30 -0400
Re: Moving code in Netbeans Arne Vajhøj <arne@vajhoej.dk> - 2016-06-07 20:19 -0400
Re: Moving code in Netbeans Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-07 20:31 -0400
Re: Moving code in Netbeans Arne Vajhøj <arne@vajhoej.dk> - 2016-06-07 21:12 -0400
Re: Moving code in Netbeans Eric Douglas <e.d.programmer@gmail.com> - 2016-06-08 06:41 -0700
Re: Moving code in Netbeans Arne Vajhøj <arne@vajhoej.dk> - 2016-06-08 17:08 -0400
Re: Moving code in Netbeans Lew <lewbloch@gmail.com> - 2016-06-07 13:39 -0700
Re: Moving code in Netbeans Robin Koch <robin.koch@t-online.de> - 2016-06-07 23:29 +0200
csiph-web