KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > spelling > engine > LocaleSensitiveSpellDictionary


1 /*******************************************************************************
2  * Copyright (c) 2000, 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
12 package org.eclipse.jdt.internal.ui.text.spelling.engine;
13
14 import java.net.MalformedURLException JavaDoc;
15 import java.net.URL JavaDoc;
16 import java.util.Locale JavaDoc;
17
18 /**
19  * Platform wide read-only locale sensitive dictionary for spell checking.
20  *
21  * @since 3.0
22  */

23 public class LocaleSensitiveSpellDictionary extends AbstractSpellDictionary {
24
25     /** The locale of this dictionary */
26     private final Locale JavaDoc fLocale;
27
28     /** The location of the dictionaries */
29     private final URL JavaDoc fLocation;
30
31     /**
32      * Creates a new locale sensitive spell dictionary.
33      *
34      * @param locale
35      * The locale for this dictionary
36      * @param location
37      * The location of the locale sensitive dictionaries
38      */

39     public LocaleSensitiveSpellDictionary(final Locale JavaDoc locale, final URL JavaDoc location) {
40         fLocation= location;
41         fLocale= locale;
42     }
43
44     /**
45      * Returns the locale of this dictionary.
46      *
47      * @return The locale of this dictionary
48      */

49     public final Locale JavaDoc getLocale() {
50         return fLocale;
51     }
52
53     /*
54      * @see org.eclipse.jdt.internal.ui.text.spelling.engine.AbstractSpellDictionary#getURL()
55      */

56     protected final URL JavaDoc getURL() throws MalformedURLException JavaDoc {
57         return new URL JavaDoc(fLocation, fLocale.toString() + ".dictionary"); //$NON-NLS-1$
58
}
59 }
60
Popular Tags