public IContentFormatter getContentFormatter( ISourceViewer sourceViewer){ ContentFormatter formatter = new ContentFormatter(); XMLFormattingStrategy formattingStrategy = new XMLFormattingStrategy(); DefaultFormattingStrategy defaultStrategy = new DefaultFormattingStrategy(); TextFormattingStrategy textStrategy = new TextFormattingStrategy(); DocTypeFormattingStrategy doctypeStrategy = new DocTypeFormattingStrategy(); PIFormattingStrategy piStrategy = new PIFormattingStrategy(); formatter.setFormattingStrategy(defaultStrategy, IDocument.DEFAULT_CONTENT_TYPE); formatter.setFormattingStrategy(textStrategy, XMLPartitionScanner.XML_TEXT); formatter.setFormattingStrategy(doctypeStrategy, XMLPartitionScanner.XML_DOCTYPE); formatter.setFormattingStrategy(piStrategy, XMLPartitionScanner.XML_PI); formatter.setFormattingStrategy(textStrategy, XMLPartitionScanner.XML_CDATA); formatter.setFormattingStrategy(formattingStrategy, XMLPartitionScanner.XML_START_TAG); formatter.setFormattingStrategy(formattingStrategy, XMLPartitionScanner.XML_END_TAG); return formatter; }
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { ContentFormatter formatter = new ContentFormatter(); XMLFormattingStrategy formattingStrategy = new XMLFormattingStrategy(); DefaultFormattingStrategy defaultStrategy = new DefaultFormattingStrategy(); TextFormattingStrategy textStrategy = new TextFormattingStrategy(); DocTypeFormattingStrategy doctypeStrategy = new DocTypeFormattingStrategy(); PIFormattingStrategy piStrategy = new PIFormattingStrategy(); formatter.setFormattingStrategy(defaultStrategy, IDocument.DEFAULT_CONTENT_TYPE); formatter.setFormattingStrategy(textStrategy, XMLPartitionScanner.XML_TEXT); formatter.setFormattingStrategy(doctypeStrategy, XMLPartitionScanner.XML_DOCTYPE); formatter.setFormattingStrategy(piStrategy, XMLPartitionScanner.XML_PI); formatter.setFormattingStrategy(textStrategy, XMLPartitionScanner.XML_CDATA); formatter.setFormattingStrategy(formattingStrategy, XMLPartitionScanner.XML_START_TAG); formatter.setFormattingStrategy(formattingStrategy, XMLPartitionScanner.XML_END_TAG); return formatter; }
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { ContentFormatter formatter = new ContentFormatter(); ExampleFormattingStrategy formattingStrategy = new ExampleFormattingStrategy(editor); formatter.setFormattingStrategy(formattingStrategy, IDocument.DEFAULT_CONTENT_TYPE); return formatter; }