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.
Summary: | canEditAsText=FALSE is ignored in ComboInplaceEditor | ||
---|---|---|---|
Product: | platform | Reporter: | michael.kuettner |
Component: | Property Editors | Assignee: | Stanislav Aubrecht <saubrecht> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.3.1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Small demo application to reproduce behavior |
core-main e8e0615257ca Thanks for the sample code! |
Created attachment 141158 [details] Small demo application to reproduce behavior In my application i have a special String property that is displayed inside an OutlineView. The value of this property shoud be selected by a Combobox. The user should not be allowed to enter any undefined text. So i tried to set "canEditAsText" to Boolean.FALSE for this property. But this has no effect in ComboInplaceEditor (that is automatically used to edit this property), because ComboInplaceEditor has a build in auto-complete-mechanism that sets the combobox to be editable. See connect(PropertyEditor pe, PropertyEnv env) method of ComboInplaceEditor: ... setEditable(editable || isAutoComplete); ... ComboInplaceEditor seems to take care of this auto-complete-mechanism in its getValue() method. But if the user enters any text that is not contained in the Combobox (selItem == -1) and strictAutoCompleteMatching == true then getSelectedItem() is returned. Which again contains the user entered text! See attachment for a small demo application.