KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 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 package org.eclipse.pde.internal.ui.editor.text;
12
13 import org.eclipse.jface.text.DocumentEvent;
14 import org.eclipse.jface.text.IRegion;
15 import org.eclipse.jface.text.ITypedRegion;
16 import org.eclipse.jface.text.TextAttribute;
17 import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
18 import org.eclipse.jface.text.rules.ITokenScanner;
19
20 public class MultilineDamagerRepairer extends DefaultDamagerRepairer {
21
22     public MultilineDamagerRepairer(ITokenScanner scanner, TextAttribute defaultTextAttribute) {
23         super(scanner, defaultTextAttribute);
24     }
25     
26     public MultilineDamagerRepairer(ITokenScanner scanner) {
27         super(scanner);
28     }
29     
30     /* (non-Javadoc)
31      * @see org.eclipse.jface.text.presentation.IPresentationDamager#getDamageRegion(org.eclipse.jface.text.ITypedRegion, org.eclipse.jface.text.DocumentEvent, boolean)
32      */

33     public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent e, boolean documentPartitioningChanged) {
34         return partition;
35     }
36
37     /**
38      * Configures the scanner's default return token. This is the text attribute
39      * which is returned when none is returned by the current token.
40      */

41     public void setDefaultTextAttribute(TextAttribute defaultTextAttribute) {
42         fDefaultTextAttribute= defaultTextAttribute;
43     }
44
45 }
46
Popular Tags