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.
1) We should be able to edit guard-blocks directly in the editor, as opposed to going through Customize Code. You could do something like this: <-- users can edit here // creation code start <-- make this comment a guarded block <-- users can edit here // creation code end <-- make this comment a guarded block <-- users can edit here 2) Ideally do away with guard blocks altogether, or as much as possible. For example, instead of "JTable -> properties -> model -> custom code" I'd be able to simply invoke setModel() on the variable. Netbeans would scan the initComponents() code and do its best to recognize what value is passed into setModel(). If it doesn't recognize any code pattern it generates itself it will simply display it as "<user code>" in the properties tab as it already does. Maybe it can mark up code it generated itself using proprietary comments as it currently does for guard-blocks. Maybe it isn't possible to do this for everything, but we should discuss this and do away with as many guard blocks as possible.
I notice that when I create event-listeners the form editor creates method prototypes for me and lets me fill in the contents. 3) How about doing the same thing for Swing properties? For example: JTable myVariableName = ...; myVariableName.setModel(getMyVariableNameModel()); [...] private TableModel getMyVariableNameModel() { // protected block // user inserts code here } // protected block or group related properties up as follows: private static class MyVariableName // protected block { // protected block public TableModel getModel() { // protected block // user fills this in } // protected block public Color getBackgroundColor() { // protected block // user fills this in } // protected block } // protected block I still prefer #2 though.
This has actually been discussed long time ago (see "two-way editing"): http://form.netbeans.org/doc/IssuesAndToDo.html We are certainly planning to make this work better, but I can't tell when it is going to happen...