public static IDocument createDocument1(){ IDocument doc = new Document(){ public String getDefaultLineDelimiter(){ return String.valueOf(AssistConstants.LINE_DELIM_NL) /*super.getDefaultLineDelimiter()*/; } }; IDocumentPartitioner partitioner = new DefaultPartitioner( new HPartitionScanner(), new String[] { HPartitionScanner.COMMENT, HPartitionScanner.PROPERTY_VALUE}); partitioner.connect(doc); doc.setDocumentPartitioner(partitioner); return doc; }
protected IDocument createDocument(Object element) throws CoreException { IDocument document = super.createDocument(element); if (document != null) { IDocumentPartitioner partitioner = new DefaultPartitioner( new JimplePartitionScanner(), new String[] { JimplePartitionScanner.JIMPLE_STRING}); partitioner.connect(document); document.setDocumentPartitioner(partitioner); } return document; }
protected IDocument createDocument(Object element) throws CoreException { IDocument document = super.createDocument(element); if (document != null) { IDocumentPartitioner partitioner = new DefaultPartitioner( new PartitionScanner(), new String[] { PartitionScanner.XML_TAG, PartitionScanner.XML_COMMENT, PartitionScanner.FOREACH_PARTITION, PartitionScanner.FOREACH_END_PARTITION, PartitionScanner.SET_PARTITION, PartitionScanner.IF_PARTITION, PartitionScanner.ELSE_PARTITION, PartitionScanner.ELSE_IF_PARTITION, PartitionScanner.IF_END_PARTITION, PartitionScanner.END_PARTITION, PartitionScanner.MACRO_PARTITION, PartitionScanner.MACRO_INSTANCE_PARTITION, PartitionScanner.MACRO_END_PARTITION, PartitionScanner.VARIABLE_PARTITION, PartitionScanner.STOP_PARTITION, PartitionScanner.INCLUDE_PARTITION, PartitionScanner.PARSE_PARTITION, PartitionScanner.COMMENT_PARTITION, }); partitioner.connect(document); document.setDocumentPartitioner(partitioner); } return document; }
/** * @see DocumentProvider#createDocument(java.lang.Object) */ protected IDocument createDocument( Object element ) throws CoreException { IDocument document = super.createDocument( element ); if ( document != null ) { IDocumentPartitioner partitioner = new DefaultPartitioner( new JSPartitionScanner( ), colorTokens ); partitioner.connect( document ); document.setDocumentPartitioner( partitioner ); } return document; }