當前位置: 首頁>>代碼示例>>Java>>正文


Java Document.setDocumentPartitioner方法代碼示例

本文整理匯總了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);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:23,代碼來源:ConnectorEditorPart.java

示例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);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:28,代碼來源:SequenceEditorPart.java

示例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);
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:21,代碼來源:TypeScriptAutoIndentStrategy.java

示例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);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:20,代碼來源:JavaFormatter.java

示例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();
}
 
開發者ID:fmoraes74,項目名稱:eclipseforces,代碼行數:28,代碼來源:JavaPreferencesPage.java

示例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);
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:9,代碼來源:TypeScriptAutoIndentStrategy.java


注:本文中的org.eclipse.jface.text.Document.setDocumentPartitioner方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。