本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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 );
}
}
示例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;
}
示例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;
}
示例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;
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}