org.eclipse.jface.text.rules.IPartitionTokenScanner Java Examples

The following examples show how to use org.eclipse.jface.text.rules.IPartitionTokenScanner. 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: GroovyExpressionPartitioner.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private static IPartitionTokenScanner createDefaultScanner() {
    final IToken string = new Token(PatternExpressionViewer.GROOVY_EXPRESSION_CONTENT_TYPE);
    final RuleBasedPartitionScanner scanner = new RuleBasedPartitionScanner();
    scanner.setPredicateRules(new IPredicateRule[] {
            new MultiLineRule(GROOVY_START_TAG, GROOVY_END_TAG, string)
    });
    return scanner;
}
 
Example #2
Source File: TLAEditorActivator.java    From tlaplus with MIT License 5 votes vote down vote up
/**
 * @return
 */
public IPartitionTokenScanner getTLAPartitionScanner()
{
    if (partitionTokenScanner == null) 
    {
        partitionTokenScanner = new TLAPartitionScanner();
    }
    return partitionTokenScanner; 
}
 
Example #3
Source File: ExtendedFastPartitioner.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @param scanner
 * @param legalContentTypes
 */
public ExtendedFastPartitioner(IPartitionTokenScanner scanner, String[] legalContentTypes) {
	super(scanner, legalContentTypes);
	this.legalContentTypes = new HashSet<String>(legalContentTypes.length);
	for (String contentType : legalContentTypes) {
		this.legalContentTypes.add(contentType);
	}
}
 
Example #4
Source File: JSDocumentProvider.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
@Override
public IPartitionTokenScanner createPartitionScanner()
{
	return new JSSourcePartitionScannerJFlex();
}
 
Example #5
Source File: LangUIPlugin_Actual.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
public static IPartitionTokenScanner createPartitionScanner() {
	return new GoPartitionScanner();
}
 
Example #6
Source File: LangDocumentPartitionerSetup.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
public FastPartitioner createDocumentPartitioner() {
	IPartitionTokenScanner scanner = LangUIPlugin_Actual.createPartitionScanner();
	return new FastPartitioner(scanner, LEGAL_CONTENT_TYPES);
}
 
Example #7
Source File: Scanner_BaseTest.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
public static FastPartitioner setupPartitioner(Document document, IPartitionTokenScanner partitionScanner,
		String partitioning, String[] legalContentTypes) {
	FastPartitioner fp = new FastPartitioner(partitionScanner, legalContentTypes);
	EclipseUtils.setupDocumentPartitioner(document, partitioning, fp);
	return fp;
}
 
Example #8
Source File: CSSDocumentProvider.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
@Override
public IPartitionTokenScanner createPartitionScanner()
{
	return new CSSSourcePartitionScannerJFlex();
}
 
Example #9
Source File: DTDDocumentProvider.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
@Override
public IPartitionTokenScanner createPartitionScanner()
{
	return new DTDPartitionScanner();
}
 
Example #10
Source File: N4JSUiModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Class<? extends IPartitionTokenScanner> bindIPartitionTokenScanner() {
	return TemplateAwarePartitionTokenScanner.class;
}
 
Example #11
Source File: CompositePartitionScanner.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
public CompositePartitionScanner(IPartitionTokenScanner javaScanner,
    IPartitionTokenScanner jsniScanner) {
  this.javaScanner = javaScanner;
  this.jsniScanner = jsniScanner;
}
 
Example #12
Source File: TypeScriptTextTools.java    From typescript.java with MIT License 4 votes vote down vote up
@Override
public IPartitionTokenScanner getPartitionScanner() {
	return new FastTypeScriptPartitionScanner();
}
 
Example #13
Source File: DocumentPartitioner.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public DocumentPartitioner(IPartitionTokenScanner scanner, ITokenTypeToPartitionTypeMapper mapper) {
	this(scanner, mapper.getSupportedPartitionTypes());
}
 
Example #14
Source File: DefaultUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IPartitionTokenScanner> bindIPartitionTokenScanner() {
	return PartitionTokenScanner.class;
}
 
Example #15
Source File: XMLPartitioner.java    From http4e with Apache License 2.0 4 votes vote down vote up
public XMLPartitioner( IPartitionTokenScanner scanner, String[] legalContentTypes) {
   super(scanner, legalContentTypes);
}
 
Example #16
Source File: TLAFastPartitioner.java    From tlaplus with MIT License 3 votes vote down vote up
/**
 * Creates a new partitioner that uses the given scanner and may return
 * partitions of the given legal content types.
 *
 * @param scanner the scanner this partitioner is supposed to use
 * @param legalContentTypes the legal content types of this partitioner
 */
public TLAFastPartitioner(IPartitionTokenScanner scanner, String[] legalContentTypes) {
    fScanner= (TLAPartitionScanner) scanner;
    fLegalContentTypes= TextUtilities.copy(legalContentTypes);
    fPositionCategory= CONTENT_TYPES_CATEGORY + hashCode();
    fPositionUpdater= new DefaultPositionUpdater(fPositionCategory);
}
 
Example #17
Source File: DocumentPartitioner.java    From xtext-eclipse with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Creates a new partitioner that uses the given scanner and may return partitions of the given legal content types.
 * 
 * @param scanner
 *            the scanner this partitioner is supposed to use
 * @param legalContentTypes
 *            the legal content types of this partitioner
 * @since 2.2
 */
public DocumentPartitioner(IPartitionTokenScanner scanner, String[] legalContentTypes) {
	fScanner = scanner;
	fLegalContentTypes = TextUtilities.copy(legalContentTypes);
	fPositionCategory = CONTENT_TYPES_CATEGORY + hashCode();
	fPositionUpdater = new DefaultPositionUpdater(fPositionCategory);
}
 
Example #18
Source File: SimpleDocumentProvider.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Create a partition scanner for this editor's top-level language
 * 
 * @return
 */
public abstract IPartitionTokenScanner createPartitionScanner();
 
Example #19
Source File: JavaTextTools.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Returns a scanner which is configured to scan
 * Java-specific partitions, which are multi-line comments,
 * Javadoc comments, and regular Java source code.
 *
 * @return a Java partition scanner
 */
public IPartitionTokenScanner getPartitionScanner() {
	return new FastJavaPartitionScanner();
}