Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/TaskTagRule.java')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/TaskTagRule.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/TaskTagRule.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/TaskTagRule.java
index 739737467db..6cb34f54204 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/TaskTagRule.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/TaskTagRule.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Anton Leherbauer (Wind River Systems)
@@ -30,19 +30,20 @@ import org.eclipse.cdt.ui.IPropertyChangeParticipant;
/**
* Which words should be recognized as task tags is specified under {@link CCorePreferenceConstants#TODO_TASK_TAGS} as a
* comma delimited list.
- *
+ *
* @see CCorePreferenceConstants#TODO_TASK_TAGS
* @since 5.0
* @deprecated This class doesn't properly implement parsing of task tags
* (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=246846). It will be removed.
*/
@Deprecated
-public final class TaskTagRule extends WordRule implements IPropertyChangeParticipant {
+public final class TaskTagRule extends WordRule implements IPropertyChangeParticipant {
private static class TaskTagDetector implements IWordDetector {
@Override
public boolean isWordStart(char c) {
return Character.isLetter(c);
}
+
@Override
public boolean isWordPart(char c) {
return Character.isLetter(c);
@@ -50,7 +51,7 @@ public final class TaskTagRule extends WordRule implements IPropertyChangePartic
}
/**
- * Convenience method for extracting a list of words that should be recognized as
+ * Convenience method for extracting a list of words that should be recognized as
* task labels from an {@link IPreferenceStore} and a backup {@link Preferences}
* @param preferenceStore
* @param corePreferences
@@ -58,11 +59,11 @@ public final class TaskTagRule extends WordRule implements IPropertyChangePartic
* expected by TaskTagRule
*/
public static String getTaskWords(IPreferenceStore preferenceStore, Preferences corePreferences) {
- String result= null;
+ String result = null;
if (preferenceStore.contains(CCorePreferenceConstants.TODO_TASK_TAGS)) {
- result= preferenceStore.getString(CCorePreferenceConstants.TODO_TASK_TAGS);
+ result = preferenceStore.getString(CCorePreferenceConstants.TODO_TASK_TAGS);
} else if (corePreferences != null) {
- result= corePreferences.getString(CCorePreferenceConstants.TODO_TASK_TAGS);
+ result = corePreferences.getString(CCorePreferenceConstants.TODO_TASK_TAGS);
}
return result;
}
@@ -76,8 +77,8 @@ public final class TaskTagRule extends WordRule implements IPropertyChangePartic
*/
public TaskTagRule(IToken token, String taskWords) {
super(new TaskTagDetector(), Token.UNDEFINED);
- fToken= token;
- if( taskWords!= null) {
+ fToken = token;
+ if (taskWords != null) {
addTaskTags(taskWords);
}
}
@@ -95,8 +96,8 @@ public final class TaskTagRule extends WordRule implements IPropertyChangePartic
* @param value a comma delimited list of words to recognize as task tags
*/
public void addTaskTags(String value) {
- String[] tasks= value.split(","); //$NON-NLS-1$
- for (int i= 0; i < tasks.length; i++) {
+ String[] tasks = value.split(","); //$NON-NLS-1$
+ for (int i = 0; i < tasks.length; i++) {
if (tasks[i].length() > 0) {
addWord(tasks[i], fToken);
}
@@ -117,7 +118,7 @@ public final class TaskTagRule extends WordRule implements IPropertyChangePartic
@Override
public void adaptToPreferenceChange(PropertyChangeEvent event) {
if (event.getProperty().equals(CCorePreferenceConstants.TODO_TASK_TAGS)) {
- Object value= event.getNewValue();
+ Object value = event.getNewValue();
if (value instanceof String) {
clearTaskTags();

Back to the top