KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > SingleTokenJavaScanner


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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
12 package org.eclipse.jdt.internal.ui.text;
13
14
15 import java.util.List JavaDoc;
16 import org.eclipse.jface.preference.IPreferenceStore;
17 import org.eclipse.jdt.ui.text.IColorManager;
18
19
20 /**
21  *
22  */

23 public final class SingleTokenJavaScanner extends AbstractJavaScanner{
24
25
26     private String JavaDoc[] fProperty;
27
28     public SingleTokenJavaScanner(IColorManager manager, IPreferenceStore store, String JavaDoc property) {
29         super(manager, store);
30         fProperty= new String JavaDoc[] { property };
31         initialize();
32     }
33
34     /*
35      * @see AbstractJavaScanner#getTokenProperties()
36      */

37     protected String JavaDoc[] getTokenProperties() {
38         return fProperty;
39     }
40
41     /*
42      * @see AbstractJavaScanner#createRules()
43      */

44     protected List JavaDoc createRules() {
45         setDefaultReturnToken(getToken(fProperty[0]));
46         return null;
47     }
48 }
49
50
Popular Tags