当前位置: 首页>>代码示例>>Java>>正文


Java FastPartitioner类代码示例

本文整理汇总了Java中org.eclipse.jface.text.rules.FastPartitioner的典型用法代码示例。如果您正苦于以下问题:Java FastPartitioner类的具体用法?Java FastPartitioner怎么用?Java FastPartitioner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FastPartitioner类属于org.eclipse.jface.text.rules包,在下文中一共展示了FastPartitioner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCompositeXml

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
/**
 * This method initializes compositeXml
 * 
 */
private void createCompositeXml() {
	compositeXml = new Composite(sashForm, SWT.NONE);
	compositeXml.setLayout(new FillLayout());

	xmlView = new StructuredTextViewer(compositeXml, null, null, false, SWT.H_SCROLL | SWT.V_SCROLL);
	xmlView.setEditable(false);

	colorManager = new ColorManager();
	xmlView.configure(new XMLConfiguration(colorManager));

	Document document = new Document(
			"Click on the XML generation button to view the XML document generated by Convertigo.");
	IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(), new String[] {
			XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT, });
	partitioner.connect(document);
	document.setDocumentPartitioner(partitioner);
	xmlView.setDocument(document);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:23,代码来源:ConnectorEditorPart.java

示例2: createCompositeXml

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
/**
 * This method initializes compositeXml	
 *
 */
private void createCompositeXml() {
	compositeXml = new Composite(sashForm, SWT.NONE);
	compositeXml.setLayout(new FillLayout());
	
	xmlView = new StructuredTextViewer(compositeXml, null, null, false, SWT.H_SCROLL | SWT.V_SCROLL);
	xmlView.setEditable(false);

	colorManager = new ColorManager();
	xmlView.configure(new XMLConfiguration(colorManager));

	Document document = new Document("Click on the XML generation button to view the XML document generated by Convertigo.");
	IDocumentPartitioner partitioner =
		new FastPartitioner(
			new XMLPartitionScanner(),
			new String[] { 
				XMLPartitionScanner.XML_TAG,
				XMLPartitionScanner.XML_COMMENT,
			}
		);
	partitioner.connect(document);
	document.setDocumentPartitioner(partitioner);
	xmlView.setDocument(document);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:28,代码来源:SequenceEditorPart.java

示例3: createFileInfo

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
@SuppressWarnings("static-access")
@Override
protected FileInfo createFileInfo(Object element) throws CoreException{
	FileInfo info = super.createFileInfo(element);
	
	if (info == null) {
		info = createEmptyFileInfo();
	}
	
	IDocument document = info.fTextFileBuffer.getDocument();
	
	if (document != null) {
		EiffelPartitionScanner partitionScanner = EiffelEditorPlugin
				.getDefault().getPartitionScanner();
		IDocumentPartitioner partitioner = new FastPartitioner(partitionScanner, 
				EiffelPartitionScanner.PARTITION_TYPE);
		partitioner.connect(document);
		document.setDocumentPartitioner(partitioner);
	}
	
	return info;
}
 
开发者ID:Imhotup,项目名称:LibertyEiffel-Eclipse-Plugin,代码行数:23,代码来源:EiffelDocumentProvider.java

示例4: installJavaStuff

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
/**
 * Installs a java partitioner with <code>document</code>.
 *
 * @param document the document
 */
private static void installJavaStuff(Document document) {
	String[] types= new String[] {
								  IJavaScriptPartitions.JAVA_DOC,
								  IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT,
								  IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT,
								  IJavaScriptPartitions.JAVA_STRING,
								  IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL,
								  IJavaScriptPartitions.JAVA_CHARACTER,
								  IJSXPartitions.JSX,
								  IDocument.DEFAULT_CONTENT_TYPE
	};
	FastPartitioner partitioner= new FastPartitioner(new FastTypeScriptPartitionScanner(), types);
	partitioner.connect(document);
	document.setDocumentPartitioner(IJavaScriptPartitions.JAVA_PARTITIONING, partitioner);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:21,代码来源:TypeScriptAutoIndentStrategy.java

示例5: createDocument

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
@Override
protected IDocument createDocument(final Object element) throws CoreException
{
	final IDocument document = super.createDocument(element);

	if (document != null)
	{
		MapFile.parse(document.get());

		final IDocumentPartitioner partitioner =
			new FastPartitioner(
				new XMLPartitionScanner(),
				new String[] {
					XMLPartitionScanner.XML_TAG,
					XMLPartitionScanner.XML_COMMENT });
		partitioner.connect(document);
		document.setDocumentPartitioner(partitioner);
	}
	return document;
}
 
开发者ID:nullquery,项目名称:BYONDclipse,代码行数:21,代码来源:XMLDocumentProvider.java

示例6: setup

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
/**
 * Setup the TrafficScript Partitioner for .zts files
 */
/* Override */
public void setup( IDocument document )
{     
   if (document instanceof IDocumentExtension3) {
      IDocumentExtension3 extension3 = (IDocumentExtension3) document;

      IDocumentPartitioner partitioner = new FastPartitioner( 
         ZXTMPlugin.getDefault().getTrafficScriptPartitioner(),
         Partition.getAllPartitionIds()
      );

      extension3.setDocumentPartitioner(
         TrafficScriptPartitioner.TS_PARTITIONER, 
         partitioner 
      );
     
      partitioner.connect( document );

   }

}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:25,代码来源:TrafficScriptSetup.java

示例7: createDocument

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
public IDocument createDocument(final Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner =
            new FastPartitioner(
                    new HTMLPartitionScanner(),
                    new String[]{
                            HTMLPartitionScanner.HTML_TAG,
                            HTMLPartitionScanner.HTML_COMMENT,
                            HTMLPartitionScanner.HTML_SCRIPT,
                            HTMLPartitionScanner.HTML_DOCTYPE,
                            HTMLPartitionScanner.HTML_DIRECTIVE,
                            HTMLPartitionScanner.JAVASCRIPT,
                            HTMLPartitionScanner.HTML_CSS,
                            HTMLPartitionScanner.SYNCOPE_TAG});
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
 
开发者ID:apache,项目名称:syncope,代码行数:21,代码来源:HTMLFileDocumentProvider.java

示例8: createDocument

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(),
                new String[] {XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT});
        partitioner.connect(document);
        document.setDocumentPartitioner(partitioner);
        // document.addDocumentListener(new IDocumentListener() {
        //
        // public void documentAboutToBeChanged(DocumentEvent event) {
        // }
        //
        // public void documentChanged(DocumentEvent event) {
        // System.out.println("XMLDocumentProvider.documentChanged :"+event.getText());
        // }
        // });
    }
    return document;
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:20,代码来源:XMLDocumentProvider.java

示例9: SourceEditor

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
public SourceEditor() {
    setSourceViewerConfiguration(new TextUMLSourceViewerConfiguration(this));
    // set the document provider to create the partitioner
    setDocumentProvider(new FileDocumentProvider() {
        protected IDocument createDocument(Object element) throws CoreException {
            IDocument document = super.createDocument(element);
            if (document != null) {
                // this will create partitions
                IDocumentPartitioner partitioner = new FastPartitioner(new PartitionScanner(),
                        ContentTypes.CONFIGURED_CONTENT_TYPES);
                partitioner.connect(document);
                document.setDocumentPartitioner(partitioner);
            }
            return document;
        }
    });
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:18,代码来源:SourceEditor.java

示例10: createFileInfo

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
@Override
protected FileInfo createFileInfo(Object element) throws CoreException {
	FileInfo info = super.createFileInfo(element);
	if(info==null){
		info = createEmptyFileInfo();
	}
	IDocument document = info.fTextFileBuffer.getDocument();
	if (document != null) {

		/* register your partitioner and other things here 
                      same way as in your first document provider */
		if (document instanceof IDocumentExtension3) {
			IDocumentExtension3 extension3= (IDocumentExtension3) document;
			IDocumentPartitioner partitioner= new FastPartitioner(RustCorePlugin.getDefault().scanners().rustPartitionScanner(), RustPartitionScanner.PARTITION_TYPES);
			extension3.setDocumentPartitioner(RustConstants.RUST_PARTITIONING, partitioner);
			partitioner.connect(document);
		}
	}
	return info;
}
 
开发者ID:peq,项目名称:rustyeclipse,代码行数:21,代码来源:RustTextDocumentProvider.java

示例11: createDocument

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
@Override
	protected @Nullable IDocument createDocument(@Nullable Object element) throws CoreException {
//		IDocument document = super.createDocument(element);
//		if (document != null) {
//			IDocumentPartitioner partitioner =
//				new FastPartitioner(
//					new RustPartitionScanner(),
//					new String[] {
//						RustPartitionScanner.RUST_MULTILINE_COMMENT });
//			partitioner.connect(document);
//			document.setDocumentPartitioner(partitioner);
//		}
//		return document;
		
		IDocument document = super.createDocument(element);
		if (document instanceof IDocumentExtension3) {
			IDocumentExtension3 extension3= (IDocumentExtension3) document;
			IDocumentPartitioner partitioner= new FastPartitioner(RustCorePlugin.getDefault().scanners().rustPartitionScanner(), RustPartitionScanner.PARTITION_TYPES);
			extension3.setDocumentPartitioner(RustConstants.RUST_PARTITIONING, partitioner);
			partitioner.connect(document);
		}
		return document;
	}
 
开发者ID:peq,项目名称:rustyeclipse,代码行数:24,代码来源:RustDocumentProvider.java

示例12: createFileInfo

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
@Override
protected FileInfo createFileInfo(Object element) throws CoreException {
	FileInfo info = super.createFileInfo(element);
	if(info == null) {
		info = createEmptyFileInfo();
	}
	IDocument document = info.fTextFileBuffer.getDocument();
	if(document != null) {
		IDocumentPartitioner partitioner = new FastPartitioner(
				new BytemanRulePartitionScanner(),
				new String[] {
					BytemanRulePartitionScanner.RULE_COMMENT,
					BytemanRulePartitionScanner.RULE_DEF_LINE
				});
		partitioner.connect(document);
		document.setDocumentPartitioner(partitioner);
	}
	return info;
}
 
开发者ID:masao-kunii,项目名称:byteman-editor,代码行数:20,代码来源:BytemanRuleTextDocumentProvider.java

示例13: createDocument

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
protected IDocument createDocument(Object element) throws CoreException {
	IDocument document = super.createDocument(element);
	if (document != null) {
		IDocumentPartitioner partitioner =
			new FastPartitioner(
				new XMLPartitionScanner(),
				new String[] {
					XMLPartitionScanner.XML_TAG,
					XMLPartitionScanner.XML_COMMENT });
		partitioner.connect(document);
		document.setDocumentPartitioner(partitioner);
	}
	return document;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:15,代码来源:XMLDocumentProvider.java

示例14: createRecipePartitioner

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
IDocumentPartitioner createRecipePartitioner() {
    IPredicateRule[] rules = {
            new SingleLineRule("--", null, new Token(SQL_SINGLE_COMMENT), (char) 0, true, false), //$NON-NLS-1$
            new MultiLineRule("/*", "*/", new Token(SQL_MULTI_COMMENT), (char) 0, true),  //$NON-NLS-1$ //$NON-NLS-2$
            new MultiLineRule( "'", "'", new Token(SQL_CHARACTER_STRING_LITERAL), (char) 0 , true) //$NON-NLS-1$ //$NON-NLS-2$
    };

    RuleBasedPartitionScanner scanner = new RuleBasedPartitionScanner();
    scanner.setPredicateRules(rules);

    return new FastPartitioner(scanner, CONTENT_TYPES);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:13,代码来源:SQLEditorCommonDocumentProvider.java

示例15: setup

import org.eclipse.jface.text.rules.FastPartitioner; //导入依赖的package包/类
@Override
public void setup(IDocument document) {
	/* Définit un partitionnement du document. */
	IDocumentPartitioner p = new FastPartitioner(createKspPartitionScanner(), TYPES);
	IDocumentExtension3 de3 = (IDocumentExtension3) document;
	de3.setDocumentPartitioner(KspRegionType.PARTITIONING, p);
	p.connect(document);
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:9,代码来源:KspDocumentSetupParticipant.java


注:本文中的org.eclipse.jface.text.rules.FastPartitioner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。