Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » StructuredTextEditor validation(how to validate the content of a text editor?)
StructuredTextEditor validation [message #646330] Thu, 23 December 2010 06:31 Go to next message
Alain is currently offline Alain
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 14:42 Go to previous messageGo to next message
Roger  is currently offline Roger
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 14:40 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2235
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 WTP, IBM
Re: StructuredTextEditor validation [message #730014 is a reply to message #729681] Tue, 27 September 2011 09:30 Go to previous message
Roger  is currently offline Roger
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: Sat Jul 26 13:23:16 EDT 2014

Powered by FUDForum. Page generated in 0.01850 seconds