KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > text > ManifestPartitionScanner


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.editor.text;
12
13 import java.util.ArrayList JavaDoc;
14
15 import org.eclipse.jface.text.rules.IPredicateRule;
16 import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
17 import org.eclipse.jface.text.rules.SingleLineRule;
18 import org.eclipse.jface.text.rules.Token;
19
20 public class ManifestPartitionScanner extends RuleBasedPartitionScanner {
21     
22     public static final String JavaDoc MANIFEST_HEADER_VALUE = "__mf_bundle_header_value"; //$NON-NLS-1$
23

24     public static final String JavaDoc MANIFEST_FILE_PARTITIONING= "___mf_partitioning"; //$NON-NLS-1$
25

26     public static final String JavaDoc[] PARTITIONS = new String JavaDoc[] {MANIFEST_HEADER_VALUE};
27     
28     public ManifestPartitionScanner() {
29         
30         Token value = new Token(MANIFEST_HEADER_VALUE);
31         ArrayList JavaDoc rules = new ArrayList JavaDoc();
32         rules.add(new SingleLineRule("=", null, value, '\\', true, true)); //$NON-NLS-1$
33
rules.add(new SingleLineRule(":", null, value, '\\', true, true)); //$NON-NLS-1$
34
rules.add(new SingleLineRule(" ", null, value, '\\', true, true)); //$NON-NLS-1$
35
rules.add(new SingleLineRule("\t", null, value, '\\', true, true)); //$NON-NLS-1$
36
setPredicateRules((IPredicateRule[])rules.toArray(new IPredicateRule[rules.size()]));
37     }
38
39 }
40
Popular Tags