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

ializationContext;
import org.eclipse.team.core.RepositoryProviderType;
import org.eclipse.team.core.ScmUrlImportDescription;
import org.eclipse.team.internal.core.TeamPlugin;
import org.osgi.framework.BundleException;

public abstract class BundleImporterDelegate
  implements IBundleImporterDelegate
{
  private static final String ATTR_PROJECT = "project";
  public static final String ECLIPSE_SOURCE_REFERENCES = "Eclipse-SourceReferences";
  
  protected abstract Set getSupportedValues();
  
  protected abstract RepositoryProviderType getProviderType();
  
  public ScmUrlImportDescription[] validateImport(Map[] manifests)
  {
    ScmUrlImportDescription[] results = new ScmUrlImportDescription[manifests.length];
    if (getProviderType() != null) {
      for (int i = 0; i < manifests.length; i++)
      {
        Map manifest = manifests[i];
        String value = (String)manifest.get("Eclipse-SourceReferences");
        if ((value != null) && (value.length() > 8))
        {
          String prefix = value.substring(0, 8);
          if (getSupportedValues().contains(prefix)) {
            try
            {
              ManifestElement[] elements = ManifestElement.parseHeader("Eclipse-SourceReferences", value);
              for (int j = 0; j < elements.length; j++)
              {
                ManifestElement element = elements[j];
                String url = element.toString();
                String project = element.getAttribute("project");
                if (project == null)
                {
                  String bsn = (String)manifests[i].get("Bundle-SymbolicName");
                  if (bsn != null)
                  {
                    ManifestElement[] bsnElement = ManifestElement.parseHeader("Bundle-SymbolicName", bsn);
                    project = bsnElement[0].getValue();
                  }
                }
                results[i] = new ScmUrlImportDescription(url, project);
              }
            }
            catch (BundleException e)
            {
              TeamPlugin.log(4, "An exception occured while parsing a manifest header", e);
            }
          }
        }
      }
    }
    return results;
  }
  
  public IProject[] performImport(ScmUrlImportDescription[] descriptions, IProgressMonitor monitor)
    throws CoreException
  {
    List references = new ArrayList();
    ProjectSetCapability psfCapability = getProviderType().getProjectSetCapability();
    IProject[] result = (IProject[])null;
    if (psfCapability != null)
    {
      for (int i = 0; i < descriptions.length; i++)
      {
        ScmUrlImportDescription description = descriptions[i];
        references.add(psfCapability.asReference(description.getUri(), description.getProject()));
      }
      if (!references.isEmpty())
      {
        SubMonitor subMonitor = SubMonitor.convert(monitor, references.size());
        result = psfCapability.addToWorkspace((String[])references.toArray(new String[references.size()]), new ProjectSetSerializationContext(), subMonitor);
        subMonitor.done();
      }
    }
    return result;
  }
}

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

public abstract interface IBundleImporter
  extends IBundleImporterDelegate
{
  public abstract String getId();
  
  public abstract String getDescription();
  
  public abstract String getName();
}

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

import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.ScmUrlImportDescription;

public abstract interface IBundleImporterDelegate
{
  public abstract ScmUrlImportDescription[] validateImport(Map[] paramArrayOfMap);
  
  public abstract IProject[] performImport(ScmUrlImportDescription[] paramArrayOfScmUrlImportDescription, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
}

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

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

class ChangeTracker$1
  implements IResourceDeltaVisitor
{
  final ChangeTracker this$0;
  private final List val$result;
  
  ChangeTracker$1(ChangeTracker paramChangeTracker, List paramList)
  {
    this$0 = paramChangeTracker;val$result = paramList;
  }
  
  public boolean visit(IResourceDelta delta)
    throws CoreException
  {
    if ((this$0.isResourceOfInterest(delta.getResource()) & this$0.isChangeOfInterest(delta))) {
      val$result.add(delta.getResource());
    }
    return true;
  }
}

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

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.team.core.RepositoryProvider;
import org.eclipse.team.internal.core.IRepositoryProviderListener;

class ChangeTracker$ChangeListener
  implements IResourceChangeListener, IRepositoryProviderListener
{
  final ChangeTracker this$0;
  
  private ChangeTracker$ChangeListener(ChangeTracker paramChangeTracker)
  {
    this$0 = paramChangeTracker;
  }
  
  ChangeTracker$ChangeListener(ChangeTracker paramChangeTracker, ChangeListener paramChangeListener)
  {
    this(paramChangeTracker);
  }
  
  public void resourceChanged(IResourceChangeEvent event)
  {
    if (ChangeTracker.access$0(this$0)) {
      return;
    }
    IResourceDelta delta = event.getDelta();
    IResourceDelta[] projectDeltas = delta.getAffectedChildren(7);
    for (int i = 0; i < projectDeltas.length; i++)
    {
      IResourceDelta projectDelta = projectDeltas[i];
      IResource resource = projectDelta.getResource();
      if (resource.getType() == 4)
      {
        IProject project = (IProject)resource;
        if (this$0.isProjectOfInterest(project))
        {
          if (this$0.isProjectTracked(project))
          {
            IResource[] resources = ChangeTracker.access$1(this$0, project, projectDelta);
            if (resources.length > 0) {
              this$0.handleChanges(project, resources);
            }
          }
          else
          {
            this$0.trackProject(project);
          }
        }
        else {
          this$0.stopTrackingProject(project);
        }
      }
    }
  }
  
  public void providerMapped(RepositoryProvider provider)
  {
    if (ChangeTracker.access$0(this$0)) {
      return;
    }
    if (this$0.isProjectOfInterest(provider.getProject())) {
      this$0.trackProject(provider.getProject());
    }
  }
  
  public void providerUnmapped(IProject project)
  {
    if (ChangeTracker.access$0(this$0)) {
      return;
    }
    this$0.stopTrackingProject(project);
  }
}

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.RepositoryProviderType;
import org.eclipse.team.internal.core.IRepositoryProviderListener;
import org.eclipse.team.internal.core.RepositoryProviderManager;
import org.eclipse.team.internal.core.TeamPlugin;

public abstract class ChangeTracker
{
  private Map trackedProjects = new HashMap();
  private boolean disposed;
  private ChangeListener changeListener = new ChangeListener(null);
  
  private class ChangeListener
    implements IResourceChangeListener, IRepositoryProviderListener
  {
    ChangeListener(ChangeListener paramChangeListener)
    {
      this();
    }
    
    public void resourceChanged(IResourceChangeEvent event)
    {
      if (disposed) {
        return;
      }
      IResourceDelta delta = event.getDelta();
      IResourceDelta[] projectDeltas = delta.getAffectedChildren(7);
      for (int i = 0; i < projectDeltas.length; i++)
      {
        IResourceDelta projectDelta = projectDeltas[i];
        IResource resource = projectDelta.getResource();
        if (resource.getType() == 4)
        {
          IProject project = (IProject)resource;
          if (isProjectOfInterest(project))
          {
            if (isProjectTracked(project))
            {
              IResource[] resources = ChangeTracker.this.getProjectChanges(project, projectDelta);
              if (resources.length > 0) {
                handleChanges(project, resources);
              }
            }
            else
            {
              trackProject(project);
            }
          }
          else {
            stopTrackingProject(project);
          }
        }
      }
    }
    
    public void providerMapped(RepositoryProvider provider)
    {
      if (disposed) {
        return;
      }
      if (isProjectOfInterest(provider.getProject())) {
        trackProject(provider.getProject());
      }
    }
    
    public void providerUnmapped(IProject project)
    {
      if (disposed) {
        return;
      }
      stopTrackingProject(project);
    }
    
    private ChangeListener() {}
  }
  
  public void start()
  {
    ResourcesPlugin.getWorkspace().addResourceChangeListener(changeListener, 1);
    RepositoryProviderManager.getInstance().addListener(changeListener);
    IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
    for (int i = 0; i < allProjects.length; i++)
    {
      IProject project = allProjects[i];
      if (isProjectOfInterest(project)) {
        trackProject(project);
      }
    }
  }
  
  public void dispose()
  {
    disposed = true;
    ResourcesPlugin.getWorkspace().removeResourceChangeListener(changeListener);
    RepositoryProviderManager.getInstance().removeListener(changeListener);
  }
  
  private IResource[] getProjectChanges(IProject project, IResourceDelta projectDelta)
  {
    List result = new ArrayList();
    try
    {
      projectDelta.accept(new IResourceDeltaVisitor()
      {
        private final List val$result;
        
        public boolean visit(IResourceDelta delta)
          throws CoreException
        {
          if ((isResourceOfInterest(delta.getResource()) & isChangeOfInterest(delta))) {
            val$result.add(delta.getResource());
          }
          return true;
        }
      });
    }
    catch (CoreException e)
    {
      TeamPlugin.log(e);
    }
    return (IResource[])result.toArray(new IResource[result.size()]);
  }
  
  protected boolean isChangeOfInterest(IResourceDelta delta)
  {
    return (delta.getKind() & 0x7) > 0;
  }
  
  protected void stopTrackingProject(IProject project)
  {
    trackedProjects.remove(project);
  }
  
  protected final boolean isProjectTracked(IProject project)
  {
    return trackedProjects.containsKey(project);
  }
  
  protected boolean isProjectOfInterest(IProject project)
  {
    return project.isAccessible();
  }
  
  protected abstract boolean isResourceOfInterest(IResource paramIResource);
  
  protected abstract void handleChanges(IProject paramIProject, IResource[] paramArrayOfIResource);
  
  protected abstract void handleProjectChange(IProject paramIProject);
  
  protected final boolean trackProject(IProject project)
  {
    if (RepositoryProvider.isShared(project)) {
      try
      {
        String currentId = project.getPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY);
        if (currentId != null)
        {
          RepositoryProviderType type = RepositoryProviderType.getProviderType(currentId);
          if (type != null)
          {
            IChangeGroupingRequestor collector = getCollector(type);
            if (collector != null)
            {
              trackedProjects.put(project, collector);
              
              projectTracked(project);
              return true;
            }
          }
        }
      }
      catch (CoreException e)
      {
        TeamPlugin.log(e);
      }
    }
    return false;
  }
  
  private IChangeGroupingRequestor getCollector(RepositoryProviderType type)
  {
    if ((type instanceof IAdaptable))
    {
      IAdaptable adaptable = type;
      Object o = adaptable.getAdapter(IChangeGroupingRequestor.class);
      if ((o instanceof IChangeGroupingRequestor)) {
        return (IChangeGroupingRequestor)o;
      }
    }
    return null;
  }
  
  protected void projectTracked(IProject project)
  {
    handleProjectChange(project);
  }
  
  protected void ensureGrouped(IProject project, String name, IFile[] files)
    throws CoreException
  {
    IChangeGroupingRequestor collector = getCollector(project);
    if (collector != null) {
      collector.ensureChangesGrouped(project, files, name);
    }
  }
  
  private IChangeGroupingRequestor getCollector(IProject project)
  {
    return (IChangeGroupingRequestor)trackedProjects.get(project);
  }
  
  protected boolean isModified(IFile file)
    throws CoreException
  {
    IChangeGroupingRequestor collector = getCollector(file.getProject());
    if (collector != null) {
      return collector.isModified(file);
    }
    return false;
  }
}

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

import java.io.IOException;
import java.io.OutputStream;
import org.eclipse.core.resources.IFile;
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.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.IFileContentManager;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.StorageMergerRegistry;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.core.mapping.IStreamMergerDelegate;

public class DelegatingStorageMerger
  implements IStorageMerger
{
  private static DelegatingStorageMerger instance;
  
  public static IStorageMerger createTextMerger()
  {
    return Team.createMerger(Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.text"));
  }
  
  public static IStorageMerger getInstance()
  {
    if (instance == null) {
      instance = new DelegatingStorageMerger();
    }
    return instance;
  }
  
  public IStatus merge(OutputStream output, String outputEncoding, IStorage ancestor, IStorage target, IStorage other, IProgressMonitor monitor)
    throws CoreException
  {
    IStorageMerger merger = createDelegateMerger(target);
    if (merger == null) {
      return new Status(2, "org.eclipse.team.core", 1, 
        Messages.DelegatingStorageMerger_0, null);
    }
    if ((ancestor == null) && (!merger.canMergeWithoutAncestor())) {
      return new Status(2, "org.eclipse.team.core", 1, 
        NLS.bind(Messages.MergeContext_1, new String[] { target.getFullPath().toString() }), null);
    }
    return merger.merge(output, outputEncoding, ancestor, target, other, monitor);
  }
  
  protected IStorageMerger createDelegateMerger(IStorage target)
    throws CoreException
  {
    IStorageMerger merger = null;
    CoreException exception = null;
    try
    {
      IContentType type = getContentType(target);
      if (type != null) {
        merger = getMerger(type);
      }
    }
    catch (CoreException e)
    {
      exception = e;
    }
    if (merger == null)
    {
      merger = getMerger(target.getName());
      if (merger == null)
      {
        int type = getType(target);
        if (type == 1) {
          merger = createTextMerger();
        }
        if (merger == null) {
          merger = findAndWrapStreamMerger(target);
        }
      }
    }
    if (exception != null)
    {
      if (merger == null) {
        throw exception;
      }
      TeamPlugin.log(exception);
    }
    return merger;
  }
  
  protected int getType(IStorage target)
  {
    return Team.getFileContentManager().getType(target);
  }
  
  private IStorageMerger findAndWrapStreamMerger(IStorage target)
  {
    IStreamMergerDelegate mergerDelegate = TeamPlugin.getPlugin().getMergerDelegate();
    if (mergerDelegate != null)
    {
      IStorageMerger merger = mergerDelegate.findMerger(target);
      return merger;
    }
    return null;
  }
  
  private IStorageMerger getMerger(String name)
  {
    String extension = getExtension(name);
    if (extension != null) {
      return StorageMergerRegistry.getInstance().createStreamMerger(extension);
    }
    return null;
  }
  
  public static String getExtension(String name)
  {
    int index = name.lastIndexOf('.');
    if (index == -1) {
      return null;
    }
    return name.substring(index + 1);
  }
  
  private IStorageMerger getMerger(IContentType type)
  {
    return Team.createMerger(type);
  }
  
  public static IContentType getContentType(IStorage target)
    throws CoreException
  {
    if ((target instanceof IFile))
    {
      IFile file = (IFile)target;
      IContentDescription contentDescription = file.getContentDescription();
      if (contentDescription != null)
      {
        IContentType contentType = contentDescription.getContentType();
        return contentType;
      }
    }
    else
    {
      IContentTypeManager manager = Platform.getContentTypeManager();
      try
      {
        return manager.findContentTypeFor(target
          .getContents(), target.getName());
      }
      catch (IOException e)
      {
        String name = target.getName();
        if (target.getFullPath() != null) {
          name = target.getFullPath().toString();
        }
        throw new TeamException(new Status(
          4, 
          "org.eclipse.team.core", 
          2, 
          NLS.bind(Messages.DelegatingStorageMerger_1, name), e));
      }
    }
    return null;
  }
  
  public boolean canMergeWithoutAncestor()
  {
    return false;
  }
}

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

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;

public abstract interface IChangeGroupingRequestor
{
  public abstract void ensureChangesGrouped(IProject paramIProject, IFile[] paramArrayOfIFile, String paramString)
    throws CoreException;
  
  public abstract boolean isModified(IFile paramIFile)
    throws CoreException;
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.team.core.diff.IDiff;

public abstract interface IMergeContext
  extends ISynchronizationContext
{
  public abstract int getMergeType();
  
  public abstract void markAsMerged(IDiff paramIDiff, boolean paramBoolean, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void markAsMerged(IDiff[] paramArrayOfIDiff, boolean paramBoolean, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract IStatus merge(IDiff paramIDiff, boolean paramBoolean, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract IStatus merge(IDiff[] paramArrayOfIDiff, boolean paramBoolean, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void reject(IDiff paramIDiff, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void reject(IDiff[] paramArrayOfIDiff, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void run(IWorkspaceRunnable paramIWorkspaceRunnable, ISchedulingRule paramISchedulingRule, int paramInt, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract ISchedulingRule getMergeRule(IDiff paramIDiff);
  
  public abstract ISchedulingRule getMergeRule(IDiff[] paramArrayOfIDiff);
}

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

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.runtime.IStatus;

public abstract interface IMergeStatus
  extends IStatus
{
  public static final int CONFLICTS = 1;
  public static final int INTERNAL_ERROR = 2;
  
  public abstract ResourceMapping[] getConflictingMappings();
  
  public abstract IFile[] getConflictingFiles();
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.diff.ITwoWayDiff;
import org.eclipse.team.core.history.IFileRevision;

public abstract interface IResourceDiff
  extends ITwoWayDiff
{
  public static final int OPEN = 65536;
  public static final int DESCRIPTION = 131072;
  
  public abstract IResource getResource();
  
  public abstract IFileRevision getBeforeState();
  
  public abstract IFileRevision getAfterState();
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.team.core.diff.FastDiffFilter;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IDiffTree;
import org.eclipse.team.core.diff.IDiffVisitor;

public abstract interface IResourceDiffTree
  extends IDiffTree
{
  public abstract IDiff getDiff(IResource paramIResource);
  
  public abstract IResource getResource(IDiff paramIDiff);
  
  public abstract void accept(ResourceTraversal[] paramArrayOfResourceTraversal, IDiffVisitor paramIDiffVisitor);
  
  public abstract IDiff[] getDiffs(ResourceTraversal[] paramArrayOfResourceTraversal);
  
  public abstract IDiff[] getDiffs(IResource paramIResource, int paramInt);
  
  public abstract IResource[] members(IResource paramIResource);
  
  public abstract IResource[] getAffectedResources();
  
  public abstract boolean hasMatchingDiffs(ResourceTraversal[] paramArrayOfResourceTraversal, FastDiffFilter paramFastDiffFilter);
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.ISchedulingRule;

public abstract interface IResourceMappingMerger
{
  public abstract IStatus merge(IMergeContext paramIMergeContext, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract ISchedulingRule getMergeRule(IMergeContext paramIMergeContext);
  
  public abstract IStatus validateMerge(IMergeContext paramIMergeContext, IProgressMonitor paramIProgressMonitor);
}

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

import java.io.OutputStream;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;

public abstract interface IStorageMerger
{
  public static final int OK = 0;
  public static final int CONFLICT = 1;
  public static final int INTERNAL_ERROR = 2;
  public static final int UNSUPPORTED_ENCODING = 3;
  
  public abstract IStatus merge(OutputStream paramOutputStream, String paramString, IStorage paramIStorage1, IStorage paramIStorage2, IStorage paramIStorage3, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract boolean canMergeWithoutAncestor();
}

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

import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.ICache;

public abstract interface ISynchronizationContext
{
  public static final int TWO_WAY = 2;
  public static final int THREE_WAY = 3;
  
  public abstract ISynchronizationScope getScope();
  
  public abstract IResourceDiffTree getDiffTree();
  
  public abstract int getType();
  
  public abstract ICache getCache();
  
  public abstract void dispose();
  
  public abstract void refresh(ResourceTraversal[] paramArrayOfResourceTraversal, int paramInt, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void refresh(ResourceMapping[] paramArrayOfResourceMapping, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
}

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

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceTraversal;

public abstract interface ISynchronizationScope
{
  public abstract IProject[] getProjects();
  
  public abstract ResourceMappingContext getContext();
  
  public abstract ResourceMapping[] getInputMappings();
  
  public abstract ISynchronizationScope asInputScope();
  
  public abstract ResourceMapping[] getMappings();
  
  public abstract ResourceTraversal[] getTraversals();
  
  public abstract IResource[] getRoots();
  
  public abstract boolean contains(IResource paramIResource);
  
  public abstract void addScopeChangeListener(ISynchronizationScopeChangeListener paramISynchronizationScopeChangeListener);
  
  public abstract void removeScopeChangeListener(ISynchronizationScopeChangeListener paramISynchronizationScopeChangeListener);
  
  public abstract ResourceTraversal[] getTraversals(ResourceMapping paramResourceMapping);
  
  public abstract boolean hasAdditionalMappings();
  
  public abstract boolean hasAdditonalResources();
  
  public abstract ModelProvider[] getModelProviders();
  
  public abstract ResourceMapping[] getMappings(String paramString);
  
  public abstract ResourceTraversal[] getTraversals(String paramString);
  
  public abstract ResourceMapping getMapping(Object paramObject);
  
  public abstract void refresh(ResourceMapping[] paramArrayOfResourceMapping);
}

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

import java.util.EventListener;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceTraversal;

public abstract interface ISynchronizationScopeChangeListener
  extends EventListener
{
  public abstract void scopeChanged(ISynchronizationScope paramISynchronizationScope, ResourceMapping[] paramArrayOfResourceMapping, ResourceTraversal[] paramArrayOfResourceTraversal);
}

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

import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract interface ISynchronizationScopeManager
{
  public abstract ISynchronizationScope getScope();
  
  public abstract boolean isInitialized();
  
  public abstract void initialize(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract ResourceTraversal[] refresh(ResourceMapping[] paramArrayOfResourceMapping, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void dispose();
}

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

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceMapping;

public abstract interface ISynchronizationScopeParticipant
{
  public abstract ResourceMapping[] handleContextChange(ISynchronizationScope paramISynchronizationScope, IResource[] paramArrayOfIResource, IProject[] paramArrayOfIProject);
  
  public abstract void dispose();
}

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

import org.eclipse.core.resources.mapping.ModelProvider;

public abstract interface ISynchronizationScopeParticipantFactory
{
  public abstract ISynchronizationScopeParticipant createParticipant(ModelProvider paramModelProvider, ISynchronizationScope paramISynchronizationScope);
}

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

import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.mapping.IModelProviderDescriptor;
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.mapping.provider.MergeStatus;

public abstract class ResourceMappingMerger
  implements IResourceMappingMerger
{
  public IStatus validateMerge(IMergeContext mergeContext, IProgressMonitor monitor)
  {
    return Status.OK_STATUS;
  }
  
  protected abstract ModelProvider getModelProvider();
  
  public ISchedulingRule getMergeRule(IMergeContext context)
  {
    ResourceMapping[] mappings = context.getScope().getMappings(getModelProvider().getId());
    ISchedulingRule rule = null;
    for (int i = 0; i < mappings.length; i++)
    {
      ResourceMapping mapping = mappings[i];
      IProject[] mappingProjects = mapping.getProjects();
      for (int j = 0; j < mappingProjects.length; j++)
      {
        IProject project = mappingProjects[j];
        if (rule == null) {
          rule = project;
        } else {
          rule = MultiRule.combine(rule, project);
        }
      }
    }
    return rule;
  }
  
  public IStatus merge(IMergeContext mergeContext, IProgressMonitor monitor)
    throws CoreException
  {
    IDiff[] deltas = getSetToMerge(mergeContext);
    IStatus status = mergeContext.merge(deltas, false, monitor);
    return covertFilesToMappings(status, mergeContext);
  }
  
  private IDiff[] getSetToMerge(IMergeContext mergeContext)
  {
    ResourceMapping[] mappings = mergeContext.getScope().getMappings(getModelProvider().getDescriptor().getId());
    Set result = new HashSet();
    for (int i = 0; i < mappings.length; i++)
    {
      ResourceMapping mapping = mappings[i];
      ResourceTraversal[] traversals = mergeContext.getScope().getTraversals(mapping);
      IDiff[] deltas = mergeContext.getDiffTree().getDiffs(traversals);
      for (int j = 0; j < deltas.length; j++)
      {
        IDiff delta = deltas[j];
        result.add(delta);
      }
    }
    return (IDiff[])result.toArray(new IDiff[result.size()]);
  }
  
  private IStatus covertFilesToMappings(IStatus status, IMergeContext mergeContext)
  {
    if (status.getCode() == 1) {
      return new MergeStatus(status.getPlugin(), status.getMessage(), mergeContext.getScope().getMappings(getModelProvider().getDescriptor().getId()));
    }
    return status;
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.diff.IDiff;

class MergeContext$1
  implements IWorkspaceRunnable
{
  final MergeContext this$0;
  private final IDiff[] val$diffs;
  
  MergeContext$1(MergeContext paramMergeContext, IDiff[] paramArrayOfIDiff)
  {
    this$0 = paramMergeContext;val$diffs = paramArrayOfIDiff;
  }
  
  public void run(IProgressMonitor monitor)
    throws CoreException
  {
    for (int i = 0; i < val$diffs.length; i++)
    {
      IDiff node = val$diffs[i];
      this$0.reject(node, monitor);
    }
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.diff.IDiff;

class MergeContext$2
  implements IWorkspaceRunnable
{
  final MergeContext this$0;
  private final IDiff[] val$nodes;
  private final boolean val$inSyncHint;
  
  MergeContext$2(MergeContext paramMergeContext, IDiff[] paramArrayOfIDiff, boolean paramBoolean)
  {
    this$0 = paramMergeContext;val$nodes = paramArrayOfIDiff;val$inSyncHint = paramBoolean;
  }
  
  public void run(IProgressMonitor monitor)
    throws CoreException
  {
    for (int i = 0; i < val$nodes.length; i++)
    {
      IDiff node = val$nodes[i];
      this$0.markAsMerged(node, val$inSyncHint, monitor);
    }
  }
}

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

import java.util.List;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.team.core.diff.IDiff;

class MergeContext$3
  implements IWorkspaceRunnable
{
  final MergeContext this$0;
  private final IDiff[] val$deltas;
  private final boolean val$force;
  private final List val$failedFiles;
  
  MergeContext$3(MergeContext paramMergeContext, IDiff[] paramArrayOfIDiff, boolean paramBoolean, List paramList)
  {
    this$0 = paramMergeContext;val$deltas = paramArrayOfIDiff;val$force = paramBoolean;val$failedFiles = paramList;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: aconst_null
    //   2: aload_0
    //   3: getfield 82	org/eclipse/team/core/mapping/provider/MergeContext$3:val$deltas	[Lorg/eclipse/team/core/diff/IDiff;
    //   6: arraylength
    //   7: bipush 100
    //   9: imul
    //   10: invokeinterface 91 3 0
    //   15: iconst_0
    //   16: istore_2
    //   17: goto +90 -> 107
    //   20: aload_0
    //   21: getfield 82	org/eclipse/team/core/mapping/provider/MergeContext$3:val$deltas	[Lorg/eclipse/team/core/diff/IDiff;
    //   24: iload_2
    //   25: aaload
    //   26: astore_3
    //   27: aload_0
    //   28: getfield 83	org/eclipse/team/core/mapping/provider/MergeContext$3:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   31: aload_3
    //   32: aload_0
    //   33: getfield 80	org/eclipse/team/core/mapping/provider/MergeContext$3:val$force	Z
    //   36: aload_1
    //   37: bipush 100
    //   39: invokestatic 88	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   42: invokevirtual 87	org/eclipse/team/core/mapping/provider/MergeContext:merge	(Lorg/eclipse/team/core/diff/IDiff;ZLorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;
    //   45: astore 4
    //   47: aload 4
    //   49: invokeinterface 93 1 0
    //   54: ifne +50 -> 104
    //   57: aload 4
    //   59: invokeinterface 92 1 0
    //   64: iconst_1
    //   65: if_icmpne +29 -> 94
    //   68: aload_0
    //   69: getfield 81	org/eclipse/team/core/mapping/provider/MergeContext$3:val$failedFiles	Ljava/util/List;
    //   72: aload 4
    //   74: checkcast 46	org/eclipse/team/core/mapping/IMergeStatus
    //   77: invokeinterface 94 1 0
    //   82: invokestatic 85	java/util/Arrays:asList	([Ljava/lang/Object;)Ljava/util/List;
    //   85: invokeinterface 89 2 0
    //   90: pop
    //   91: goto +13 -> 104
    //   94: new 43	org/eclipse/core/runtime/CoreException
    //   97: dup
    //   98: aload 4
    //   100: invokespecial 86	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   103: athrow
    //   104: iinc 2 1
    //   107: iload_2
    //   108: aload_0
    //   109: getfield 82	org/eclipse/team/core/mapping/provider/MergeContext$3:val$deltas	[Lorg/eclipse/team/core/diff/IDiff;
    //
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