Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » FeatureID=-1
FeatureID=-1 [message #425151] Mon, 17 November 2008 10:07 Go to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Hi all,
I save a EAttribute into a EMF model file, for example:
<?xml version="1.0" encoding="UTF-8"?>
<editor:Editor xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:editor="http://www.hirain.com/ui/editor">
<children layoutData="//@layoutdatas.2" layout="//@layouts.0">
<children xsi:type="editor:Label" layoutData="//@layoutdatas.1"
text="LibraryName:"/>
<children xsi:type="editor:Text" layoutData="//@layoutdatas.0">
<modelAttribute href="extlibrary.ecore#//Library/name"/>
</children>
<children xsi:type="editor:Label" layoutData="//@layoutdatas.1"
text="dsddsafd"/>
<children xsi:type="editor:Text" layoutData="//@layoutdatas.0"/>
</children>
<layouts xsi:type="editor:GridLayout" name="aaa" numColumns="2"/>
<layoutdatas xsi:type="editor:GridData" name="fill"
verticalAlignment="FILL" horizontalAlignment="FILL"
grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true"/>
<layoutdatas xsi:type="editor:GridData" name="normal" horizontalSpan="2"/>
<layoutdatas xsi:type="editor:GridData" name="hFill"
horizontalAlignment="FILL" horizontalIndent="0"
grabExcessHorizontalSpace="true"/>
</editor:Editor>

When I load this resource, I found the library/name EAttribute's
featureID=-1, so I can't get the value of library's name by
eObject.eGet(eStructuralFeature).What should I do?
Re: FeatureID=-1 [message #425171 is a reply to message #425151] Tue, 18 November 2008 06:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Probably there's something missing from note by way of explaining the
background of your problem because this should normally be initialized
to a non-zero value for a generated model.


xxlu wrote:
> Hi all,
> I save a EAttribute into a EMF model file, for example:
> <?xml version="1.0" encoding="UTF-8"?>
> <editor:Editor xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:editor="http://www.hirain.com/ui/editor">
> <children layoutData="//@layoutdatas.2" layout="//@layouts.0">
> <children xsi:type="editor:Label" layoutData="//@layoutdatas.1"
> text="LibraryName:"/>
> <children xsi:type="editor:Text" layoutData="//@layoutdatas.0">
> <modelAttribute href="extlibrary.ecore#//Library/name"/>
> </children>
> <children xsi:type="editor:Label" layoutData="//@layoutdatas.1"
> text="dsddsafd"/>
> <children xsi:type="editor:Text" layoutData="//@layoutdatas.0"/>
> </children>
> <layouts xsi:type="editor:GridLayout" name="aaa" numColumns="2"/>
> <layoutdatas xsi:type="editor:GridData" name="fill"
> verticalAlignment="FILL" horizontalAlignment="FILL"
> grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true"/>
> <layoutdatas xsi:type="editor:GridData" name="normal" horizontalSpan="2"/>
> <layoutdatas xsi:type="editor:GridData" name="hFill"
> horizontalAlignment="FILL" horizontalIndent="0"
> grabExcessHorizontalSpace="true"/>
> </editor:Editor>
>
> When I load this resource, I found the library/name EAttribute's
> featureID=-1, so I can't get the value of library's name by
> eObject.eGet(eStructuralFeature).What should I do?
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Implementing Setters for Derived references
Next Topic:EList undo a "set"
Goto Forum:
  


Current Time: Thu Apr 25 20:17:49 GMT 2024

Powered by FUDForum. Page generated in 0.02945 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top