Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » XML Editor content assist
XML Editor content assist [message #223419] Tue, 04 November 2008 11:58 Go to next message
Peter is currently offline PeterFriend
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 17:46 Go to previous messageGo to next message
Eclipse UserFriend
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 #223541 is a reply to message #223445] Thu, 06 November 2008 08:40 Go to previous messageGo to next message
Peter is currently offline PeterFriend
Messages: 2
Registered: July 2009
Junior Member
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
!?!?
Re: XML Editor content assist [message #223573 is a reply to message #223541] Thu, 06 November 2008 14:54 Go to previous message
Nick Sandonato is currently offline Nick SandonatoFriend
Messages: 126
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.
Previous Topic:Launch the web application automatically when deploying EAR project
Next Topic:refactoring framework and EMF2DOMSSE
Goto Forum:
  


Current Time: Wed Apr 24 19:01:42 GMT 2024

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

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

Back to the top