Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 237203 - canEditAsText=FALSE is ignored in ComboInplaceEditor
canEditAsText=FALSE is ignored in ComboInplaceEditor
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Property Editors
7.3.1
PC Windows XP
: P3 with 1 vote (vote)
: 8.0
Assigned To: Stanislav Aubrecht
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-16 14:23 UTC by michael.kuettner
Modified: 2013-10-21 13:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
Small demo application to reproduce behavior (2.51 KB, application/zip)
2013-10-16 14:23 UTC, michael.kuettner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michael.kuettner 2013-10-16 14:23:15 UTC
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.
Comment 1 Stanislav Aubrecht 2013-10-21 13:56:10 UTC
core-main e8e0615257ca

Thanks for the sample code!


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo