本文整理匯總了Java中org.eclipse.jface.text.Document.setDocumentPartitioner方法的典型用法代碼示例。如果您正苦於以下問題:Java Document.setDocumentPartitioner方法的具體用法?Java Document.setDocumentPartitioner怎麽用?Java Document.setDocumentPartitioner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.text.Document
的用法示例。
在下文中一共展示了Document.setDocumentPartitioner方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCompositeXml
import org.eclipse.jface.text.Document; //導入方法依賴的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.Document; //導入方法依賴的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: installJavaStuff
import org.eclipse.jface.text.Document; //導入方法依賴的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);
}
示例4: installJavaStuff
import org.eclipse.jface.text.Document; //導入方法依賴的package包/類
/**
* Installs a java partitioner with <code>document</code>.
*
* @param document the document
*/
private static void installJavaStuff(Document document) {
String[] types =
new String[] {
IJavaPartitions.JAVA_DOC,
IJavaPartitions.JAVA_MULTI_LINE_COMMENT,
IJavaPartitions.JAVA_SINGLE_LINE_COMMENT,
IJavaPartitions.JAVA_STRING,
IJavaPartitions.JAVA_CHARACTER,
IDocument.DEFAULT_CONTENT_TYPE
};
FastPartitioner partitioner = new FastPartitioner(new FastJavaPartitionScanner(), types);
partitioner.connect(document);
document.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, partitioner);
}
示例5: createControl
import org.eclipse.jface.text.Document; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
generateJUnitTimeoutEditor = new Button(composite, SWT.CHECK | SWT.LEFT);
generateJUnitTimeoutEditor.setText("Use timeouts in generated test cases");
generateJUnitTimeoutEditor.setSelection(EclipseForcesPlugin.getDefault()
.isGenerateJUnitTimeout());
codeTemplateLabel = new Label(composite, SWT.NONE);
codeTemplateLabel.setText("Code template:");
codeTemplateEditor = new SourceViewer(composite, null, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.BORDER);
JavaSourceViewerConfiguration config = new JavaSourceViewerConfiguration(JavaUI.getColorManager(), JavaPlugin.getDefault().getCombinedPreferenceStore(), null, IJavaPartitions.JAVA_PARTITIONING);
codeTemplateEditor.configure(config);
Document doc = new Document(EclipseForcesPlugin.getDefault().getCodeTemplate());
JavaPartitionScanner scanner = new JavaPartitionScanner();
FastPartitioner fp = new FastPartitioner(scanner, new String[] {IJavaPartitions.JAVA_STRING, IJavaPartitions.JAVA_MULTI_LINE_COMMENT, IJavaPartitions.JAVA_CHARACTER,
IJavaPartitions.JAVA_DOC, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT});
fp.connect(doc);
doc.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, fp);
codeTemplateEditor.setDocument(doc);
codeTemplateEditor.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
codeTemplateEditor.getControl().pack();
}
示例6: removeJavaStuff
import org.eclipse.jface.text.Document; //導入方法依賴的package包/類
/**
* Installs a java partitioner with <code>document</code>.
*
* @param document the document
*/
private static void removeJavaStuff(Document document) {
document.setDocumentPartitioner(IJavaScriptPartitions.JAVA_PARTITIONING, null);
}