|
From: Christopher W. <caw...@us...> - 2006-02-10 18:35:20
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6789/src/org/rubypeople/rdt/core Modified Files: RubyCore.java Log Message: changes to work with all the other stuff I've done Index: RubyCore.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** RubyCore.java 13 Dec 2005 20:07:47 -0000 1.28 --- RubyCore.java 10 Feb 2006 18:35:09 -0000 1.29 *************** *** 34,44 **** import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; - import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; - import org.eclipse.core.runtime.preferences.InstanceScope; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.rubypeople.rdt.internal.core.BatchOperation; import org.rubypeople.rdt.internal.core.DefaultWorkingCopyOwner; import org.rubypeople.rdt.internal.core.RubyModel; import org.rubypeople.rdt.internal.core.RubyModelManager; --- 34,43 ---- import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.rubypeople.rdt.internal.core.BatchOperation; import org.rubypeople.rdt.internal.core.DefaultWorkingCopyOwner; + import org.rubypeople.rdt.internal.core.RubyCorePreferenceInitializer; import org.rubypeople.rdt.internal.core.RubyModel; import org.rubypeople.rdt.internal.core.RubyModelManager; *************** *** 176,179 **** --- 175,193 ---- public static final String CORE_ENCODING = PLUGIN_ID + ".encoding"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * + * @see #getDefaultOptions() + * @since 0.8.0 + */ + public static final String INSERT = "insert"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * + * @see #getDefaultOptions() + * @since 0.8.0 + */ + public static final String DO_NOT_INSERT = "do not insert"; //$NON-NLS-1$ + private SymbolIndex symbolIndex; private ISymbolFinder symbolFinder; *************** *** 205,242 **** public void start(BundleContext context) throws Exception { super.start(context); ! // init preferences ! initializeDefaultPreferences(); ! ! // Listen to instance preferences node removal from parent in order to ! // refresh stored one ! IEclipsePreferences.INodeChangeListener listener = new IEclipsePreferences.INodeChangeListener() { ! ! public void added(IEclipsePreferences.NodeChangeEvent event) { ! // do nothing ! } ! ! public void removed(IEclipsePreferences.NodeChangeEvent event) { ! if (event.getChild() == preferencesLookup[PREF_INSTANCE]) { ! preferencesLookup[PREF_INSTANCE] = new InstanceScope().getNode(PLUGIN_ID); ! } ! } ! }; ! ((IEclipsePreferences) getInstancePreferences().parent()).addNodeChangeListener(listener); ! ! // Listen to default preferences node removal from parent in order to ! // refresh stored one ! listener = new IEclipsePreferences.INodeChangeListener() { ! ! public void added(IEclipsePreferences.NodeChangeEvent event) { ! // do nothing ! } ! ! public void removed(IEclipsePreferences.NodeChangeEvent event) { ! if (event.getChild() == preferencesLookup[PREF_DEFAULT]) { ! preferencesLookup[PREF_DEFAULT] = new DefaultScope().getNode(PLUGIN_ID); ! } ! } ! }; ! ((IEclipsePreferences) getDefaultPreferences().parent()).addNodeChangeListener(listener); RubyParser.setDebugging(isDebugOptionTrue(RUBY_PARSER_DEBUG_OPTION)); --- 219,223 ---- public void start(BundleContext context) throws Exception { super.start(context); ! RubyModelManager.getRubyModelManager().startup(); RubyParser.setDebugging(isDebugOptionTrue(RUBY_PARSER_DEBUG_OPTION)); *************** *** 252,255 **** --- 233,251 ---- } + /* + * (non-Javadoc) Shutdown the JavaCore plug-in. <p> De-registers the + * RubyModelManager as a resource changed listener and save participant. <p> + * + * @see org.eclipse.core.runtime.Plugin#stop(BundleContext) + */ + public void stop(BundleContext context) throws Exception { + try { + RubyModelManager.getRubyModelManager().shutdown(); + } finally { + // ensure we call super.stop as the last thing + super.stop(context); + } + } + private boolean isDebugOptionTrue(String option) { String optionText = Platform.getDebugOption(option); *************** *** 276,316 **** } - /* - * Initializes the default preferences settings for this plug-in. - */ - protected void initializeDefaultPreferences() { - // Init and store default and instance preferences - IEclipsePreferences defaultPreferences = getDefaultPreferences(); - - // Override some compiler defaults - defaultPreferences.put(COMPILER_TASK_TAGS, DEFAULT_TASK_TAGS); - defaultPreferences.put(COMPILER_TASK_PRIORITIES, DEFAULT_TASK_PRIORITIES); - defaultPreferences.put(COMPILER_TASK_CASE_SENSITIVE, ENABLED); - } - public static void trace(String message) { if (getPlugin().isDebugging()) System.out.println(message); } - /** - * @since 3.1 - */ - public static IEclipsePreferences getDefaultPreferences() { - if (preferencesLookup[PREF_DEFAULT] == null) { - preferencesLookup[PREF_DEFAULT] = new DefaultScope().getNode(PLUGIN_ID); - } - return preferencesLookup[PREF_DEFAULT]; - } - - /** - * @since 3.1 - */ - public static IEclipsePreferences getInstancePreferences() { - if (preferencesLookup[PREF_INSTANCE] == null) { - preferencesLookup[PREF_INSTANCE] = new InstanceScope().getNode(PLUGIN_ID); - } - return preferencesLookup[PREF_INSTANCE]; - } - public static void log(Exception e) { String msg = e.getMessage(); --- 272,279 ---- *************** *** 649,651 **** --- 612,618 ---- return (RubyCore) getPlugin(); } + + public static boolean isRubyLikeFileName(String name) { + return name.endsWith(".rb") || name.endsWith(".rbw"); + } } \ No newline at end of file |