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


Java IJavaPartitions.JAVA_DOC属性代码示例

本文整理汇总了Java中org.eclipse.jdt.ui.text.IJavaPartitions.JAVA_DOC属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaPartitions.JAVA_DOC属性的具体用法?Java IJavaPartitions.JAVA_DOC怎么用?Java IJavaPartitions.JAVA_DOC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jdt.ui.text.IJavaPartitions的用法示例。


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

示例1: installJavaStuff

/**
 * 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,代码行数:19,代码来源:JavaFormatter.java

示例2: createControl

@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,代码行数:27,代码来源:JavaPreferencesPage.java

示例3: installJavaStuff

/**
 * 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:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:JavaFormatter.java

示例4: handleInteriorPartition

/**
 * Handles partition boundaries within the selection. The end of the current
 * partition and the start of the next partition are examined for whether
 * they contain comment tokens that interfere with the created comment.
 * <p>
 * Comment tokens are removed from interior multi-line comments. Javadoc
 * comments are left as is; instead, multi-line comment tokens are inserted
 * before and after Javadoc partitions to ensure that the entire selected
 * area is commented.
 * </p>
 * <p>
 * The next partition is returned.
 * </p>
 *
 * @param partition the current partition
 * @param edits the list of edits to add to
 * @param factory the edit factory
 * @param docExtension the document to get the partitions from
 * @return the next partition after the current
 * @throws BadLocationException if accessing the document fails - this can
 *         only happen if the document gets modified concurrently
 * @throws BadPartitioningException if the document does not have a Java
 *         partitioning
 */
private ITypedRegion handleInteriorPartition(ITypedRegion partition, List<Edit> edits, Edit.EditFactory factory, IDocumentExtension3 docExtension) throws BadPartitioningException, BadLocationException {

	// end of previous partition
	String partType= partition.getType();
	int partEndOffset= partition.getOffset() + partition.getLength();
	int tokenLength= getCommentStart().length();

	boolean wasJavadoc= false; // true if the previous partition is javadoc

	if (partType == IJavaPartitions.JAVA_DOC) {

		wasJavadoc= true;

	} else if (partType == IJavaPartitions.JAVA_MULTI_LINE_COMMENT) {

		// already in a comment - remove ending mark
		edits.add(factory.createEdit(partEndOffset - tokenLength, tokenLength, "")); //$NON-NLS-1$

	}

	// advance to next partition
	partition= docExtension.getPartition(IJavaPartitions.JAVA_PARTITIONING, partEndOffset, false);
	partType= partition.getType();

	// start of next partition
	if (wasJavadoc) {

		// if previous was javadoc, and the current one is not a comment,
		// then add a block comment start
		if (partType == IDocument.DEFAULT_CONTENT_TYPE
				|| isSpecialPartition(partType)) {
			edits.add(factory.createEdit(partition.getOffset(), 0, getCommentStart()));
		}

	} else { // !wasJavadoc

		if (partType == IJavaPartitions.JAVA_DOC) {
			// if next is javadoc, end block comment before
			edits.add(factory.createEdit(partition.getOffset(), 0, getCommentEnd()));
		} else if (partType == IJavaPartitions.JAVA_MULTI_LINE_COMMENT) {
			// already in a comment - remove startToken
			edits.add(factory.createEdit(partition.getOffset(), getCommentStart().length(), "")); //$NON-NLS-1$
		}
	}

	return partition;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:71,代码来源:AddBlockCommentAction.java

示例5: JavadocCompletionProcessor

public JavadocCompletionProcessor(IEditorPart editor, ContentAssistant assistant) {
	super(editor, assistant, IJavaPartitions.JAVA_DOC);
	fSubProcessorFlags= 0;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:JavadocCompletionProcessor.java

示例6: getContentAssistant

@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
		
ContentAssistant assistant = new ContentAssistant();
    assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));

   assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size")); //$NON-NLS-1$

    IContentAssistProcessor javaProcessor = new HydrographJavaCompletionProcessor(assistant, IDocument.DEFAULT_CONTENT_TYPE);
    assistant.setContentAssistProcessor(javaProcessor, IDocument.DEFAULT_CONTENT_TYPE);

    ContentAssistProcessor singleLineProcessor = new HydrographJavaCompletionProcessor(assistant,
            IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);

    ContentAssistProcessor stringProcessor = new HydrographJavaCompletionProcessor(assistant, IJavaPartitions.JAVA_STRING);
    assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING);

    ContentAssistProcessor multiLineProcessor = new HydrographJavaCompletionProcessor(assistant,
            IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);

    ContentAssistProcessor javadocProcessor = new HydrographJavaCompletionProcessor(assistant,
     IJavaPartitions.JAVA_DOC);
     assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC);

 
    
    ContentAssistPreference.configure(assistant, fPreferenceStore);

    assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));

    return assistant;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:35,代码来源:HydrographJavaSourceViewerConfiguration.java


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