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

ng extensionId = configElements[j].getAttribute("id");
          if ((extensionId != null) && (extensionId.equals(id)))
          {
            try
            {
              RepositoryProviderType providerType;
              RepositoryProviderType providerType;
              if (configElements[j].getAttribute("typeClass") == null) {
                providerType = new DefaultRepositoryProviderType();
              } else {
                providerType = (RepositoryProviderType)configElements[j].createExecutableExtension("typeClass");
              }
              providerType.setID(id);
              allProviderTypes.put(id, providerType);
              String scheme = configElements[j].getAttribute("fileSystemScheme");
              providerType.setFileSystemScheme(scheme);
              return providerType;
            }
            catch (CoreException e)
            {
              TeamPlugin.log(e);
            }
            catch (ClassCastException e)
            {
              String className = configElements[j].getAttribute("typeClass");
              TeamPlugin.log(4, "Class " + className + " registered for repository provider type id " + id + " is not a subclass of RepositoryProviderType", e);
            }
            return null;
          }
        }
      }
    }
    return null;
  }
  
  private void setFileSystemScheme(String scheme)
  {
    this.scheme = scheme;
  }
  
  public final String getID()
  {
    return id;
  }
  
  public ProjectSetCapability getProjectSetCapability()
  {
    IProjectSetSerializer oldSerializer = Team.getProjectSetSerializer(getID());
    if (oldSerializer != null)
    {
      ProjectSetCapability capability = new DefaultProjectSetCapability();
      capability.setSerializer(oldSerializer);
      return capability;
    }
    return null;
  }
  
  public void metaFilesDetected(IProject project, IContainer[] containers) {}
  
  public Subscriber getSubscriber()
  {
    return null;
  }
  
  public final String getFileSystemScheme()
  {
    return scheme;
  }
}

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

import java.net.URI;
import java.util.HashMap;

public class ScmUrlImportDescription
{
  private String url;
  private String project;
  private HashMap properties;
  
  public ScmUrlImportDescription(String url, String project)
  {
    this.url = url;
    this.project = project;
  }
  
  public String getProject()
  {
    return project;
  }
  
  public String getUrl()
  {
    return url;
  }
  
  public URI getUri()
  {
    return URI.create(url.replaceAll("\"", ""));
  }
  
  public void setUrl(String url)
  {
    this.url = url;
  }
  
  public synchronized void setProperty(String key, Object value)
  {
    if (properties == null) {
      properties = new HashMap();
    }
    if (value == null) {
      properties.remove(key);
    } else {
      properties.put(key, value);
    }
  }
  
  public synchronized Object getProperty(String key)
  {
    if (properties == null) {
      return null;
    }
    return properties.get(key);
  }
}

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

class Team$1
  implements IIgnoreInfo
{
  private String p;
  private boolean e1;
  
  Team$1(String paramString, boolean paramBoolean)
  {
    p = paramString;
    e1 = paramBoolean;
  }
  
  public String getPattern()
  {
    return p;
  }
  
  public boolean getEnabled()
  {
    return e1;
  }
}

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

import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;

class Team$2
  implements Preferences.IPropertyChangeListener
{
  public void propertyChange(Preferences.PropertyChangeEvent event)
  {
    if (event.getProperty().equals("ignore_files")) {
      Team.globalIgnore = null;
    }
  }
}

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

class Team$StringMappingWrapper
  implements IFileTypeInfo
{
  private final IStringMapping fMapping;
  
  public Team$StringMappingWrapper(IStringMapping mapping)
  {
    fMapping = mapping;
  }
  
  public String getExtension()
  {
    return fMapping.getString();
  }
  
  public int getType()
  {
    return fMapping.getType();
  }
}

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

import java.io.DataInputStream;
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedMap;
import java.util.StringTokenizer;
import java.util.TreeMap;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.importing.provisional.IBundleImporter;
import org.eclipse.team.core.mapping.IStorageMerger;
import org.eclipse.team.internal.core.FileContentManager;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.StorageMergerRegistry;
import org.eclipse.team.internal.core.StringMatcher;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.core.TeamResourceChangeListener;
import org.eclipse.team.internal.core.importing.BundleImporterExtension;

public final class Team
{
  private static final String PREF_TEAM_IGNORES = "ignore_files";
  private static final String PREF_TEAM_SEPARATOR = "\n";
  
  private static class StringMappingWrapper
    implements IFileTypeInfo
  {
    private final IStringMapping fMapping;
    
    public StringMappingWrapper(IStringMapping mapping)
    {
      fMapping = mapping;
    }
    
    public String getExtension()
    {
      return fMapping.getString();
    }
    
    public int getType()
    {
      return fMapping.getType();
    }
  }
  
  public static final Status OK_STATUS = new Status(0, "org.eclipse.team.core", 0, Messages.ok, null);
  public static final int UNKNOWN = 0;
  public static final int TEXT = 1;
  public static final int BINARY = 2;
  protected static SortedMap globalIgnore;
  protected static SortedMap pluginIgnore;
  private static StringMatcher[] ignoreMatchers;
  private static final FileContentManager fFileContentManager = new FileContentManager();
  private static List fBundleImporters;
  
  /**
   * @deprecated
   */
  public static int getType(IStorage storage)
  {
    return fFileContentManager.getType(storage);
  }
  
  public static boolean isIgnoredHint(IResource resource)
  {
    if (resource.isDerived()) {
      return true;
    }
    return matchesEnabledIgnore(resource);
  }
  
  /**
   * @deprecated
   */
  public static boolean isIgnoredHint(IFile file)
  {
    if (file.isDerived()) {
      return true;
    }
    return matchesEnabledIgnore(file);
  }
  
  private static boolean matchesEnabledIgnore(IResource resource)
  {
    StringMatcher[] matchers = getStringMatchers();
    for (int i = 0; i < matchers.length; i++)
    {
      String resourceName = resource.getName();
      if (matchers[i].isPathPattern()) {
        resourceName = resource.getFullPath().toString();
      }
      if (matchers[i].match(resourceName)) {
        return true;
      }
    }
    return false;
  }
  
  /**
   * @deprecated
   */
  public static boolean isIgnored(IFile file)
  {
    return matchesEnabledIgnore(file);
  }
  
  /**
   * @deprecated
   */
  public static IFileTypeInfo[] getAllTypes()
  {
    IStringMapping[] mappings = fFileContentManager.getExtensionMappings();
    IFileTypeInfo[] infos = new IFileTypeInfo[mappings.length];
    for (int i = 0; i < infos.length; i++) {
      infos[i] = new StringMappingWrapper(mappings[i]);
    }
    return infos;
  }
  
  public static synchronized IIgnoreInfo[] getAllIgnores()
  {
    initializeIgnores();
    IIgnoreInfo[] result = getIgnoreInfo(globalIgnore);
    return result;
  }
  
  private static void initializeIgnores()
  {
    if (globalIgnore == null)
    {
      globalIgnore = new TreeMap();
      pluginIgnore = new TreeMap();
      ignoreMatchers = null;
      try
      {
        readIgnoreState();
      }
      catch (TeamException e)
      {
        TeamPlugin.log(4, Messages.Team_Error_loading_ignore_state_from_disk_1, e);
      }
      initializePluginIgnores(pluginIgnore, globalIgnore);
    }
  }
  
  private static IIgnoreInfo[] getIgnoreInfo(Map gIgnore)
  {
    IIgnoreInfo[] result = new IIgnoreInfo[gIgnore.size()];
    Iterator e = gIgnore.entrySet().iterator();
    int i = 0;
    while (e.hasNext())
    {
      Map.Entry entry = (Map.Entry)e.next();
      String pattern = (String)entry.getKey();
      boolean enabled = ((Boolean)entry.getValue()).booleanValue();
      result[(i++) = new IIgnoreInfo()
      {
        private boolean e1;
        
        public String getPattern()
        {
          return Team.this;
        }
        
        public boolean getEnabled()
        {
          return e1;
        }
      };
    }
    return result;
  }
  
  private static synchronized StringMatcher[] getStringMatchers()
  {
    if (ignoreMatchers == null)
    {
      IIgnoreInfo[] ignorePatterns = getAllIgnores();
      ArrayList matchers = new ArrayList(ignorePatterns.length);
      for (int i = 0; i < ignorePatterns.length; i++) {
        if (ignorePatterns[i].getEnabled()) {
          matchers.add(new StringMatcher(ignorePatterns[i].getPattern(), true, false));
        }
      }
      ignoreMatchers = new StringMatcher[matchers.size()];
      ignoreMatchers = (StringMatcher[])matchers.toArray(ignoreMatchers);
    }
    return ignoreMatchers;
  }
  
  /**
   * @deprecated
   */
  public static void setAllTypes(String[] extensions, int[] types)
  {
    fFileContentManager.addExtensionMappings(extensions, types);
  }
  
  public static void setAllIgnores(String[] patterns, boolean[] enabled)
  {
    initializeIgnores();
    globalIgnore = new TreeMap();
    ignoreMatchers = null;
    for (int i = 0; i < patterns.length; i++) {
      globalIgnore.put(patterns[i], Boolean.valueOf(enabled[i]));
    }
    StringBuffer buf = new StringBuffer();
    Iterator e = globalIgnore.entrySet().iterator();
    while (e.hasNext())
    {
      Map.Entry entry = (Map.Entry)e.next();
      String pattern = (String)entry.getKey();
      Boolean value = (Boolean)entry.getValue();
      boolean isCustom = (!pluginIgnore.containsKey(pattern)) || 
        (!((Boolean)pluginIgnore.get(pattern)).equals(value));
      if (isCustom)
      {
        buf.append(pattern);
        buf.append("\n");
        boolean en = value.booleanValue();
        buf.append(en);
        buf.append("\n");
      }
    }
    TeamPlugin.getPlugin().getPluginPreferences().setValue("ignore_files", buf.toString());
  }
  
  private static void initializePluginIgnores(SortedMap pIgnore, SortedMap gIgnore)
  {
    TeamPlugin plugin = TeamPlugin.getPlugin();
    if (plugin != null)
    {
      IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", "ignore");
      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 pattern = configElements[j].getAttribute("pattern");
            if (pattern != null)
            {
              String selected = configElements[j].getAttribute("enabled");
              if (selected == null) {
                selected = configElements[j].getAttribute("selected");
              }
              boolean enabled = (selected != null) && 
                (selected.equalsIgnoreCase("true"));
              if (!pIgnore.containsKey(pattern))
              {
                pIgnore.put(pattern, Boolean.valueOf(enabled));
              }
              else if (!Boolean.valueOf(enabled).equals(
                pIgnore.get(pattern)))
              {
                if (TeamPlugin.getPlugin().isDebugging()) {
                  TeamPlugin.log(2, 
                    NLS.bind(
                    Messages.Team_Conflict_occured_for_ignored_resources_pattern, 
                    new Object[] {
                    pattern, 
                    collectContributingExtentionsToDisplay(
                    pattern, 
                    extensions) }), 
                    null);
                }
                if (!enabled) {
                  pIgnore.put(pattern, 
                    Boolean.FALSE);
                }
              }
            }
          }
        }
        Iterator it = pIgnore.keySet().iterator();
        while (it.hasNext())
        {
          Object pattern = it.next();
          if (!gIgnore.containsKey(pattern)) {
            gIgnore.put(pattern, pIgnore.get(pattern));
          }
        }
      }
    }
  }
  
  private static String collectContributingExtentionsToDisplay(String patternToFind, IExtension[] extensions)
  {
    StringBuffer sb = new StringBuffer();
    boolean isFirst = true;
    for (int i = 0; i < extensions.length; i++)
    {
      IConfigurationElement[] configElements = extensions[i]
        .getConfigurationElements();
      for (int j = 0; j < configElements.length; j++) {
        if (patternToFind.equals(configElements[j]
          .getAttribute("pattern")))
        {
          if (!isFirst) {
            sb.append(", ");
          }
          isFirst = false;
          sb.append(extensions[i].getContributor().getName());
        }
      }
    }
    return sb.toString();
  }
  
  private static void readIgnoreState()
    throws TeamException
  {
    if (readBackwardCompatibleIgnoreState()) {
      return;
    }
    Preferences pref = TeamPlugin.getPlugin().getPluginPreferences();
    if (!pref.contains("ignore_files")) {
      return;
    }
    pref.addPropertyChangeListener(new Preferences.IPropertyChangeListener()
    {
      public void propertyChange(Preferences.PropertyChangeEvent event)
      {
        if (event.getProperty().equals("ignore_files")) {
          Team.globalIgnore = null;
        }
      }
    });
    String prefIgnores = pref.getString("ignore_files");
    StringTokenizer tok = new StringTokenizer(prefIgnores, "\n");
    try
    {
      for (;;)
      {
        String pattern = tok.nextToken();
        if (pattern.length() == 0) {
          return;
        }
        String enabled = tok.nextToken();
        globalIgnore.put(pattern, Boolean.valueOf(enabled));
      }
      return;
    }
    catch (NoSuchElementException localNoSuchElementException) {}
  }
  
  private static boolean readBackwardCompatibleIgnoreState()
    throws TeamException
  {
    String GLOBALIGNORE_FILE = ".globalIgnores";
    IPath pluginStateLocation = TeamPlugin.getPlugin().getStateLocation().append(GLOBALIGNORE_FILE);
    File f = pluginStateLocation.toFile();
    if (!f.exists()) {
      return false;
    }
    try
    {
      DataInputStream dis = new DataInputStream(new FileInputStream(f));
      try
      {
        int ignoreCount = 0;
        try
        {
          ignoreCount = dis.readInt();
        }
        catch (EOFException localEOFException)
        {
          return false;
        }
        for (int i = 0; i < ignoreCount; i++)
        {
          String pattern = dis.readUTF();
          boolean enabled = dis.readBoolean();
          globalIgnore.put(pattern, Boolean.valueOf(enabled));
        }
      }
      finally
      {
        dis.close();
      }
      dis.close();
      
      f.delete();
    }
    catch (FileNotFoundException localFileNotFoundException) {}catch (IOException ex)
    {
      throw new TeamException(new Status(4, "org.eclipse.team.core", 0, Messages.Team_readError, ex));
    }
    return true;
  }
  
  public static void startup()
  {
    ResourcesPlugin.getWorkspace().addResourceChangeListener(new TeamResourceChangeListener(), 1);
  }
  
  public static void shutdown()
  {
    TeamPlugin.getPlugin().savePluginPreferences();
  }
  
  /**
   * @deprecated
   */
  public static IProjectSetSerializer getProjectSetSerializer(String id)
  {
    TeamPlugin plugin = TeamPlugin.getPlugin();
    if (plugin != null)
    {
      IExtensionPoint extension = RegistryFactory.getRegistry().getExtensionPoint("org.eclipse.team.core", "projectSets");
      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");
            if ((extensionId != null) && (extensionId.equals(id))) {
              try
              {
                return (IProjectSetSerializer)configElements[j].createExecutableExtension("class");
              }
              catch (CoreException e)
              {
                TeamPlugin.log(e);
                return null;
              }
            }
          }
        }
      }
    }
    return null;
  }
  
  public static IIgnoreInfo[] getDefaultIgnores()
  {
    SortedMap gIgnore = new TreeMap();
    SortedMap pIgnore = new TreeMap();
    initializePluginIgnores(pIgnore, gIgnore);
    return getIgnoreInfo(gIgnore);
  }
  
  /**
   * @deprecated
   */
  public static IFileTypeInfo[] getDefaultTypes()
  {
    return asFileTypeInfo(getFileContentManager().getDefaultExtensionMappings());
  }
  
  private static IFileTypeInfo[] asFileTypeInfo(IStringMapping[] mappings)
  {
    IFileTypeInfo[] infos = new IFileTypeInfo[mappings.length];
    for (int i = 0; i < infos.length; i++) {
      infos[i] = new StringMappingWrapper(mappings[i]);
    }
    return infos;
  }
  
  public static IFileContentManager getFileContentManager()
  {
    return fFileContentManager;
  }
  
  public static IStorageMerger createMerger(IContentType type)
  {
    return StorageMergerRegistry.getInstance().createStreamMerger(type);
  }
  
  public static IStorageMerger createMerger(String extension)
  {
    return StorageMergerRegistry.getInstance().createStreamMerger(extension);
  }
  
  /**
   * @deprecated
   */
  public IStorageMerger createStorageMerger(IContentType type)
  {
    return createMerger(type);
  }
  
  /**
   * @deprecated
   */
  public IStorageMerger createStorageMerger(String extension)
  {
    return createMerger(extension);
  }
  
  public static synchronized IBundleImporter[] getBundleImporters()
  {
    if (fBundleImporters == null)
    {
      fBundleImporters = new ArrayList();
      IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core.bundleImporters");
      if (point != null)
      {
        IConfigurationElement[] infos = point.getConfigurationElements();
        for (int i = 0; i < infos.length; i++) {
          fBundleImporters.add(new BundleImporterExtension(infos[i]));
        }
      }
    }
    return (IBundleImporter[])fBundleImporters.toArray(new IBundleImporter[fBundleImporters.size()]);
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

public class TeamException
  extends CoreException
{
  private static final long serialVersionUID = 1L;
  public static final int OK = 0;
  public static final int NOT_CHECKED_IN = -1;
  public static final int NOT_CHECKED_OUT = -2;
  public static final int NO_REMOTE_RESOURCE = -3;
  public static final int IO_FAILED = -4;
  public static final int NOT_AUTHORIZED = -5;
  public static final int UNABLE = -6;
  public static final int CONFLICT = -7;
  
  public TeamException(IStatus status)
  {
    super(status);
  }
  
  public TeamException(String message, Throwable e)
  {
    super(new Status(4, "org.eclipse.team.core", 0, message, e));
  }
  
  public TeamException(String message)
  {
    this(message, null);
  }
  
  protected TeamException(CoreException e)
  {
    super(asStatus(e));
  }
  
  private static Status asStatus(CoreException e)
  {
    IStatus status = e.getStatus();
    return new Status(status.getSeverity(), status.getPlugin(), status.getCode(), status.getMessage(), e);
  }
  
  public static TeamException asTeamException(CoreException e)
  {
    if ((e instanceof TeamException)) {
      return (TeamException)e;
    }
    return new TeamException(e);
  }
  
  public static TeamException asTeamException(InvocationTargetException e)
  {
    Throwable target = e.getTargetException();
    if ((target instanceof TeamException)) {
      return (TeamException)target;
    }
    return new TeamException(new Status(4, "org.eclipse.team.core", -6, target.getMessage() != null ? target.getMessage() : "", target));
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Status;

public class TeamStatus
  extends Status
  implements ITeamStatus
{
  private IResource resource;
  
  public TeamStatus(int severity, String pluginId, int code, String message, Throwable exception, IResource resource)
  {
    super(severity, pluginId, code, message, exception);
    if (resource == null) {
      this.resource = ResourcesPlugin.getWorkspace().getRoot();
    } else {
      this.resource = resource;
    }
  }
  
  public IResource getResource()
  {
    return resource;
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;

public abstract class DiffFilter
{
  public abstract boolean select(IDiff paramIDiff, IProgressMonitor paramIProgressMonitor);
}

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

import org.eclipse.team.core.diff.provider.Diff;

class FastDiffFilter$1
  extends FastDiffFilter
{
  private final int[] val$states;
  private final int val$mask;
  
  FastDiffFilter$1(int[] paramArrayOfInt, int paramInt)
  {
    val$states = paramArrayOfInt;val$mask = paramInt;
  }
  
  public boolean select(IDiff node)
  {
    int status = ((Diff)node).getStatus();
    for (int i = 0; i < val$states.length; i++)
    {
      int state = val$states[i];
      if ((status & val$mask) == state) {
        return true;
      }
    }
    return false;
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.diff.provider.Diff;

public abstract class FastDiffFilter
  extends DiffFilter
{
  public static final FastDiffFilter getStateFilter(int[] states, int mask)
  {
    new FastDiffFilter()
    {
      private final int val$mask;
      
      public boolean select(IDiff node)
      {
        int status = ((Diff)node).getStatus();
        for (int i = 0; i < FastDiffFilter.this.length; i++)
        {
          int state = FastDiffFilter.this[i];
          if ((status & val$mask) == state) {
            return true;
          }
        }
        return false;
      }
    };
  }
  
  public final boolean select(IDiff diff, IProgressMonitor monitor)
  {
    return select(diff);
  }
  
  public abstract boolean select(IDiff paramIDiff);
}

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

import org.eclipse.core.runtime.IPath;

public abstract interface IDiff
{
  public static final int NO_CHANGE = 0;
  public static final int ADD = 1;
  public static final int REMOVE = 2;
  public static final int CHANGE = 4;
  
  public abstract IPath getPath();
  
  public abstract int getKind();
  
  public abstract String toDiffString();
}

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

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;

public abstract interface IDiffChangeEvent
{
  public abstract IDiffTree getTree();
  
  public abstract IDiff[] getAdditions();
  
  public abstract IPath[] getRemovals();
  
  public abstract IDiff[] getChanges();
  
  public abstract IStatus[] getErrors();
}

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

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

public abstract interface IDiffChangeListener
{
  public abstract void diffsChanged(IDiffChangeEvent paramIDiffChangeEvent, IProgressMonitor paramIProgressMonitor);
  
  public abstract void propertyChanged(IDiffTree paramIDiffTree, int paramInt, IPath[] paramArrayOfIPath);
}

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

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

public abstract interface IDiffTree
{
  public static final int P_BUSY_HINT = 1;
  public static final int P_HAS_DESCENDANT_CONFLICTS = 2;
  
  public abstract void addDiffChangeListener(IDiffChangeListener paramIDiffChangeListener);
  
  public abstract void removeDiffChangeListener(IDiffChangeListener paramIDiffChangeListener);
  
  public abstract void accept(IPath paramIPath, IDiffVisitor paramIDiffVisitor, int paramInt);
  
  public abstract IDiff getDiff(IPath paramIPath);
  
  public abstract IPath[] getChildren(IPath paramIPath);
  
  public abstract int size();
  
  public abstract boolean isEmpty();
  
  public abstract long countFor(int paramInt1, int paramInt2);
  
  public abstract void setBusy(IDiff[] paramArrayOfIDiff, IProgressMonitor paramIProgressMonitor);
  
  public abstract boolean getProperty(IPath paramIPath, int paramInt);
  
  public abstract void clearBusy(IProgressMonitor paramIProgressMonitor);
  
  public abstract boolean hasMatchingDiffs(IPath paramIPath, FastDiffFilter paramFastDiffFilter);
}

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

public abstract interface IDiffVisitor
{
  public abstract boolean visit(IDiff paramIDiff);
}

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

public abstract interface IThreeWayDiff
  extends IDiff
{
  public static final int OUTGOING = 256;
  public static final int INCOMING = 512;
  public static final int CONFLICTING = 768;
  public static final int DIRECTION_MASK = 768;
  
  public abstract ITwoWayDiff getLocalChange();
  
  public abstract ITwoWayDiff getRemoteChange();
  
  public abstract int getDirection();
}

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

import org.eclipse.core.runtime.IPath;

public abstract interface ITwoWayDiff
  extends IDiff
{
  public static final int CONTENT = 256;
  public static final int MOVE_FROM = 512;
  public static final int MOVE_TO = 1024;
  public static final int COPY_FROM = 2048;
  public static final int REPLACE = 4096;
  
  public abstract int getFlags();
  
  public abstract IPath getFromPath();
  
  public abstract IPath getToPath();
}

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

import org.eclipse.core.runtime.IPath;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.internal.core.mapping.SyncInfoToDiffConverter;

public abstract class Diff
  implements IDiff
{
  public static final int KIND_MASK = 255;
  private final IPath path;
  private final int status;
  
  protected Diff(IPath path, int status)
  {
    this.path = path;
    this.status = status;
  }
  
  public IPath getPath()
  {
    return path;
  }
  
  public int getKind()
  {
    return getStatus() & 0xFF;
  }
  
  public final int getStatus()
  {
    return status;
  }
  
  public String toDiffString()
  {
    int kind = getKind();
    String label = SyncInfoToDiffConverter.diffKindToString(kind);
    return label;
  }
  
  public int hashCode()
  {
    return getPath().hashCode();
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if ((obj instanceof Diff))
    {
      Diff other = (Diff)obj;
      return (other.getPath().equals(getPath())) && (getStatus() == other.getStatus());
    }
    return false;
  }
}

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

import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.core.diff.IDiffChangeListener;
import org.eclipse.team.internal.core.mapping.DiffChangeEvent;

class DiffTree$1
  implements ISafeRunnable
{
  final DiffTree this$0;
  private final DiffChangeEvent val$event;
  private final IDiffChangeListener val$listener;
  private final IProgressMonitor val$monitor;
  private final Map val$propertyChanges;
  
  DiffTree$1(DiffTree paramDiffTree, DiffChangeEvent paramDiffChangeEvent, IDiffChangeListener paramIDiffChangeListener, IProgressMonitor paramIProgressMonitor, Map paramMap)
  {
    this$0 = paramDiffTree;val$event = paramDiffChangeEvent;val$listener = paramIDiffChangeListener;val$monitor = paramIProgressMonitor;val$propertyChanges = paramMap;
  }
  
  public void handleException(Throwable exception) {}
  
  /* Error */
  public void run()
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 104	org/eclipse/team/core/diff/provider/DiffTree$1:this$0	Lorg/eclipse/team/core/diff/provider/DiffTree;
    //   4: iconst_1
    //   5: invokestatic 108	org/eclipse/team/core/diff/provider/DiffTree:access$0	(Lorg/eclipse/team/core/diff/provider/DiffTree;Z)V
    //   8: aload_0
    //   9: getfield 105	org/eclipse/team/core/diff/provider/DiffTree$1:val$event	Lorg/eclipse/team/internal/core/mapping/DiffChangeEvent;
    //   12: invokevirtual 110	org/eclipse/team/internal/core/mapping/DiffChangeEvent:isEmpty	()Z
    //   15: ifeq +13 -> 28
    //   18: aload_0
    //   19: getfield 105	org/eclipse/team/core/diff/provider/DiffTree$1:val$event	Lorg/eclipse/team/internal/core/mapping/DiffChangeEvent;
    //   22: invokevirtual 111	org/eclipse/team/internal/core/mapping/DiffChangeEvent:isReset	()Z
    //   25: ifeq +25 -> 50
    //   28: aload_0
    //   29: getfield 103	org/eclipse/team/core/diff/provider/DiffTree$1:val$listener	Lorg/eclipse/team/core/diff/IDiffChangeListener;
    //   32: aload_0
    //   33: getfield 105	org/eclipse/team/core/diff/provider/DiffTree$1:val$event	Lorg/eclipse/team/internal/core/mapping/DiffChangeEvent;
    //   36: aload_0
    //   37: getfield 102	org/eclipse/team/core/diff/provider/DiffTree$1:val$monitor	Lorg/eclipse/core/runtime/IProgressMonitor;
    //   40: bipush 100
    //   42: invokestatic 109	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   45: invokeinterface 120 3 0
    //   50: aload_0
    //   51: getfield 101	org/eclipse/team/core/diff/provider/DiffTree$1:val$propertyChanges	Ljava/util/Map;
    //   54: invokeinterface 114 1 0
    //   59: invokeinterface 117 1 0
    //   64: astore_1
    //   65: goto +62 -> 127
    //   68: aload_1
    //   69: invokeinterface 113 1 0
    //   74: checkcast 48	java/lang/Integer
    //   77: astore_2
    //   78: aload_0
    //   79: getfield 101	org/eclipse/team/core/diff/provider/DiffTree$1:val$propertyChanges	Ljava/util/Map;
    //   82: aload_2
    //   83: invokeinterface 115 2 0
    //   88: checkcast 52	java/util/Set
    //   91: astore_3
    //   92: aload_0
    //   93: getfield 103	org/eclipse/team/core/diff/provider/DiffTree$1:val$listener	Lorg/eclipse/team/core/diff/IDiffChangeListener;
    //   96: aload_0
    //   97: getfield 104	org/eclipse/team/core/diff/provider/DiffTree$1:this$0	Lorg/eclipse/team/core/diff/provider/DiffTree;
    //   100: aload_2
    //   101: invokevirtual 106	java/lang/Integer:intValue	()I
    //   104: aload_3
    //   105: aload_3
    //   106: invokeinterface 116 1 0
    //   111: anewarray 53	org/eclipse/core/runtime/IPath
    //   114: invokeinterface 118 2 0
    //   119: checkcast 46	[Lorg/eclipse/core/runtime/IPath;
    //   122: invokeinterface 119 4 0
    //   127: aload_1
    //   128: invokeinterface 112 1 0
    //   133: ifne -65 -> 68
    //   136: goto +16 -> 152
    //   139: astore 4
    //   141: aload_0
    //   142: getfield 104	org/eclipse/team/core/diff/provider/DiffTree$1:this$0	Lorg/eclipse/team/core/diff/provider/DiffTree;
    //   145: iconst_0
    //   146: invokestatic 108	org/eclipse/team/core/diff/provider/DiffTree:access$0	(Lorg/eclipse/team/core/diff/provider/DiffTree;Z)V
    //   149: aload 4
    //   151: athrow
    //   152: aload_0
    //   153: getfield 104	org/eclipse/team/core/diff/provider/DiffTree$1:this$0	Lorg/eclipse/team/core/diff/provider/DiffTree;
    //   156: iconst_0
    //   157: invokestatic 108	org/eclipse/team/core/diff/provider/DiffTree:access$0	(Lorg/eclipse/team/core/diff/provider/DiffTree;Z)V
    //   160: return
    // Line number table:
    //   Java source line #245	-> byte code offset #0
    //   Java source line #246	-> byte code offset #8
    //   Java source line #247	-> byte code offset #28
    //   Java source line #248	-> byte code offset #50
    //   Java source line #249	-> byte code offset #68
    //   Java source line #250	-> byte code offset #78
    //   Java source line #251	-> byte code offset #92
    //   Java source line #252	-> byte code offset #106
    //   Java source line #251	-> byte code offset #114
    //   Java source line #248	-> byte code offset #127
    //   Java source line #255	-> byte code offset #139
    //   Java source line #256	-> byte code offset #141
    //   Java source line #257	-> byte code offset #149
    //   Java source line #256	-> byte code offset #152
    //   Java source line #258	-> byte code offset #160
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	161	0	this	1
    //   64	64	1	iter	java.util.Iterator
    //   77	24	2	key	Integer
    //   91	15	3	paths	java.util.Set
    //   139	11	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	139	139	finally
  }
}

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

import org.eclipse.team.core.diff.FastDiffFilter;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IDiffVisitor;

class DiffTree$2
  implements IDiffVisitor
{
  final DiffTree this$0;
  private final FastDiffFilter val$filter;
  private final RuntimeException val$found;
  
  DiffTree$2(DiffTree paramDiffTree, FastDiffFilter paramFastDiffFilter, RuntimeException paramRuntimeException)
  {
    this$0 = paramDiffTree;val$filter = paramFastDiffFilter;val$found = paramRuntimeException;
  }
  
  public boolean visit(IDiff delta)
  {
    if (val$filter.select(delta)) {
      throw val$found;
    }
    return false;
  }
}

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

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.diff.FastDiffFilter;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IDiffChangeListener;
import org.eclipse.team.core.diff.IDiffTree;
import org.eclipse.team.core.diff.IDiffVisitor;
import org.eclipse.team.core.diff.IThreeWayDiff;
import org.eclipse.team.internal.core.mapping.DiffChangeEvent;
import org.eclipse.team.internal.core.mapping.PathTree;
import org.eclipse.team.internal.core.subscribers.DiffTreeStatistics;

public class DiffTree
  implements IDiffTree
{
  public static final int START_CLIENT_PROPERTY_RANGE = 1024;
  private ListenerList listeners = new ListenerList();
  private PathTree pathTree = new PathTree();
  private ILock lock = Job.getJobManager().newLock();
  private DiffTreeStatistics statistics = new DiffTreeStatistics();
  private DiffChangeEvent changes;
  private boolean lockedForModification;
  private Map propertyChanges = new HashMap();
  
  public DiffTree()
  {
    resetChanges();
  }
  
  public void addDiffChangeListener(IDiffChangeListener listener)
  {
    listeners.add(listener);
  }
  
  public void removeDiffChangeListener(IDiffChangeListener listener)
  {
    listeners.remov
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-2019. Infinite Loop Ltd