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 1885

Summary: Option in Form Editor to make some component variables local vars rather than instance.
Product: guibuilder Reporter: Jesse Glick <jglick>
Component: CodeAssignee: Jesse Glick <jglick>
Status: CLOSED WONTFIX    
Severity: normal    
Priority: P4    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jesse Glick 1999-05-20 02:54:33 UTC
Idea: add a node property to the Synthetic sheet of the Component Inspector which would read "Local Var?", by default false, meaning that component is represented as an instance var in the form clas
s. If switched on, the var definition is moved into the body of initComponents as a local var, and it has no instance name at all--this is I think a little cleaner code where it is possible since read
ers of the class are not confused as to whether the variable might be "used again" for some other purpose later.

Disadvantage is that it must be turned off if the var is to be used in a handler or some such, of course, adding a little complexity to the user interface. Probably the Connection Wizard would need to
 automatically turn off this property on any var for a component used as a C.W. target; the user could reenable it if they were not really using it, then the compiler would tell them for sure.


Is this useful at all? BTW, the access modifier in FormSettings would of course not apply if a local var.

[IAN] Probably not that useful given the tradeoff of increased complexity both for us and for the user