diff options
author | Bogdan Gheorghe | 2006-06-16 14:55:14 +0000 |
---|---|---|
committer | Bogdan Gheorghe | 2006-06-16 14:55:14 +0000 |
commit | def0bb590c4b821bf4f3210b823c12b6d84b303d (patch) | |
tree | 7c545116879e387b28cec740f144e9305b82aa58 /examples | |
parent | a2fe7bf92cdc414a70f1c7fe3dce31c56e95fb73 (diff) | |
download | eclipse.platform.team-def0bb590c4b821bf4f3210b823c12b6d84b303d.tar.gz eclipse.platform.team-def0bb590c4b821bf4f3210b823c12b6d84b303d.tar.xz eclipse.platform.team-def0bb590c4b821bf4f3210b823c12b6d84b303d.zip |
Bug 144367 Pessimistic Filesystem Provider doesn't prompt to add files to control
Diffstat (limited to 'examples')
2 files changed, 29 insertions, 4 deletions
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java index 829410b12..7e0e3cca7 100644 --- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java +++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemPlugin.java @@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.team.core.TeamException; import org.eclipse.team.examples.pessimistic.PessimisticFilesystemProviderPlugin; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; /** * This is the plugin class for the file system examples. It provides the following: @@ -46,6 +47,7 @@ public class FileSystemPlugin extends AbstractUIPlugin { // This static field will hold the singleton instance of the plugin class private static FileSystemPlugin plugin; + private PessimisticFilesystemProviderPlugin pessPlugin; /** * Override the standard plugin constructor. * @@ -56,7 +58,7 @@ public class FileSystemPlugin extends AbstractUIPlugin { // record this instance as the singleton plugin = this; // Instanctiate pessimistic provider - new PessimisticFilesystemProviderPlugin(descriptor); + pessPlugin = new PessimisticFilesystemProviderPlugin(descriptor); } /** @@ -113,5 +115,20 @@ public class FileSystemPlugin extends AbstractUIPlugin { } return display; } + + public void start(BundleContext context) throws Exception { + super.start(context); + //Call startup on the Pessimistic Plugin + pessPlugin.startup(); + } + + public void stop(BundleContext context) throws Exception { + try { + if (pessPlugin != null) + pessPlugin.shutdown(); + } finally { + super.stop(context); + } + } } diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProviderPlugin.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProviderPlugin.java index 4e8dddc6e..31404fb27 100644 --- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProviderPlugin.java +++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/pessimistic/PessimisticFilesystemProviderPlugin.java @@ -10,10 +10,15 @@ *******************************************************************************/ package org.eclipse.team.examples.pessimistic; -import java.util.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.*; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPluginDescriptor; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.ui.plugin.AbstractUIPlugin; @@ -64,7 +69,9 @@ public class PessimisticFilesystemProviderPlugin extends AbstractUIPlugin { /** * Initializes the default preferences for this plugin. */ - protected void initializeDefaultPreferences(IPreferenceStore store) { + protected void initializeDefaultPreferences() { + IPreferenceStore store = getPreferenceStore(); + store.setDefault( IPessimisticFilesystemConstants.PREF_CHECKED_IN_FILES_EDITED, IPessimisticFilesystemConstants.OPTION_PROMPT); @@ -102,6 +109,7 @@ public class PessimisticFilesystemProviderPlugin extends AbstractUIPlugin { public void startup() throws CoreException { fListener= new ResourceChangeListener(); fListener.startup(); + initializeDefaultPreferences(); super.startup(); } |