|
From: David C. <dc...@us...> - 2005-10-16 21:02:24
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23517/src/org/rubypeople/rdt/core Modified Files: RubyCore.java Log Message: Refactored setting debug flags. Index: RubyCore.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** RubyCore.java 16 Oct 2005 19:03:41 -0000 1.18 --- RubyCore.java 16 Oct 2005 21:02:16 -0000 1.19 *************** *** 53,56 **** --- 53,62 ---- public final static String PLUGIN_ID = "org.rubypeople.rdt.core"; + + private static final String RUBY_PARSER_DEBUG_OPTION = RubyCore.PLUGIN_ID + "/rubyparser"; + + private static final String MODEL_MANAGER_VERBOSE_OPTION = RubyCore.PLUGIN_ID + "/modelmanager"; + + private static final String SYMBOL_INDEX_VERBOSE_OPTION = RubyCore.PLUGIN_ID + "/symbolIndex"; public final static String NATURE_ID = PLUGIN_ID + ".rubynature"; *************** *** 204,213 **** ((IEclipsePreferences) getDefaultPreferences().parent()).addNodeChangeListener(listener); ! String rubyParserOption = Platform.getDebugOption(RubyCore.PLUGIN_ID + "/rubyparser"); ! RubyParser.setDebugging(rubyParserOption == null ? false : rubyParserOption.equalsIgnoreCase("true")); ! ! String modelManagerOption = Platform.getDebugOption(RubyCore.PLUGIN_ID + "/modelmanager"); ! RubyModelManager.VERBOSE = modelManagerOption == null ! ? false : rubyParserOption.equalsIgnoreCase("true"); IndexUpdater indexUpdater = new IndexUpdater(symbolIndex); --- 210,216 ---- ((IEclipsePreferences) getDefaultPreferences().parent()).addNodeChangeListener(listener); ! RubyParser.setDebugging(isDebugOptionTrue(RUBY_PARSER_DEBUG_OPTION)); ! RubyModelManager.setVerbose(isDebugOptionTrue(MODEL_MANAGER_VERBOSE_OPTION)); ! SymbolIndex.setVerbose(isDebugOptionTrue(SYMBOL_INDEX_VERBOSE_OPTION)); IndexUpdater indexUpdater = new IndexUpdater(symbolIndex); *************** *** 216,219 **** --- 219,228 ---- } + private boolean isDebugOptionTrue(String option) { + String optionText = Platform.getDebugOption(option); + return optionText == null + ? false : optionText.equalsIgnoreCase("true"); + } + public static boolean upgradeOldProjects() throws CoreException { boolean projectUpgraded = false; |