KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > rules > EndOfLineRule


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  * Christopher Lenz (cmlenz@gmx.de) - support for line continuation
11  *******************************************************************************/

12 package org.eclipse.jface.text.rules;
13
14
15 /**
16  * A specific configuration of a single line rule
17  * whereby the pattern begins with a specific sequence but
18  * is only ended by a line delimiter.
19  */

20 public class EndOfLineRule extends SingleLineRule {
21
22     /**
23      * Creates a rule for the given starting sequence
24      * which, if detected, will return the specified token.
25      *
26      * @param startSequence the pattern's start sequence
27      * @param token the token to be returned on success
28      */

29     public EndOfLineRule(String JavaDoc startSequence, IToken token) {
30         this(startSequence, token, (char) 0);
31     }
32
33     /**
34      * Creates a rule for the given starting sequence
35      * which, if detected, will return the specified token.
36      * Any character which follows the given escape character
37      * will be ignored.
38      *
39      * @param startSequence the pattern's start sequence
40      * @param token the token to be returned on success
41      * @param escapeCharacter the escape character
42      */

43     public EndOfLineRule(String JavaDoc startSequence, IToken token, char escapeCharacter) {
44         super(startSequence, null, token, escapeCharacter, true);
45     }
46
47     /**
48      * Creates a rule for the given starting sequence
49      * which, if detected, will return the specified token.
50      * Any character which follows the given escape character
51      * will be ignored. In addition, an escape character
52      * immediately before an end of line can be set to continue
53      * the line.
54      *
55      * @param startSequence the pattern's start sequence
56      * @param token the token to be returned on success
57      * @param escapeCharacter the escape character
58      * @param escapeContinuesLine indicates whether the specified escape
59      * character is used for line continuation, so that an end of
60      * line immediately after the escape character does not
61      * terminate the line, even if <code>breakOnEOL</code> is true
62      * @since 3.0
63      */

64     public EndOfLineRule(String JavaDoc startSequence, IToken token, char escapeCharacter, boolean escapeContinuesLine) {
65         super(startSequence, null, token, escapeCharacter, true, escapeContinuesLine);
66     }
67 }
68
Popular Tags