|
From: Christopher W. <caw...@us...> - 2006-02-10 18:33:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6088/src/org/rubypeople/rdt/internal/core/parser Modified Files: TaskParser.java Log Message: take a Map of options (instead of IEclipsePrefences) to make us more like JDT (and able to handle project specific settings) Index: TaskParser.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskParser.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TaskParser.java 6 Aug 2005 22:57:32 -0000 1.7 --- TaskParser.java 10 Feb 2006 18:33:49 -0000 1.8 *************** *** 10,18 **** import java.util.Collections; import java.util.List; import java.util.StringTokenizer; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; - import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.rubypeople.rdt.core.RubyCore; --- 10,18 ---- import java.util.Collections; import java.util.List; + import java.util.Map; import java.util.StringTokenizer; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.rubypeople.rdt.core.RubyCore; *************** *** 28,36 **** private List tasks; ! public TaskParser(IEclipsePreferences preferences) { ! String caseSensitive = preferences.get(RubyCore.COMPILER_TASK_CASE_SENSITIVE, RubyCore.ENABLED); ! if (caseSensitive == RubyCore.ENABLED) fCaseSensitive = true; ! String tags = preferences.get(RubyCore.COMPILER_TASK_TAGS, RubyCore.DEFAULT_TASK_TAGS); ! String priorities = preferences.get(RubyCore.COMPILER_TASK_PRIORITIES, RubyCore.DEFAULT_TASK_PRIORITIES); fTags = tokenize(tags, ","); fPriorities = convertPriorities(tokenize(priorities, ",")); --- 28,36 ---- private List tasks; ! public TaskParser(Map preferences) { ! String caseSensitive = getString(preferences, RubyCore.COMPILER_TASK_CASE_SENSITIVE, RubyCore.ENABLED); ! if (caseSensitive.equals(RubyCore.ENABLED)) fCaseSensitive = true; ! String tags = getString(preferences, RubyCore.COMPILER_TASK_TAGS, RubyCore.DEFAULT_TASK_TAGS); ! String priorities = getString(preferences, RubyCore.COMPILER_TASK_PRIORITIES, RubyCore.DEFAULT_TASK_PRIORITIES); fTags = tokenize(tags, ","); fPriorities = convertPriorities(tokenize(priorities, ",")); *************** *** 38,42 **** } ! private int[] convertPriorities(String[] stringPriorities) { int priorities[] = new int[stringPriorities.length]; for (int i = 0; i < stringPriorities.length; i++) { --- 38,49 ---- } ! private String getString(Map preferences, String key, String def) { ! if (preferences == null) return def; ! String answer = (String) preferences.get(key); ! if (answer == null) return def; ! return answer; ! } ! ! private int[] convertPriorities(String[] stringPriorities) { int priorities[] = new int[stringPriorities.length]; for (int i = 0; i < stringPriorities.length; i++) { |