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;
15 import java.util.StringTokenizer;
17 import net.sourceforge.phpdt.core.JavaCore;
18 import net.sourceforge.phpdt.internal.ui.text.spelling.engine.AbstractSpellDictionary;
20 import org.eclipse.core.runtime.Plugin;
21 import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
22 import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
25 * Dictionary for task tags.
29 public class TaskTagDictionary extends AbstractSpellDictionary implements
30 IPropertyChangeListener {
33 * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.AbstractSpellDictionary#getName()
35 protected final URL getURL() {
40 * @see net.sourceforge.phpdt.ui.text.spelling.engine.AbstractSpellDictionary#load(java.net.URL)
42 protected boolean load(final URL url) {
44 final Plugin plugin = JavaCore.getPlugin();
47 plugin.getPluginPreferences().addPropertyChangeListener(this);
48 return updateTaskTags();
54 * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
56 public void propertyChange(final PropertyChangeEvent event) {
58 if (JavaCore.COMPILER_TASK_TAGS.equals(event.getProperty()))
63 * @see net.sourceforge.phpdt.ui.text.spelling.engine.ISpellDictionary#unload()
65 public void unload() {
67 final Plugin plugin = JavaCore.getPlugin();
69 plugin.getPluginPreferences().removePropertyChangeListener(this);
75 * Handles the compiler task tags property change event.
77 private boolean updateTaskTags() {
79 final String tags = JavaCore.getOption(JavaCore.COMPILER_TASK_TAGS);
84 final StringTokenizer tokenizer = new StringTokenizer(tags, ","); //$NON-NLS-1$
85 while (tokenizer.hasMoreTokens())
86 hashWord(tokenizer.nextToken());