1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package net.sourceforge.phpdt.internal.ui.text.spelling.engine;
17 * Spell event fired for words detected by a spell-check iterator.
21 public class SpellEvent implements ISpellEvent {
23 /** The begin index of the word in the spell-checkable medium */
24 private final int fBegin;
26 /** The spell-checker that causes the event */
27 private final ISpellChecker fChecker;
29 /** The end index of the word in the spell-checkable medium */
30 private final int fEnd;
32 /** Was the word found in the dictionary? */
33 private final boolean fMatch;
35 /** Does the word start a new sentence? */
36 private final boolean fSentence;
38 /** The word that causes the spell event */
39 private final String fWord;
42 * Creates a new spell event.
45 * The spell-checker that causes the event
47 * The word that causes the event
49 * The begin index of the word in the spell-checkable medium
51 * The end index of the word in the spell-checkable medium
53 * <code>true</code> iff the word starts a new sentence,
54 * <code>false</code> otherwise
56 * <code>true</code> iff the word was found in the dictionary,
57 * <code>false</code> otherwise
59 protected SpellEvent(final ISpellChecker checker, final String word,
60 final int begin, final int end, final boolean sentence,
61 final boolean match) {
71 * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellEvent#getBegin()
73 public final int getBegin() {
78 * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellEvent#getEnd()
80 public final int getEnd() {
85 * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellEvent#getProposals()
87 public final Set getProposals() {
88 return fChecker.getProposals(fWord, fSentence);
92 * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellEvent#getWord()
94 public final String getWord() {
99 * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellEvent#isMatch()
101 public final boolean isMatch() {
106 * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellEvent#isStart()
108 public final boolean isStart() {