| XML Editor content assist [message #223419] |
Tue, 04 November 2008 06:58  |
Peter Messages: 2 Registered: July 2009 |
Junior Member |
|
|
I try to find out, how the xml editor knows what proposals he can made at
the respectiv position in the editor.
I have study different tutorial so that i known that the file is divided
in partitions and that i assign every region with a
contentAssistProcessor, but the final step missing me. I can not find out
how it is realized, that the proposals depend on the xml schema, which is
declared in the prolog of the xml-file. I can not find any documents
therefor.
Can somebody tell me how it is realized or advise me same documents, where
i can that find out!?!?
|
|
|
| Re: XML Editor content assist [message #223445 is a reply to message #223419] |
Tue, 04 November 2008 12:46   |
|
Originally posted by: dcarver.starstandard.org
Peter wrote:
> I try to find out, how the xml editor knows what proposals he can made
> at the respectiv position in the editor.
> I have study different tutorial so that i known that the file is divided
> in partitions and that i assign every region with a
> contentAssistProcessor, but the final step missing me. I can not find
> out how it is realized, that the proposals depend on the xml schema,
> which is declared in the prolog of the xml-file. I can not find any
> documents therefor.
>
> Can somebody tell me how it is realized or advise me same documents,
> where i can that find out!?!?
>
The code for handling this is in the XMLContentAssistProcessor class, it
will make use of the XMLContentModelGenerator class to help get the
correct elements that can be used in the proposals list.
Look at the org.eclipse.wst.xml.ui plugin for more information in the
SRC folder, in the org.eclipse.wst.xml.ui.internal.contentassist package.
|
|
|
|
| Re: XML Editor content assist [message #223573 is a reply to message #223541] |
Thu, 06 November 2008 09:54  |
Nick Sandonato Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Peter wrote:
> Thank you for the answer. This was very helpful to understand the
> content assist better.
>
> But there is one open question i can not solve. Is it right, that in the
> method "computeCompletionProposals(ITextViewer, int)" of the
> AbstractContentAssistProcessor class the ContentAssistUtils offers a
> tree with the corresponding schema. so that i can retriev the node for
> the specific content assist depend on the cursor position in the editor.
> Or what is in the tree and who is responsible to read and parse the
> schema !?!?
>
You're right that the ContentAssistUtils class provides the node for
which the cursor is located.
If you're looking at how to retrieve the content model information about
that node, you should be looking at the ModelQuery interface and its
implementors. The method addAttributeNameProposals(ContentAssistRequest)
in AbstractContentAssistProcessor may be helpful in providing an example.
|
|
|
Powered by
FUDForum. Page generated in 0.01502 seconds