Java Code Examples for org.eclipse.jdt.ui.text.IJavaPartitions#JAVA_SINGLE_LINE_COMMENT

The following examples show how to use org.eclipse.jdt.ui.text.IJavaPartitions#JAVA_SINGLE_LINE_COMMENT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaFormatter.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 2
Source File: JavaAutoIndentStrategy.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 3
Source File: AddBlockCommentAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Returns whether <code>partType</code> is special, i.e. a Java
 * <code>String</code>,<code>Character</code>, or
 * <code>Line End Comment</code> partition.
 *
 * @param partType the partition type to check
 * @return <code>true</code> if <code>partType</code> is special,
 *         <code>false</code> otherwise
 */
private boolean isSpecialPartition(String partType) {
	return partType == IJavaPartitions.JAVA_CHARACTER
			|| partType == IJavaPartitions.JAVA_STRING
			|| partType == IJavaPartitions.JAVA_SINGLE_LINE_COMMENT;
}