Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » StructuredTextEditor validation(how to validate the content of a text editor?)
StructuredTextEditor validation [message #646330] Thu, 23 December 2010 11:31 Go to next message
Alain is currently offline AlainFriend
Messages: 20
Registered: March 2010
Junior Member
Hello,
I created a source page (StructuredTextEditor) on a MultiPageEditorPart. I specify its IEditorInput as an IStorageEditorInput
my editor files has the extension *.myxhtml

...
IStorage storage = new StringStorage(contentString);
IStorageEditorInput input = new StringInput(storage);
sourcePage = new StructuredTextEditor(); 
sourcePage.setEditorPart(this);
int index = addPage(sourcePage, input);
setPageText(index, "SourceXML");
doc = sourcePage.getDocumentProvider().getDocument(input);
...


anytime, I can change the content of the editor by a valid xhtml text:
doc.set(stringXHTML);


the auto completion is perfect, cause I added the extension point :

<extension point="org.eclipse.wst.xml.core.catalogContributions"> 
  <catalogContribution
id="myproject.editor"> 
  <public 
  publicId="http://www.example.org/xhtml" 
  uri="xsd/myTestXSD.xsd"> 
  </public> 
  </catalogContribution> 
  </extension>


My concern is to validate the text content, according to my XSD of course.
I don't know well how to use the extension org.eclipse.wst.sse.ui.sourcevalidation, and I don't know if I have to implement a validator because an XML validator could do the job.
any Ideas? Thank you.
Re: StructuredTextEditor validation [message #728228 is a reply to message #646330] Thu, 22 September 2011 18:42 Go to previous messageGo to next message
Roger  is currently offline Roger Friend
Messages: 11
Registered: September 2011
Junior Member
I'm attempting something similar to this.. and I don't seem to ever get any content suggestion stuff to work.

I have an editor with:
id="org.fakery.studio.editors.knowledgebasetemplateeditor"

and then a catalogContribution extension exactly as above, but with the id set the same as my editor's id.

when I go in to edit, I have no content assist whatsoever

anyone Smile?

Re: StructuredTextEditor validation [message #729681 is a reply to message #728228] Mon, 26 September 2011 18:40 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

For XML validation, you still have to have a reference to the Schema/DTD within the document's text, or be using the org.eclipse.wst.xml.core.externalSchemaLocations extension point.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: StructuredTextEditor validation [message #730014 is a reply to message #729681] Tue, 27 September 2011 13:30 Go to previous message
Roger  is currently offline Roger Friend
Messages: 11
Registered: September 2011
Junior Member
I can't seem to find even 1 "googleable" article or eclipse doc on "or be using the org.eclipse.wst.xml.core.externalSchemaLocations extension point"

do you have any example you could share, would be greatly appreciated
Previous Topic:How do you add Web project to EAR
Next Topic:XPath View...skip namespaces
Goto Forum:
  


Current Time: Thu Apr 25 17:24:00 GMT 2024

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

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

Back to the top