org.eclipse.team.core_3.6.0.I20110525-0800

id)
  {
    IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", "repository");
    if (extension != null)
    {
      IExtension[] extensions = extension.getExtensions();
      for (int i = 0; i < extensions.length; i++)
      {
        IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
        for (int j = 0; j < configElements.length; j++)
        {
          String aliasId = configElements[j].getAttribute("canImportId");
          if ((aliasId != null) && (aliasId.equals(id)))
          {
            String extensionId = configElements[j].getAttribute("id");
            if (extensionId != null) {
              return RepositoryProviderType.getProviderType(extensionId);
            }
          }
        }
      }
    }
    return null;
  }
  
  public static IPath[] getMetaFilePaths(String id)
  {
    IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", "repository");
    if (extension != null)
    {
      IExtension[] extensions = extension.getExtensions();
      for (int i = 0; i < extensions.length; i++)
      {
        IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
        for (int j = 0; j < configElements.length; j++)
        {
          String extensionId = configElements[j].getAttribute("id");
          String metaFilePaths = configElements[j].getAttribute("metaFilePaths");
          if ((extensionId != null) && (extensionId.equals(id)) && (metaFilePaths != null)) {
            return getPaths(metaFilePaths);
          }
        }
      }
    }
    return null;
  }
  
  private static IPath[] getPaths(String metaFilePaths)
  {
    List result = new ArrayList();
    StringTokenizer t = new StringTokenizer(metaFilePaths, ",");
    while (t.hasMoreTokens())
    {
      String next = t.nextToken();
      IPath path = new Path(null, next);
      result.add(path);
    }
    return (IPath[])result.toArray(new IPath[result.size()]);
  }
  
  public void setMergerDelegate(IStreamMergerDelegate merger)
  {
    mergerDelegate = merger;
  }
  
  public IStreamMergerDelegate getMergerDelegate()
  {
    return mergerDelegate;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.TeamPlugin
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core;

import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.CoreException;

class TeamResourceChangeListener$1
  implements IResourceDeltaVisitor
{
  final TeamResourceChangeListener this$0;
  private final List val$result;
  
  TeamResourceChangeListener$1(TeamResourceChangeListener paramTeamResourceChangeListener, List paramList)
  {
    this$0 = paramTeamResourceChangeListener;val$result = paramList;
  }
  
  public boolean visit(IResourceDelta delta)
    throws CoreException
  {
    if (((delta.getKind() & 0x1) != 0) && 
      (delta.getResource().getType() == 1)) {
      val$result.add(delta.getResource());
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.TeamResourceChangeListener.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.RepositoryProviderType;

public final class TeamResourceChangeListener
  implements IResourceChangeListener
{
  private static final Map metaFilePaths = new HashMap();
  
  static
  {
    String[] ids = RepositoryProvider.getAllProviderTypeIds();
    for (int i = 0; i < ids.length; i++)
    {
      String id = ids[i];
      IPath[] paths = TeamPlugin.getMetaFilePaths(id);
      if (paths != null) {
        metaFilePaths.put(id, paths);
      }
    }
  }
  
  public void resourceChanged(IResourceChangeEvent event)
  {
    IResourceDelta[] projectDeltas = event.getDelta().getAffectedChildren();
    for (int i = 0; i < projectDeltas.length; i++)
    {
      IResourceDelta delta = projectDeltas[i];
      IResource resource = delta.getResource();
      IProject project = resource.getProject();
      if (!RepositoryProvider.isShared(project))
      {
        handleUnsharedProjectChanges(project, delta);
      }
      else if ((delta.getKind() == 1) && 
        ((delta.getFlags() & 0x1000) != 0))
      {
        RepositoryProvider provider = RepositoryProvider.getProvider(project);
        if (provider != null) {
          if (!provider.getProject().equals(project)) {
            provider.setProject(project);
          }
        }
      }
    }
  }
  
  private void handleUnsharedProjectChanges(IProject project, IResourceDelta delta)
  {
    String repositoryId = null;
    Set metaFileContainers = new HashSet();
    Set badIds = new HashSet();
    IFile[] files = getAddedFiles(delta);
    for (int i = 0; i < files.length; i++)
    {
      IFile file = files[i];
      String typeId = getMetaFileType(file);
      if (typeId != null)
      {
        if (repositoryId == null)
        {
          repositoryId = typeId;
        }
        else if ((!repositoryId.equals(typeId)) && (!badIds.contains(typeId)))
        {
          TeamPlugin.log(2, "Meta files for two repository types (" + repositoryId + " and " + typeId + " was found in project " + project.getName() + ".", null);
          badIds.add(typeId);
        }
        if (typeId.equals(repositoryId))
        {
          IContainer container = getContainer(typeId, file);
          metaFileContainers.add(container);
        }
      }
    }
    if (repositoryId != null)
    {
      RepositoryProviderType type = RepositoryProviderType.getProviderType(repositoryId);
      type.metaFilesDetected(project, (IContainer[])metaFileContainers.toArray(new IContainer[metaFileContainers.size()]));
    }
  }
  
  private IContainer getContainer(String typeId, IFile file)
  {
    IPath[] paths = (IPath[])metaFilePaths.get(typeId);
    IPath foundPath = null;
    IPath projectRelativePath = file.getProjectRelativePath();
    for (int i = 0; i < paths.length; i++)
    {
      IPath path = paths[i];
      if (isSuffix(projectRelativePath, path)) {
        foundPath = path;
      }
    }
    IResource resource = file;
    if (foundPath != null) {
      for (int i = 0; i < foundPath.segmentCount(); i++) {
        resource = resource.getParent();
      }
    }
    if (resource.getType() == 1) {
      return file.getParent();
    }
    return (IContainer)resource;
  }
  
  private String getMetaFileType(IFile file)
  {
    IPath[] paths;
    int i;
    for (Iterator iter = metaFilePaths.keySet().iterator(); iter.hasNext(); i < paths.length)
    {
      String id = (String)iter.next();
      paths = (IPath[])metaFilePaths.get(id);
      i = 0; continue;
      IPath path = paths[i];
      if (isSuffix(file.getProjectRelativePath(), path)) {
        return id;
      }
      i++;
    }
    return null;
  }
  
  private boolean isSuffix(IPath path, IPath suffix)
  {
    if (path.segmentCount() < suffix.segmentCount()) {
      return false;
    }
    for (int i = 0; i < suffix.segmentCount(); i++) {
      if (!suffix.segment(i).equals(path.segment(path.segmentCount() - suffix.segmentCount() + i))) {
        return false;
      }
    }
    return true;
  }
  
  private IFile[] getAddedFiles(IResourceDelta delta)
  {
    List result = new ArrayList();
    try
    {
      delta.accept(new IResourceDeltaVisitor()
      {
        private final List val$result;
        
        public boolean visit(IResourceDelta delta)
          throws CoreException
        {
          if (((delta.getKind() & 0x1) != 0) && 
            (delta.getResource().getType() == 1)) {
            val$result.add(delta.getResource());
          }
          return true;
        }
      });
    }
    catch (CoreException e)
    {
      TeamPlugin.log(4, "An error occurred while scanning for meta-file changes", e);
    }
    return (IFile[])result.toArray(new IFile[result.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.TeamResourceChangeListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.StringTokenizer;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;

public class UserStringMappings
  implements Preferences.IPropertyChangeListener
{
  public static final Integer BINARY = new Integer(2);
  public static final Integer TEXT = new Integer(1);
  public static final Integer UNKNOWN = new Integer(0);
  private static final String PREF_TEAM_SEPARATOR = "\n";
  private final Preferences fPreferences;
  private final String fKey;
  private Map fMap;
  
  public UserStringMappings(String key)
  {
    fKey = key;
    fPreferences = TeamPlugin.getPlugin().getPluginPreferences();
    fPreferences.addPropertyChangeListener(this);
  }
  
  public Map referenceMap()
  {
    if (fMap == null) {
      fMap = loadMappingsFromPreferences();
    }
    return fMap;
  }
  
  public void addStringMappings(String[] names, int[] types)
  {
    Assert.isTrue(names.length == types.length);
    Map map = referenceMap();
    for (int i = 0; i < names.length; i++) {
      switch (types[i])
      {
      case 2: 
        map.put(names[i], BINARY); break;
      case 1: 
        map.put(names[i], TEXT); break;
      case 0: 
        map.put(names[i], UNKNOWN);
      }
    }
    save();
  }
  
  public void setStringMappings(String[] names, int[] types)
  {
    Assert.isTrue(names.length == types.length);
    referenceMap().clear();
    addStringMappings(names, types);
  }
  
  public int getType(String string)
  {
    if (string == null) {
      return 0;
    }
    Integer type = (Integer)referenceMap().get(string);
    return type != null ? type.intValue() : 0;
  }
  
  public void propertyChange(Preferences.PropertyChangeEvent event)
  {
    if (event.getProperty().equals(fKey)) {
      fMap = null;
    }
  }
  
  public void save()
  {
    StringBuffer buffer = new StringBuffer();
    Iterator e = fMap.keySet().iterator();
    while (e.hasNext())
    {
      String filename = (String)e.next();
      buffer.append(filename);
      buffer.append("\n");
      Integer type = (Integer)fMap.get(filename);
      buffer.append(type);
      buffer.append("\n");
    }
    TeamPlugin.getPlugin().getPluginPreferences().setValue(fKey, buffer.toString());
  }
  
  protected Map loadMappingsFromPreferences()
  {
    Map result = new HashMap();
    if (!fPreferences.contains(fKey)) {
      return result;
    }
    String prefTypes = fPreferences.getString(fKey);
    StringTokenizer tok = new StringTokenizer(prefTypes, "\n");
    try
    {
      while (tok.hasMoreElements())
      {
        String name = tok.nextToken();
        String mode = tok.nextToken();
        result.put(name, Integer.valueOf(mode));
      }
    }
    catch (NoSuchElementException localNoSuchElementException) {}
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.UserStringMappings
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.history;

import java.util.ArrayList;
import org.eclipse.core.resources.IFile;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.history.provider.FileHistory;

public class LocalFileHistory
  extends FileHistory
{
  protected IFile file;
  protected IFileRevision[] revisions;
  private final boolean includeCurrent;
  
  public LocalFileHistory(IFile file, boolean includeCurrent)
  {
    this.file = file;
    this.includeCurrent = includeCurrent;
  }
  
  public IFileRevision[] getContributors(IFileRevision revision)
  {
    IFileRevision[] revisions = getFileRevisions();
    
    IFileRevision fileRevision = null;
    for (int i = 0; i < revisions.length; i++) {
      if (((LocalFileRevision)revisions[i]).isPredecessorOf(revision))
      {
        if (fileRevision == null) {
          fileRevision = revisions[i];
        }
        if ((fileRevision != null) && (revisions[i].getTimestamp() > fileRevision.getTimestamp())) {
          fileRevision = revisions[i];
        }
      }
    }
    if (fileRevision == null) {
      return new IFileRevision[0];
    }
    return new IFileRevision[] { fileRevision };
  }
  
  public IFileRevision getFileRevision(String id)
  {
    if (revisions != null) {
      for (int i = 0; i < revisions.length; i++)
      {
        IFileRevision revision = revisions[i];
        if (revision.getContentIdentifier().equals(id)) {
          return revision;
        }
      }
    }
    return null;
  }
  
  public IFileRevision[] getFileRevisions()
  {
    if (revisions == null) {
      return new IFileRevision[0];
    }
    return revisions;
  }
  
  public IFileRevision[] getTargets(IFileRevision revision)
  {
    IFileRevision[] revisions = getFileRevisions();
    ArrayList directDescendents = new ArrayList();
    for (int i = 0; i < revisions.length; i++) {
      if (((LocalFileRevision)revisions[i]).isDescendentOf(revision)) {
        directDescendents.add(revisions[i]);
      }
    }
    return (IFileRevision[])directDescendents.toArray(new IFileRevision[directDescendents.size()]);
  }
  
  /* Error */
  public void refresh(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.team.core.TeamException
  {
    // Byte code:
    //   0: aload_1
    //   1: getstatic 111	org/eclipse/team/internal/core/Messages:LocalFileHistory_RefreshLocalHistory	Ljava/lang/String;
    //   4: sipush 300
    //   7: invokeinterface 131 3 0
    //   12: aload_0
    //   13: invokespecial 122	org/eclipse/team/internal/core/history/LocalFileHistory:includeRevisionForFile	()Z
    //   16: ifeq +17 -> 33
    //   19: new 65	org/eclipse/team/internal/core/history/LocalFileRevision
    //   22: dup
    //   23: aload_0
    //   24: getfield 113	org/eclipse/team/internal/core/history/LocalFileHistory:file	Lorg/eclipse/core/resources/IFile;
    //   27: invokespecial 124	org/eclipse/team/internal/core/history/LocalFileRevision:<init>	(Lorg/eclipse/core/resources/IFile;)V
    //   30: goto +4 -> 34
    //   33: aconst_null
    //   34: astore_2
    //   35: aload_0
    //   36: getfield 113	org/eclipse/team/internal/core/history/LocalFileHistory:file	Lorg/eclipse/core/resources/IFile;
    //   39: aload_1
    //   40: invokeinterface 129 2 0
    //   45: astore_3
    //   46: aload_3
    //   47: arraylength
    //   48: aload_2
    //   49: ifnull +7 -> 56
    //   52: iconst_1
    //   53: goto +4 -> 57
    //   56: iconst_0
    //   57: iadd
    //   58: istore 4
    //   60: aload_0
    //   61: iload 4
    //   63: anewarray 65	org/eclipse/team/internal/core/history/LocalFileRevision
    //   66: putfield 114	org/eclipse/team/internal/core/history/LocalFileHistory:revisions	[Lorg/eclipse/team/core/history/IFileRevision;
    //   69: iconst_0
    //   70: istore 5
    //   72: goto +24 -> 96
    //   75: aload_0
    //   76: getfield 114	org/eclipse/team/internal/core/history/LocalFileHistory:revisions	[Lorg/eclipse/team/core/history/IFileRevision;
    //   79: iload 5
    //   81: new 65	org/eclipse/team/internal/core/history/LocalFileRevision
    //   84: dup
    //   85: aload_3
    //   86: iload 5
    //   88: aaload
    //   89: invokespecial 125	org/eclipse/team/internal/core/history/LocalFileRevision:<init>	(Lorg/eclipse/core/resources/IFileState;)V
    //   92: aastore
    //   93: iinc 5 1
    //   96: iload 5
    //   98: aload_3
    //   99: arraylength
    //   100: if_icmplt -25 -> 75
    //   103: aload_2
    //   104: ifnull +31 -> 135
    //   107: aload_0
    //   108: getfield 114	org/eclipse/team/internal/core/history/LocalFileHistory:revisions	[Lorg/eclipse/team/core/history/IFileRevision;
    //   111: aload_3
    //   112: arraylength
    //   113: aload_2
    //   114: aastore
    //   115: goto +20 -> 135
    //   118: astore_2
    //   119: aload_2
    //   120: invokestatic 120	org/eclipse/team/core/TeamException:asTeamException	(Lorg/eclipse/core/runtime/CoreException;)Lorg/eclipse/team/core/TeamException;
    //   123: athrow
    //   124: astore 6
    //   126: aload_1
    //   127: invokeinterface 130 1 0
    //   132: aload 6
    //   134: athrow
    //   135: aload_1
    //   136: invokeinterface 130 1 0
    //   141: return
    // Line number table:
    //   Java source line #112	-> byte code offset #0
    //   Java source line #116	-> byte code offset #12
    //   Java source line #115	-> byte code offset #34
    //   Java source line #117	-> byte code offset #35
    //   Java source line #118	-> byte code offset #46
    //   Java source line #119	-> byte code offset #60
    //   Java source line #120	-> byte code offset #69
    //   Java source line #121	-> byte code offset #75
    //   Java source line #120	-> byte code offset #93
    //   Java source line #123	-> byte code offset #103
    //   Java source line #124	-> byte code offset #107
    //   Java source line #125	-> byte code offset #118
    //   Java source line #126	-> byte code offset #119
    //   Java source line #127	-> byte code offset #124
    //   Java source line #128	-> byte code offset #126
    //   Java source line #129	-> byte code offset #132
    //   Java source line #128	-> byte code offset #135
    //   Java source line #130	-> byte code offset #141
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	142	0	this	LocalFileHistory
    //   0	142	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   34	80	2	currentRevision	LocalFileRevision
    //   118	2	2	e	org.eclipse.core.runtime.CoreException
    //   45	67	3	fileStates	org.eclipse.core.resources.IFileState[]
    //   58	4	4	numRevisions	int
    //   70	27	5	i	int
    //   124	9	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   12	115	118	org/eclipse/core/runtime/CoreException
    //   12	124	124	finally
  }
  
  private boolean includeRevisionForFile()
  {
    return (file.exists()) && (includeCurrent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.history.LocalFileHistory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.history;

import java.net.URI;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFileState;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.history.ITag;
import org.eclipse.team.core.history.provider.FileRevision;
import org.eclipse.team.internal.core.Messages;

public class LocalFileRevision
  extends FileRevision
{
  private IFileState state;
  private IFile file;
  private IFileRevision baseRevision;
  
  public LocalFileRevision(IFileState state)
  {
    this.state = state;
    file = null;
    baseRevision = null;
  }
  
  public LocalFileRevision(IFile file)
  {
    this.file = file;
    baseRevision = null;
    state = null;
  }
  
  public String getContentIdentifier()
  {
    if (file != null) {
      return baseRevision == null ? NLS.bind(Messages.LocalFileRevision_currentVersion, "") : NLS.bind(Messages.LocalFileRevision_currentVersion, baseRevision.getContentIdentifier());
    }
    return "";
  }
  
  public String getAuthor()
  {
    return "";
  }
  
  public String getComment()
  {
    if (file != null) {
      return Messages.LocalFileRevision_currentVersionTag;
    }
    return null;
  }
  
  public ITag[] getTags()
  {
    return new ITag[0];
  }
  
  public IStorage getStorage(IProgressMonitor monitor)
    throws CoreException
  {
    if (file != null) {
      return file;
    }
    return state;
  }
  
  public String getName()
  {
    if (file != null) {
      return file.getName();
    }
    return state.getName();
  }
  
  public long getTimestamp()
  {
    if (file != null) {
      return file.getLocalTimeStamp();
    }
    return state.getModificationTime();
  }
  
  public boolean exists()
  {
    if (file != null) {
      return file.exists();
    }
    return state.exists();
  }
  
  public void setBaseRevision(IFileRevision baseRevision)
  {
    this.baseRevision = baseRevision;
  }
  
  public boolean isPropertyMissing()
  {
    return true;
  }
  
  public IFileRevision withAllProperties(IProgressMonitor monitor)
  {
    return this;
  }
  
  public boolean isPredecessorOf(IFileRevision revision)
  {
    long compareRevisionTime = revision.getTimestamp();
    return getTimestamp() < compareRevisionTime;
  }
  
  public boolean isDescendentOf(IFileRevision revision)
  {
    long compareRevisionTime = revision.getTimestamp();
    return getTimestamp() > compareRevisionTime;
  }
  
  public URI getURI()
  {
    if (file != null) {
      return file.getLocationURI();
    }
    return URIUtil.toURI(state.getFullPath());
  }
  
  public IFile getFile()
  {
    return file;
  }
  
  public IFileState getState()
  {
    return state;
  }
  
  public boolean isCurrentState()
  {
    return file != null;
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if ((obj instanceof LocalFileRevision))
    {
      LocalFileRevision other = (LocalFileRevision)obj;
      if ((file != null) && (file != null)) {
        return file.equals(file);
      }
      if ((state != null) && (state != null)) {
        return statesEqual(state, state);
      }
    }
    return false;
  }
  
  private boolean statesEqual(IFileState s1, IFileState s2)
  {
    return (s1.getFullPath().equals(s2.getFullPath())) && (s1.getModificationTime() == s2.getModificationTime());
  }
  
  public int hashCode()
  {
    if (file != null) {
      return file.hashCode();
    }
    if (state != null) {
      return (int)state.getModificationTime();
    }
    return super.hashCode();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.history.LocalFileRevision
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.importing;

import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.ScmUrlImportDescription;
import org.eclipse.team.core.importing.provisional.IBundleImporter;
import org.eclipse.team.core.importing.provisional.IBundleImporterDelegate;
import org.eclipse.team.internal.core.TeamPlugin;

public class BundleImporterExtension
  implements IBundleImporter
{
  private IBundleImporterDelegate delegate;
  private IConfigurationElement element;
  
  public BundleImporterExtension(IConfigurationElement element)
  {
    this.element = element;
  }
  
  public ScmUrlImportDescription[] validateImport(Map[] manifests)
  {
    try
    {
      return getDelegate().validateImport(manifests);
    }
    catch (CoreException e)
    {
      TeamPlugin.log(e);
    }
    return null;
  }
  
  private synchronized IBundleImporterDelegate getDelegate()
    throws CoreException
  {
    if (delegate == null) {
      delegate = ((IBundleImporterDelegate)element.createExecutableExtension("class"));
    }
    return delegate;
  }
  
  public IProject[] performImport(ScmUrlImportDescription[] descriptions, IProgressMonitor monitor)
    throws CoreException
  {
    return getDelegate().performImport(descriptions, monitor);
  }
  
  public String getId()
  {
    return element.getAttribute("id");
  }
  
  public String getDescription()
  {
    return element.getAttribute("description");
  }
  
  public String getName()
  {
    return element.getAttribute("name");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.importing.BundleImporterExtension
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.mapping;

import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.team.internal.core.subscribers.AbstractSynchronizationScope;

public abstract class AbstractResourceMappingScope
  extends AbstractSynchronizationScope
{
  public ResourceMapping getMapping(Object modelObject)
  {
    ResourceMapping[] mappings = getMappings();
    for (int i = 0; i < mappings.length; i++)
    {
      ResourceMapping mapping = mappings[i];
      if (mapping.getModelObject().equals(modelObject)) {
        return mapping;
      }
    }
    return null;
  }
  
  public ResourceMapping[] getMappings(String id)
  {
    Set result = new HashSet();
    ResourceMapping[] mappings = getMappings();
    for (int i = 0; i < mappings.length; i++)
    {
      ResourceMapping mapping = mappings[i];
      if (mapping.getModelProviderId().equals(id)) {
        result.add(mapping);
      }
    }
    return (ResourceMapping[])result.toArray(new ResourceMapping[result.size()]);
  }
  
  public ResourceTraversal[] getTraversals(String modelProviderId)
  {
    ResourceMapping[] mappings = getMappings(modelProviderId);
    CompoundResourceTraversal traversal = new CompoundResourceTraversal();
    for (int i = 0; i < mappings.length; i++)
    {
      ResourceMapping mapping = mappings[i];
      ResourceTraversal[] traversals = getTraversals(mapping);
      if (traversals != null) {
        traversal.addTraversals(traversals);
      }
    }
    return traversal.asTraversals();
  }
  
  public ModelProvider[] getModelProviders()
  {
    Set result = new HashSet();
    ResourceMapping[] mappings = getMappings();
    for (int i = 0; i < mappings.length; i++)
    {
      ResourceMapping mapping = mappings[i];
      ModelProvider modelProvider = mapping.getModelProvider();
      if (modelProvider != null) {
        result.add(modelProvider);
      }
    }
    return (ModelProvider[])result.toArray(new ModelProvider[result.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.mapping.AbstractResourceMappingScope
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.mapping;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.IPath;

public class CompoundResourceTraversal
{
  private Set deepFolders = new HashSet();
  private Set shallowFolders = new HashSet();
  private Set zeroFolders = new HashSet();
  private Set files = new HashSet();
  
  public synchronized void addTraversals(ResourceTraversal[] traversals)
  {
    for (int i = 0; i < traversals.length; i++)
    {
      ResourceTraversal traversal = traversals[i];
      addTraversal(traversal);
    }
  }
  
  public synchronized void addTraversal(ResourceTraversal traversal)
  {
    IResource[] resources = traversal.getResources();
    for (int i = 0; i < resources.length; i++)
    {
      IResource resource = resources[i];
      addResource(resource, traversal.getDepth());
    }
  }
  
  public synchronized void addResource(IResource resource, int depth)
  {
    if ((resource.getType() == 1) && 
      (!isCovered(resource, 0))) {
      files.add(resource);
    }
    switch (depth)
    {
    case 2: 
      addDeepFolder(resource);
      break;
    case 1: 
      addShallowFolder(resource);
      break;
    case 0: 
      addZeroFolder(resource);
    }
  }
  
  private void addShallowFolder(IResource resource)
  {
    if (!isCovered(resource, 1))
    {
      shallowFolders.add(resource);
      removeDescendants(resource, 1);
    }
  }
  
  public synchronized boolean isCovered(IResource resource, int depth)
  {
    IPath fullPath = resource.getFullPath();
    for (Iterator iter = deepFolders.iterator(); iter.hasNext();)
    {
      IResource deepFolder = (IResource)iter.next();
      if (deepFolder.getFullPath().isPrefixOf(fullPath)) {
        return true;
      }
    }
    if (resource.getType() == 1) {
      return (shallowFolders.contains(resource.getParent())) || (files.contains(resource));
    }
    switch (depth)
    {
    case 1: 
      return shallowFolders.contains(resource);
    case 0: 
      return (shallowFolders.contains(resource.getParent())) || (zeroFolders.contains(resource));
    }
    return false;
  }
  
  private void addZeroFolder(IResource resource)
  {
    if (!isCovered(resource, 0)) {
      zeroFolders.add(resource);
    }
  }
  
  private void addDeepFolder(IResource resource)
  {
    if (!isCovered(resource, 2))
    {
      deepFolders.add(resource);
      removeDescendants(resource, 2);
    }
  }
  
  private void removeDescendants(IResource resource, int depth)
  {
    IPath fullPath = resource.getFullPath();
    for (Iterator iter = files.iterator(); iter.hasNext();)
    {
      IResource child = (IResource)iter.next();
      switch (depth)
      {
      case 2: 
        if (fullPath.isPrefixOf(child.getFullPath())) {
          iter.remove();
        }
        break;
      case 1: 
        if (fullPath.equals(child.getFullPath().removeLastSegments(1))) {
          iter.remove();
        }
        break;
      }
    }
    if (depth == 2) {
      for (Iterator iter = shallowFolders.iterator(); iter.hasNext();)
      {
        IResource child = (IResource)iter.next();
        if (fullPath.isPrefixOf(child.getFullPath())) {
          iter.remove();
        }
      }
    }
    for (Iterator iter = zeroFolders.iterator(); iter.hasNext();)
    {
      IResource child = (IResource)iter.next();
      switch (depth)
      {
      case 2: 
        if (fullPath.isPrefixOf(child.getFullPath())) {
          iter.remove();
        }
        break;
      case 1: 
        if (fullPath.equals(child.getFullPath().removeLastSegments(1))) {
          iter.remove();
        }
        break;
      }
    }
  }
  
  public synchronized void add(CompoundResourceTraversal compoundTraversal)
  {
    addResources(
      (IResource[])deepFolders.toArray(new IResource[deepFolders.size()]), 
      2);
    addResources(
      (IResource[])shallowFolders.toArray(new IResource[shallowFolders.size()]), 
      1);
    addResources(
      (IResource[])zeroFolders.toArray(new IResource[zeroFolders.size()]), 
      0);
    addResources(
      (IResource[])files.toArray(new IResource[files.size()]), 
      0);
  }
  
  public synchronized void addResources(IResource[] resources, int depth)
  {
    for (int i = 0; i < resources.length; i++)
    {
      IResource resource = resources[i];
      addResource(resource, depth);
    }
  }
  
  public synchronized IResource[] getUncoveredResources(ResourceTraversal[] traversals)
  {
    CompoundResourceTraversal newTraversals = new CompoundResourceTraversal();
    newTraversals.addTraversals(traversals);
    return getUncoveredResources(newTraversals);
  }
  
  private IResource[] getUncoveredResources(CompoundResourceTraversal otherTraversal)
  {
    Set result = new HashSet();
    for (Iterator iter = files.iterator(); iter.hasNext();)
    {
      IResource resource = (IResource)iter.next();
      if (!isCovered(resource, 0)) {
        result.add(resource);
      }
    }
    for (Iterator iter = zeroFolders.iterator(); iter.hasNext();)
    {
      IResource resource = (IResource)iter.next();
      if (!isCovered(resource, 0)) {
        result.add(resource);
      }
    }
    for (Iterator iter = shallowFolders.iterator(); iter.hasNext();)
    {
      IResource resource = (IResource)iter.next();
      if (!isCovered(resource, 1)) {
        result.add(resource);
      }
    }
    for (Iterator iter = deepFolders.iterator(); iter.hasNext();)
    {
      IResource resource = (IResource)iter.next();
      if (!isCovered(resource, 2)) {
        result.add(resource);
      }
    }
    return (IResource[])result.toArray(new IResource[result.size()]);
  }
  
  public synchronized ResourceTraversal[] asTraversals()
  {
    List result = new ArrayList();
    if ((!files.isEmpty()) || (!zeroFolders.isEmpty()))
    {
      Set combined = new HashSet();
      combined.addAll(files);
      combined.addAll(zeroFolders);
      result.add(new ResourceTraversal((IResource[])combined.toArray(new IResource[combined.size()]), 0, 0));
    }
    if (!shallowFolders.isEmpty()) {
      result.add(new ResourceTraversal((IResource[])shallowFolders.toArray(new IResource[shallowFolders.size()]), 1, 0));
    }
    if (!deepFolders.isEmpty()) {
      result.add(new ResourceTraversal((IResource[])deepFolders.toArray(new IResource[deepFolders.size()]), 2, 0));
    }
    return (ResourceTraversal[])result.toArray(new ResourceTraversal[result.size()]);
  }
  
  public synchronized IResource[] getRoots()
  {
    List result = new ArrayList();
    result.addAll(files);
    result.addAll(zeroFolders);
    result.addAll(shallowFolders);
    result.addAll(deepFolders);
    return (IResource[])result.toArray(new IResource[result.size()]);
  }
  
  public synchronized ResourceTraversal[] getUncoveredTraversals(ResourceTraversal[] traversals)
  {
    CompoundResourceTraversal other = new CompoundResourceTraversal();
    other.addTraversals(traversals);
    return getUncoveredTraversals(other);
  }
  
  public ResourceTraversal[] getUncoveredTraversals(CompoundResourceTraversal otherTraversal)
  {
    synchronized (otherTraversal)
    {
      CompoundResourceTraversal uncovered = new CompoundResourceTraversal();
      for (Iterator iter = files.iterator(); iter.hasNext();)
      {
        IResource resource = (IResource)iter.next();
        if (!isCovered(resource, 0)) {
          uncovered.addResource(resource, 0);
        }
      }
      for (Iterator iter = zeroFolders.iterator(); iter.hasNext();)
      {
        IResource resource = (IResource)iter.next();
        if (!isCovered(resource, 0)) {
          uncovered.addResource(resource, 0);
        }
      }
      for (Iterator iter = shallowFolders.iterator(); iter.hasNext();)
      {
        IResource resource = (IResource)iter.next();
        if (!isCovered(resource, 1)) {
          uncovered.addResource(resource, 1);
        }
      }
      for (Iterator iter = deepFolders.iterator(); iter.hasNext();)
      {
        IResource resource = (IResource)iter.next();
        if (!isCovered(resource, 2)) {
          uncovered.addResource(resource, 2);
        }
      }
      return uncovered.asTraversals();
    }
  }
  
  public synchronized void clear()
  {
    deepFolders.clear();
    shallowFolders.clear();
    zeroFolders.clear();
    files.clear();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.mapping.CompoundResourceTraversal
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.mapping;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IDiffChangeEvent;
import org.eclipse.team.core.diff.IDiffTree;

public class DiffChangeEvent
  implements IDiffChangeEvent
{
  private final IDiffTree tree;
  private Map changedResources = new HashMap();
  private Set removedResources = new HashSet();
  private Map addedResources = new HashMap();
  private boolean reset = false;
  private List errors = new ArrayList();
  
  public DiffChangeEvent(IDiffTree tree)
  {
    this.tree = tree;
  }
  
  public IDiffTree getTree()
  {
    return tree;
  }
  
  public IDiff[] getAdditions()
  {
    return (IDiff[])addedResources.values().toArray(new IDiff[addedResources.size()]);
  }
  
  public IPath[] getRemovals()
  {
    return (IPath[])removedResources.toArray(new IPath[removedResources.size()]);
  }
  
  public IDiff[] getChanges()
  {
    return (IDiff[])changedResources.values().toArray(new IDiff[changedResources.size()]);
  }
  
  public void added(IDiff delta)
  {
    if (removedResources.contains(delta.getPath()))
    {
      removedResources.remove(delta.getPath());
      changed(delta);
    }
    else
    {
      addedResources.put(delta.getPath(), delta);
    }
  }
  
  public void removed(IPath path, IDiff delta)
  {
    if (changedResources.containsKey(path))
    {
      changedResources.remove(path);
    }
    else if (addedResources.containsKey(path))
    {
      addedResources.remove(path);
      return;
    }
    removedResources.add(path);
  }
  
  public void changed(IDiff delta)
  {
    if (addedResources.containsKey(delta.getPath()))
    {
      addedResources.put(delta.getPath(), delta);
      return;
    }
    changedResources.put(delta.getPath(), delta);
  }
  
  public void reset()
  {
    reset = true;
  }
  
  public boolean isReset()
  {
    return reset;
  }
  
  public boolean isEmpty()
  {
    return (changedResources.isEmpty()) && (removedResources.isEmpty()) && (addedResources.isEmpty());
  }
  
  public void errorOccurred(IStatus status)
  {
    errors.add(status);
  }
  
  public IStatus[] getErrors()
  {
    return (IStatus[])errors.toArray(new IStatus[errors.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.mapping.DiffChangeEvent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.mapping;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ProgressMonitorWrapper;

public class GroupProgressMonitor
  extends ProgressMonitorWrapper
  implements IProgressMonitor
{
  private final IProgressMonitor group;
  private final int ticks;
  
  public GroupProgressMonitor(IProgressMonitor monitor, IProgressMonitor group, int groupTicks)
  {
    super(monitor);
    this.group = group;
    ticks = groupTicks;
  }
  
  public IProgressMonitor getGroup()
  {
    return group;
  }
  
  public int getTicks()
  {
    return ticks;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.mapping.GroupProgressMonitor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.core.mapping;

import org.eclipse.core.resources.IStorage;
import org.eclipse.team.core.mapping.IStorageMerger;

public abstract interface IStreamMergerDelegate
{
  public abstract IStorageMerger findMerger(IStorage paramIStorage);
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.core.mapping.IStreamMergerDelegate
 * Java Class Versi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd