Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-02-25 20:45:35 +0000
committerJean Michel-Lemieux2004-02-25 20:45:35 +0000
commit611f26b53dc8c8e03019aa05a42e7ed40ad2fa51 (patch)
treeda1a682b00dda95024364683fd6e75f19c4505fe /bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
parent4a1ca77df6f4238416a8715a8c35819611d5992a (diff)
downloadeclipse.platform.team-611f26b53dc8c8e03019aa05a42e7ed40ad2fa51.tar.gz
eclipse.platform.team-611f26b53dc8c8e03019aa05a42e7ed40ad2fa51.tar.xz
eclipse.platform.team-611f26b53dc8c8e03019aa05a42e7ed40ad2fa51.zip
SyncView API released to HEAD.
Diffstat (limited to 'bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java')
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java79
1 files changed, 23 insertions, 56 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
index c0336b5c9..cc8b7416b 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
@@ -17,7 +17,6 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -28,8 +27,6 @@ import java.util.TreeMap;
import java.util.Vector;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
@@ -41,11 +38,11 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
+import org.eclipse.team.internal.core.DeploymentProviderManager;
import org.eclipse.team.internal.core.Policy;
import org.eclipse.team.internal.core.StringMatcher;
import org.eclipse.team.internal.core.TeamPlugin;
@@ -54,13 +51,15 @@ import org.eclipse.team.internal.core.TeamPlugin;
* The Team class provides a global point of reference for the global ignore set
* and the text/binary registry.
*
+ * WVCM: how does the IProjectSetSerializer fit into the 3.0 team api?
+ *
* @since 2.0
*/
public final class Team {
- public static final String PREF_TEAM_IGNORES = "ignore_files"; //$NON-NLS-1$
- public static final String PREF_TEAM_TYPES = "file_types"; //$NON-NLS-1$
- public static final String PREF_TEAM_SEPARATOR = "\n"; //$NON-NLS-1$
+ private static final String PREF_TEAM_IGNORES = "ignore_files"; //$NON-NLS-1$
+ private static final String PREF_TEAM_TYPES = "file_types"; //$NON-NLS-1$
+ private static final String PREF_TEAM_SEPARATOR = "\n"; //$NON-NLS-1$
public static final Status OK_STATUS = new Status(Status.OK, TeamPlugin.ID, Status.OK, Policy.bind("ok"), null); //$NON-NLS-1$
// File type constants
@@ -75,6 +74,9 @@ public final class Team {
private static SortedMap globalIgnore, pluginIgnore;
private static StringMatcher[] ignoreMatchers;
+ // Deployment provider manager
+ private static IDeploymentProviderManager deploymentManager;
+
private static class FileTypeInfo implements IFileTypeInfo {
private String extension;
private int type;
@@ -296,55 +298,6 @@ public final class Team {
TeamPlugin.getPlugin().getPluginPreferences().setValue(PREF_TEAM_IGNORES, buf.toString());
}
- /**
- * Utility method for removing a project nature from a project.
- *
- * @param proj the project to remove the nature from
- * @param natureId the nature id to remove
- * @param monitor a progress monitor to indicate the duration of the operation, or
- * <code>null</code> if progress reporting is not required.
- *
- * @deprecated
- */
- public static void removeNatureFromProject(IProject proj, String natureId, IProgressMonitor monitor) throws TeamException {
- try {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures= description.getNatureIds();
- List newNatures = new ArrayList(Arrays.asList(prevNatures));
- newNatures.remove(natureId);
- description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()]));
- proj.setDescription(description, monitor);
- } catch(CoreException e) {
- throw wrapException(Policy.bind("manager.errorRemovingNature", proj.getName(), natureId), e); //$NON-NLS-1$
- }
- }
-
- /**
- * Utility method for adding a nature to a project.
- *
- * @param proj the project to add the nature
- * @param natureId the id of the nature to assign to the project
- * @param monitor a progress monitor to indicate the duration of the operation, or
- * <code>null</code> if progress reporting is not required.
- *
- * @exception TeamException if a problem occured setting the nature
- *
- * @deprecated
- */
- public static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws TeamException {
- try {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures= description.getNatureIds();
- String[] newNatures= new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length]= natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, monitor);
- } catch(CoreException e) {
- throw wrapException(Policy.bind("manager.errorSettingNature", proj.getName(), natureId), e); //$NON-NLS-1$
- }
- }
-
/*
* TEXT
*
@@ -580,6 +533,7 @@ public final class Team {
}
}
}, IResourceChangeEvent.POST_CHANGE);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener((DeploymentProviderManager)getDeploymentManager(), IResourceChangeEvent.PRE_AUTO_BUILD);
}
/**
@@ -649,4 +603,17 @@ public final class Team {
initializePluginPatterns(pTypes, gTypes);
return getFileTypeInfo(gTypes);
}
+
+ /**
+ * Returns the deployment manager.
+ * @return the deployment manager
+ * @since 3.0
+ */
+ public static IDeploymentProviderManager getDeploymentManager() {
+ if(deploymentManager == null) {
+ deploymentManager = new DeploymentProviderManager();
+ }
+ return deploymentManager;
+ }
+
}

Back to the top