01: /*******************************************************************************
02: * Copyright (c) 2006, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.texteditor.spelling;
11:
12: import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
13: import org.eclipse.jface.text.source.Annotation;
14:
15: /**
16: * Spelling annotation.
17: *
18: * @since 3.3
19: */
20: public class SpellingAnnotation extends Annotation implements
21: IQuickFixableAnnotation {
22:
23: /** The spelling annotation type. */
24: public static final String TYPE = "org.eclipse.ui.workbench.texteditor.spelling"; //$NON-NLS-1$
25:
26: /** The spelling problem. */
27: private SpellingProblem fSpellingProblem;
28:
29: /**
30: * Creates a new spelling annotation.
31: *
32: * @param problem the spelling problem.
33: */
34: public SpellingAnnotation(SpellingProblem problem) {
35: super (TYPE, false, problem.getMessage());
36: fSpellingProblem = problem;
37: }
38:
39: /*
40: * @see org.eclipse.jface.text.quickassist.IQuickFixableAnnotation#isQuickFixable()
41: */
42: public boolean isQuickFixable() {
43: return true;
44: }
45:
46: /*
47: * @see org.eclipse.jface.text.quickassist.IQuickFixableAnnotation#isQuickFixableStateSet()
48: */
49: public boolean isQuickFixableStateSet() {
50: return true;
51: }
52:
53: /*
54: * @see org.eclipse.jface.text.quickassist.IQuickFixableAnnotation#setQuickFixable(boolean)
55: */
56: public void setQuickFixable(boolean state) {
57: // always true
58: }
59:
60: /**
61: * Returns the spelling problem.
62: *
63: * @return the spelling problem
64: */
65: public SpellingProblem getSpellingProblem() {
66: return fSpellingProblem;
67: }
68:
69: }
|