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 91823

Summary: Schema Based code completion should provide completion values for attributes of type enumeration
Product: xml Reporter: vivekjain <vivekjain>
Component: Schema ToolsAssignee: issues@xml <issues>
Status: RESOLVED FIXED    
Severity: blocker CC: abadea, aj-nb, bharathch, rohanranade, samaresh
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 122444    

Description vivekjain 2007-01-04 14:50:43 UTC
Schema Based code completion should provide completion values for attributes of
type enumeration.

If a user is authoring an xml file with the schema support, and asks for
completion for the value of attribute of type enumeration, Schema Based
completion must provide list of valid values with respect to attribute's type.

For example consider the following xml file which needs completion for attribute
'modifier':

<component xmlns='http://www.sun.com/schema/SPS'
  xsi:schemaLocation='http://www.sun.com/schema/SPS ../schema/component.xsd' 
  modifier="[CTRL_SPACE]">

    <extends>
        <type name='system#file'></type>
    </extends>
</component>

--------------SCHEMA-----------------
...
  <simpleType name="modifierEnumType">
    <restriction base="string">
      <enumeration value="ABSTRACT"/>
      <enumeration value="FINAL"/>
    </restriction>
  </simpleType>
...
------------SCHEMA-END---------------

If user ask for completion for the 'modifier' attribute, where 'modifier'
attribute is of type 'modifierEnumType', schema based code-completion should
read the schema and provide the valid values that is 'ABSTRACT' & 'FINAL' in our
example.

Currently schema based code completion is not providing the values for
Enumeration type attributes but validation against schema will detect the error
if user provide some invalid value. Following is the error I got when I provide
the value 'abc' instead of values 'ABSTRACT' or 'FINAL'.

----------------------------------OUTPUT------------------------------------
Value 'abc' is not facet-valid with respect to enumeration '[ABSTRACT, FINAL]'.
It must be a value from the enumeration.

The value 'abc' of attribute 'modifier' on element 'component' is not valid with
respect to its type, 'modifierEnumType'.
----------------------------------------------------------------------------

Since the schema knows the possible values for particular attribute, Schema
based code completion should provide those values in completion list.

Thanks & Regards,
Vivek
Comment 1 Samaresh Panda 2008-04-04 15:40:29 UTC
*** Issue 132041 has been marked as a duplicate of this issue. ***
Comment 2 Andrei Badea 2008-04-07 13:01:05 UTC
This doesn't look like an enhancement.
Comment 3 Samaresh Panda 2008-04-16 18:11:54 UTC
post 6.1.