KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > texteditor > spelling > SpellingAnnotation


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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.ui.texteditor.spelling;
12
13 import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
14 import org.eclipse.jface.text.source.Annotation;
15
16 /**
17  * Spelling annotation.
18  *
19  * @since 3.3
20  */

21 public class SpellingAnnotation extends Annotation implements IQuickFixableAnnotation {
22
23     /** The spelling annotation type. */
24     public static final String JavaDoc TYPE= "org.eclipse.ui.workbench.texteditor.spelling"; //$NON-NLS-1$
25

26     /** The spelling problem. */
27     private SpellingProblem fSpellingProblem;
28     
29
30     /**
31      * Creates a new spelling annotation.
32      *
33      * @param problem the spelling problem.
34      */

35     public SpellingAnnotation(SpellingProblem problem) {
36         super(TYPE, false, problem.getMessage());
37         fSpellingProblem= problem;
38     }
39
40     /*
41      * @see org.eclipse.jface.text.quickassist.IQuickFixableAnnotation#isQuickFixable()
42      */

43     public boolean isQuickFixable() {
44         return true;
45     }
46
47     /*
48      * @see org.eclipse.jface.text.quickassist.IQuickFixableAnnotation#isQuickFixableStateSet()
49      */

50     public boolean isQuickFixableStateSet() {
51         return true;
52     }
53
54     /*
55      * @see org.eclipse.jface.text.quickassist.IQuickFixableAnnotation#setQuickFixable(boolean)
56      */

57     public void setQuickFixable(boolean state) {
58         // always true
59
}
60
61     /**
62      * Returns the spelling problem.
63      *
64      * @return the spelling problem
65      */

66     public SpellingProblem getSpellingProblem() {
67         return fSpellingProblem;
68     }
69     
70 }
71
Popular Tags