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 82573 - REGRESSION: addiing element in design view works wrong
Summary: REGRESSION: addiing element in design view works wrong
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Ayub Khan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-13 03:03 UTC by Ivan Sidorkin
Modified: 2006-09-06 11:50 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Sidorkin 2006-08-13 03:03:20 UTC
Build RC1

- create Java Application
- in Schema view create 2 elements 'a' and 'b'
- switch to Design view
- in context menu for element 'a' select Add -> Element
- type 'b' as name and press Enter
- switch to source view

source code is wrong

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xml.netbeans.org/schema/newXMLSchema"
            xmlns:tns="http://xml.netbeans.org/schema/newXMLSchema"
            elementFormDefault="qualified">
    <xsd:element name="a">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element ref="tns:NewElement01"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="b"/>
    <xsd:element name="b"/>
</xsd:schema>
Comment 1 Samaresh Panda 2006-08-16 00:44:30 UTC
For element and attribute references, when it's renamed, we should check if the
new name is same as global element or attribute. If so, we should change their
referents.

AttributeImpl.java: new revision: 1.1.2.11;
AttributeRef.java: new revision: 1.1.2.13;
ElementImpl.java: new revision: 1.1.2.28;
ElementRef.java: new revision: 1.1.2.19;
AXIDocument.java: new revision: 1.1.2.12;
AXIComponent.java: new revision: 1.1.2.45;

It turns out, in the above scenario, the AXIComponent behind the node in ABE is
an Element and not an ElementRef.

-->to Ayub
Comment 2 Samaresh Panda 2006-08-16 01:38:30 UTC
BTW I do not think this is a regression.
Util.java: new revision: 1.1.2.51;
Comment 3 Ayub Khan 2006-08-23 01:45:56 UTC
Fixed in trunk.

Files affected:
===============
/cvs/xml/axi/src/org/netbeans/modules/xml/axi/impl/Attic/SchemaGeneratorUtil.java,v
 
new revision: 1.1.2.2; previous revision: 1.1.2.1

Comment 4 Ivan Sidorkin 2006-09-06 11:50:03 UTC
verified in 060905