Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (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 10:04
Siarhei Navatski is currently offline Siarhei Navatski
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: Mon Sep 01 17:06:26 EDT 2014

Powered by FUDForum. Page generated in 0.02367 seconds