Java 类org.eclipse.jface.text.rules.DefaultPartitioner 实例源码

项目:http4e    文件:DocumentUtils.java   
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;  
}
项目:JAADAS    文件:JimpleDocumentProvider.java   
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;
}
项目:velocity-edit    文件:DocumentProvider.java   
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;
}
项目:birt    文件:JSDocumentProvider.java   
/**
 * @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;
}