Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How do I connect a default assistant to the SourceViewer?
How do I connect a default assistant to the SourceViewer? [message #230373] Wed, 15 April 2009 14:04
Siarhei Navatski is currently offline Siarhei NavatskiFriend
Messages: 14
Registered: July 2009
Junior Member
How do I connect a default assistant to the SourceViewer, is the same
as in XMLEditor?

private TextViewer createFineXmlViewer(Composite parent){
SourceViewerConfiguration sourceViewerConfiguration = new
StructuredTextViewerConfigurationXML();
String contentTypeID = ContentTypeIdForXML.ContentTypeID_XML;
SourceViewer fineXmlViewer = new StructuredTextViewer(parent, null,
null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
((StructuredTextViewer)
fineXmlViewer).getTextWidget().setFont(JFaceResources.getFon t( "org.eclipse.wst.sse.ui.textfont"));
IStructuredModel scratchModel =
StructuredModelManager.getModelManager().createUnManagedStru cturedModelFor(contentTypeID);
IDocument document = scratchModel.getStructuredDocument();
fineXmlViewer.setDocument(document);
fineXmlViewer.configure(sourceViewerConfiguration);
return fineXmlViewer;
}

What else should I add to the code?
Previous Topic:WST not publishing JEE Module Dependency
Next Topic:HTML Source Formatting
Goto Forum:
  


Current Time: Thu Apr 25 22:49:36 GMT 2024

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

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

Back to the top