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 145921 - Use standard editors code validation in "Add Property" dialog
Summary: Use standard editors code validation in "Add Property" dialog
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Beans (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-02 14:02 UTC by Petr Dvorak
Modified: 2010-09-23 08:44 UTC (History)
0 users

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 Petr Dvorak 2008-09-02 14:02:31 UTC
Product Version: NetBeans IDE Dev (Build 200809010201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14
System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)

Dialog for adding properties is quite complex now and user can simply make a mistake when using it, generating an
invalid code in the editor.

An example could be generating a property of type String called S and assigning a value of '5' to it (int property).
User gets no warning, no errors are shown in the preview, but when he/she clicks OK, erroneous code is generated in the
editor. Another example is assigning a scalar value to indexed property...

Implementing various individual checks for fields in this dialog is infeasible and it would be a long term run -
therefore I believe that solution using infrastructure what we already have should be a better way to go.

It would be helpful to disable OK button in case that code would contain new errors if property was generated with
currently given parameters. There would be also a warning in the bottom of the dialog describing the problem, like
"Generated code would contain errors - review property parameters and fix all problems". (Maybe disabling OK button is
too much, a warning could be enough...).

A compiler that we use can be easily used for this check - you can for example just place the code that is displayed in
the preview to some fake empty class and try to compile it...
Comment 1 Petr Dvorak 2008-09-02 14:04:11 UTC
Sorry, RFE, not a defect...