|
|
|
Re: Displaying selected content from XSD file [message #489291 is a reply to message #489203] |
Fri, 02 October 2009 09:07 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Marcin,
Comments below.
Marcin Cylke wrote:
> Hi,
> I've debugged the selection, and it turns out it is actually an
> XSDSchemaImpl object. So I've tried to investigate
> XsdSchemaItemProvider, but have problems.
>
> That class' getChildrenFeatures has this code in it:
>
> childrenFeatures.add(xsdPackage.getXSDSchema_Contents());
>
> getXSDSchema_Contents() in turn returns 8th structural feature.
>
> This leaves me with a childrenFeature list of size = 1 - only one
> EReference object with name contents. How does that hide all the
> possible objects that can fit in a XSD file?
It seems to me the diagrams in the Javadoc for the XSD package would
answer this. This is the one containment reference for all the physical
contents of the root <xsd:schema> element...
>
> I assume that at some point XSDPackage.createPackageContents() is
> called, but than again, how can I safely trim this code to remove
> XSDAnnotation from its childrenFeatures collection??
If you want filter, you'll need to modify the getChildren method. Note
that Eclipse views, like tree views directly support filtering, so you
might want to take that approach instead.
>
> Just can get the things that are going on in getChildrenFeatures for
> XSDSchema.
>
> Any help appreciated :)
> Marcin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Displaying selected content from XSD file [message #604381 is a reply to message #488957] |
Thu, 01 October 2009 08:31 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Marcin,
Comments below.
Marcin Cylke wrote:
> Hello
>
> I'm trying to create a custom XSD editor using XSDEditor class as a
> basis. I'd like to have a TreeView, as provided by XSDEditor, but I
> don't want to show all the elements of the Xsd Schema in the TreeView.
>
> I found out, that I need to overload getChildrenFeatures of some of
> the ItemProviders, like XSDElementDeclarationItemProvider.
>
> This seems pretty stright forward, but I'm stuck with finding the
> correct sequence of ItemProviders that I need to overload. How can I
> deduce it?
There's a one to one mapping for the type of object displayed in a tree
node and the item provider for that type of object. You could set a
breakpoint in XSDEditor.setSelection to see what type of object is in
the selected node...
> Or perhaps you could suggest me some other solution to my problem?
>
> Regards
> Marcin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Displaying selected content from XSD file [message #604388 is a reply to message #489203] |
Fri, 02 October 2009 09:07 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Marcin,
Comments below.
Marcin Cylke wrote:
> Hi,
> I've debugged the selection, and it turns out it is actually an
> XSDSchemaImpl object. So I've tried to investigate
> XsdSchemaItemProvider, but have problems.
>
> That class' getChildrenFeatures has this code in it:
>
> childrenFeatures.add(xsdPackage.getXSDSchema_Contents());
>
> getXSDSchema_Contents() in turn returns 8th structural feature.
>
> This leaves me with a childrenFeature list of size = 1 - only one
> EReference object with name contents. How does that hide all the
> possible objects that can fit in a XSD file?
It seems to me the diagrams in the Javadoc for the XSD package would
answer this. This is the one containment reference for all the physical
contents of the root <xsd:schema> element...
>
> I assume that at some point XSDPackage.createPackageContents() is
> called, but than again, how can I safely trim this code to remove
> XSDAnnotation from its childrenFeatures collection??
If you want filter, you'll need to modify the getChildren method. Note
that Eclipse views, like tree views directly support filtering, so you
might want to take that approach instead.
>
> Just can get the things that are going on in getChildrenFeatures for
> XSDSchema.
>
> Any help appreciated :)
> Marcin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02694 seconds