Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » SourceViewer with StructuredTextViewerConfigurationXML - Exception
SourceViewer with StructuredTextViewerConfigurationXML - Exception [message #170025] Wed, 24 May 2006 12:04 Go to next message
Eclipse UserFriend
Originally posted by:


currently, i am developing my first application with the eclipse-api. so
far, everything worked fine, but now i have a problem, i could not solve on
my own:

i have a SourceViewer and i want to show xml-content. i would like the
content to be syntax highlighted, so i searched the web and found the

i tried to do something like that:

this.view_xml = new SourceViewer(, null, SWT.BORDER);
this.view_xml.setDocument(new Document(xml_content));

StructuredTextViewerConfigurationXML conf = new

i tried it in two ways:
--- application as an applet ---

whenever i create an instance of StructuredTextViewerConfigurationXML,
it throws a null-pointer exception (in the constructor).

Exception in thread "main" java.lang.NullPointerException
org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration.cre ateCombinedPreferenceStore(StructuredTextViewerConfiguration .java:96)
org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration.<init >(
org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML. <init>(

--- application as an eclipse plugin ---

I am able to create an instance, but if i try to configure my source-viewer,
it throws an exception

java.lang.ClassCastException: org.eclipse.jface.text.source.SourceViewer
org.eclipse.wst.sse.ui.StructuredTextViewerUndoManager.conne ct(
at org.eclipse.jface.text.TextViewer.activatePlugins(TextViewer .java:1525)

i should work both ways: as plugin as well as an applet ...
can anybody help me with that?

thanks in advance!
Re: SourceViewer with StructuredTextViewerConfigurationXML - Exception [message #171280 is a reply to message #170025] Thu, 15 June 2006 07:49 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2555
Registered: July 2009
Senior Member
The StructuredTextViewerConfiguration* classes expect only to be
used with the SSE StructuredTextViewer, and that in turn with an
IStructuredDocument. Without all 3 in place, you're likely to
continue running into odd exceptions along the way. We haven't
placed much focus in allowing what you seem to be attempting (hence
the viewer class remaining internal), so your mileage may vary.

- Nitin

Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:EMF2DOMSSE Adapter does get proper notifications
Next Topic:Rough idea for JSP code completion?
Goto Forum:

Current Time: Sat Oct 10 10:53:28 GMT 2015

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

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