org.eclipse.team.ui_3.6.101.R37x_v20111109-0800

abstract ISynchronizeView showSynchronizeViewInActivePage();
  
  public abstract ISynchronizeParticipantDescriptor getParticipantDescriptor(String paramString);
}

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

public abstract interface ISynchronizeModelChangeListener
{
  public abstract void modelChanged(ISynchronizeModelElement paramISynchronizeModelElement);
}

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

import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;

public abstract interface ISynchronizeModelElement
  extends IDiffContainer, ITypedElement, ICompareInput
{
  public static final String BUSY_PROPERTY = "org.eclipse.team.ui.busy";
  public static final String PROPAGATED_CONFLICT_PROPERTY = "org.eclipse.team.ui.conflict";
  public static final String PROPAGATED_ERROR_MARKER_PROPERTY = "org.eclipse.team.ui.error";
  public static final String PROPAGATED_WARNING_MARKER_PROPERTY = "org.eclipse.team.ui.warning";
  
  public abstract void addPropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void removePropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void setPropertyToRoot(String paramString, boolean paramBoolean);
  
  public abstract void setProperty(String paramString, boolean paramBoolean);
  
  public abstract boolean getProperty(String paramString);
  
  public abstract ImageDescriptor getImageDescriptor(Object paramObject);
  
  public abstract IResource getResource();
}

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

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.PartInitException;

public abstract interface ISynchronizePage
{
  public abstract void init(ISynchronizePageSite paramISynchronizePageSite)
    throws PartInitException;
  
  public abstract Viewer getViewer();
  
  public abstract boolean aboutToChangeProperty(ISynchronizePageConfiguration paramISynchronizePageConfiguration, String paramString, Object paramObject);
}

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

import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.team.core.synchronize.SyncInfoSet;

public abstract interface ISynchronizePageConfiguration
{
  public static final String P_SYNC_INFO_SET = "org.eclipse.team.ui.P_SYNC_INFO_SET";
  public static final String P_LABEL_DECORATORS = "org.eclipse.team.ui.P_LABEL_DECORATORS";
  public static final String P_TOOLBAR_MENU = "org.eclipse.team.ui.P_TOOLBAR_MENU";
  public static final String P_CONTEXT_MENU = "org.eclipse.team.ui.P_CONTEXT_MENU";
  public static final String P_VIEW_MENU = "org.eclipse.team.ui.P_VIEW_MENU";
  public static final String P_OBJECT_CONTRIBUTION_ID = "org.eclipse.team.ui.P_OBJECT_CONTRIBUTION_ID";
  public static final String P_COMPARISON_TYPE = "org.eclipse.team.ui.P_COMPARISON_TYPE";
  public static final String P_MODE = "org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE";
  public static final String P_SUPPORTED_MODES = "org.eclipse.team.ui.P_SUPPORTED_MODES";
  public static final String P_VIEWER_ID = "org.eclipse.team.ui.P_VIEWER_ID";
  public static final String P_PAGE_DESCRIPTION = "org.eclipse.team.ui.P_PAGE_DESCRIPTION";
  public static final String SYNCHRONIZE_GROUP = "synchronize";
  public static final String NAVIGATE_GROUP = "navigate";
  public static final String SORT_GROUP = "sort";
  public static final String MODE_GROUP = "modes";
  public static final String FILE_GROUP = "file";
  public static final String EDIT_GROUP = "edit";
  public static final String PREFERENCES_GROUP = "preferences";
  public static final String OBJECT_CONTRIBUTIONS_GROUP = "additions";
  public static final String LAYOUT_GROUP = "layout";
  public static final String[] DEFAULT_CONTEXT_MENU = { "file", "edit", "synchronize", "navigate", "sort", "additions" };
  public static final String[] DEFAULT_TOOLBAR_MENU = { "synchronize", "navigate", "modes", "layout" };
  public static final String[] DEFAULT_VIEW_MENU = { "layout", "modes", "synchronize", "preferences" };
  public static final String TWO_WAY = "two-way";
  public static final String THREE_WAY = "three-way";
  public static final int INCOMING_MODE = 1;
  public static final int OUTGOING_MODE = 2;
  public static final int BOTH_MODE = 4;
  public static final int CONFLICTING_MODE = 8;
  public static final int ALL_MODES = 15;
  
  public abstract ISynchronizeParticipant getParticipant();
  
  public abstract ISynchronizePageSite getSite();
  
  public abstract ISynchronizePage getPage();
  
  public abstract void setPage(ISynchronizePage paramISynchronizePage);
  
  public abstract void addPropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void removePropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void setProperty(String paramString, Object paramObject);
  
  public abstract Object getProperty(String paramString);
  
  public abstract void addActionContribution(SynchronizePageActionGroup paramSynchronizePageActionGroup);
  
  public abstract void removeActionContribution(SynchronizePageActionGroup paramSynchronizePageActionGroup);
  
  public abstract void addLabelDecorator(ILabelDecorator paramILabelDecorator);
  
  public abstract void setMenuGroups(String paramString, String[] paramArrayOfString);
  
  public abstract void addMenuGroup(String paramString1, String paramString2);
  
  public abstract boolean hasMenuGroup(String paramString1, String paramString2);
  
  public abstract int getMode();
  
  public abstract void setMode(int paramInt);
  
  public abstract int getSupportedModes();
  
  public abstract void setSupportedModes(int paramInt);
  
  public abstract SyncInfoSet getSyncInfoSet();
  
  public abstract String getComparisonType();
  
  public abstract void setComparisonType(String paramString);
  
  public abstract void setRunnableContext(IRunnableContext paramIRunnableContext);
  
  public abstract IRunnableContext getRunnableContext();
  
  public abstract String getViewerId();
}

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

import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchSite;

public abstract interface ISynchronizePageSite
{
  public abstract IWorkbenchSite getWorkbenchSite();
  
  public abstract IWorkbenchPart getPart();
  
  public abstract Shell getShell();
  
  public abstract ISelectionProvider getSelectionProvider();
  
  public abstract void setSelectionProvider(ISelectionProvider paramISelectionProvider);
  
  public abstract IKeyBindingService getKeyBindingService();
  
  public abstract void setFocus();
  
  public abstract IDialogSettings getPageSettings();
  
  public abstract IActionBars getActionBars();
  
  public abstract boolean isModal();
}

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

import org.eclipse.compare.CompareConfiguration;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.team.core.TeamException;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.IPageBookViewPage;

public abstract interface ISynchronizeParticipant
  extends IExecutableExtension, IAdaptable
{
  public static final String P_CONTENT = "org.eclipse.team.ui.content";
  
  public abstract String getId();
  
  public abstract String getSecondaryId();
  
  public abstract String getName();
  
  public abstract ImageDescriptor getImageDescriptor();
  
  public abstract boolean isPinned();
  
  public abstract void setPinned(boolean paramBoolean);
  
  public abstract ISynchronizePageConfiguration createPageConfiguration();
  
  public abstract IPageBookViewPage createPage(ISynchronizePageConfiguration paramISynchronizePageConfiguration);
  
  public abstract void run(IWorkbenchPart paramIWorkbenchPart);
  
  public abstract void init(String paramString, IMemento paramIMemento)
    throws PartInitException;
  
  public abstract void dispose();
  
  public abstract void saveState(IMemento paramIMemento);
  
  public abstract void addPropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void removePropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void prepareCompareInput(ISynchronizeModelElement paramISynchronizeModelElement, CompareConfiguration paramCompareConfiguration, IProgressMonitor paramIProgressMonitor)
    throws TeamException;
  
  public abstract PreferencePage[] getPreferencePages();
  
  public abstract String getHelpContextId();
}

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

import org.eclipse.jface.resource.ImageDescriptor;

public abstract interface ISynchronizeParticipantDescriptor
{
  public abstract String getName();
  
  public abstract String getDescription();
  
  public abstract String getId();
  
  public abstract ImageDescriptor getImageDescriptor();
  
  public abstract boolean isPersistent();
}

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

public abstract interface ISynchronizeParticipantListener
{
  public abstract void participantsAdded(ISynchronizeParticipant[] paramArrayOfISynchronizeParticipant);
  
  public abstract void participantsRemoved(ISynchronizeParticipant[] paramArrayOfISynchronizeParticipant);
}

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

import org.eclipse.team.core.TeamException;

public abstract interface ISynchronizeParticipantReference
{
  public abstract String getId();
  
  public abstract String getSecondaryId();
  
  public abstract String getDisplayName();
  
  public abstract ISynchronizeParticipant getParticipant()
    throws TeamException;
  
  public abstract ISynchronizeParticipantDescriptor getDescriptor();
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.jface.util.IPropertyChangeListener;

public abstract interface ISynchronizeScope
{
  public static final String ROOTS = "prop_roots";
  public static final String NAME = "prop_name";
  
  public abstract String getName();
  
  public abstract IResource[] getRoots();
  
  public abstract void addPropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void removePropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void dispose();
}

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

import org.eclipse.ui.IViewPart;

public abstract interface ISynchronizeView
  extends IViewPart
{
  public static final String VIEW_ID = "org.eclipse.team.sync.views.SynchronizeView";
  /**
   * @deprecated
   */
  public static final String COMPARE_VIEW_ID = "org.eclipse.team.sync.views.CompareView";
  
  public abstract void display(ISynchronizeParticipant paramISynchronizeParticipant);
  
  public abstract ISynchronizeParticipant getParticipant();
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.team.internal.ui.TeamUIMessages;

class ModelMergeOperation$1
  implements Runnable
{
  final ModelMergeOperation this$0;
  private final IStatus val$status;
  private final boolean[] val$result;
  
  ModelMergeOperation$1(ModelMergeOperation paramModelMergeOperation, IStatus paramIStatus, boolean[] paramArrayOfBoolean)
  {
    this$0 = paramModelMergeOperation;val$status = paramIStatus;val$result = paramArrayOfBoolean;
  }
  
  public void run()
  {
    ErrorDialog dialog = new ModelMergeOperation.2(this, ModelMergeOperation.access$0(this$0), TeamUIMessages.ModelMergeOperation_0, TeamUIMessages.ModelMergeOperation_1, val$status, 7);
    
    int code = dialog.open();
    val$result[0] = (code == 0 ? 1 : false);
  }
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

class ModelMergeOperation$2
  extends ErrorDialog
{
  final ModelMergeOperation.1 this$1;
  
  ModelMergeOperation$2(ModelMergeOperation.1 param1, Shell $anonymous0, String $anonymous1, String $anonymous2, IStatus $anonymous3, int $anonymous4)
  {
    super($anonymous0, $anonymous1, $anonymous2, $anonymous3, $anonymous4);this$1 = param1;
  }
  
  protected void createButtonsForButtonBar(Composite parent)
  {
    createButton(parent, 2, IDialogConstants.YES_LABEL, 
      false);
    createButton(parent, 3, IDialogConstants.NO_LABEL, 
      true);
    createDetailsButton(parent);
  }
  
  protected void buttonPressed(int id)
  {
    if (id == 2) {
      super.buttonPressed(0);
    } else if (id == 3) {
      super.buttonPressed(1);
    }
    super.buttonPressed(id);
  }
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.team.internal.ui.TeamUIMessages;

class ModelMergeOperation$3
  implements Runnable
{
  final ModelMergeOperation this$0;
  private final IStatus val$status;
  
  ModelMergeOperation$3(ModelMergeOperation paramModelMergeOperation, IStatus paramIStatus)
  {
    this$0 = paramModelMergeOperation;val$status = paramIStatus;
  }
  
  public void run()
  {
    MessageDialog.openInformation(ModelMergeOperation.access$0(this$0), TeamUIMessages.MergeIncomingChangesAction_0, val$status.getMessage());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.synchronize.ModelMergeOperation.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.synchronize;

import org.eclipse.team.core.mapping.ISynchronizationScope;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.dialogs.NoChangesDialog;

class ModelMergeOperation$4
  implements Runnable
{
  final ModelMergeOperation this$0;
  
  ModelMergeOperation$4(ModelMergeOperation paramModelMergeOperation)
  {
    this$0 = paramModelMergeOperation;
  }
  
  public void run()
  {
    NoChangesDialog.open(ModelMergeOperation.access$0(this$0), TeamUIMessages.ResourceMappingMergeOperation_0, TeamUIMessages.ResourceMappingMergeOperation_1, TeamUIMessages.ModelMergeOperation_3, this$0.getScope().asInputScope());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.synchronize.ModelMergeOperation.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.synchronize;

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.internal.ui.Policy;

class ModelMergeOperation$5
  implements IWorkspaceRunnable
{
  final ModelMergeOperation this$0;
  private final ModelProvider[] val$providers;
  private final IStatus[] val$result;
  
  ModelMergeOperation$5(ModelMergeOperation paramModelMergeOperation, ModelProvider[] paramArrayOfModelProvider, IStatus[] paramArrayOfIStatus)
  {
    this$0 = paramModelMergeOperation;val$providers = paramArrayOfModelProvider;val$result = paramArrayOfIStatus;
  }
  
  public void run(IProgressMonitor monitor)
    throws CoreException
  {
    try
    {
      int ticks = 100;
      monitor.beginTask(null, ticks + (val$providers.length - 1) * 10);
      for (int i = 0; i < val$providers.length; i++)
      {
        ModelProvider provider = val$providers[i];
        IStatus status = this$0.performMerge(provider, Policy.subMonitorFor(monitor, ticks));
        ticks = 10;
        if (!status.isOK())
        {
          val$result[0] = status;
          return;
        }
        try
        {
          Job.getJobManager().join(this$0.getContext(), monitor);
        }
        catch (InterruptedException localInterruptedException) {}
      }
    }
    finally
    {
      monitor.done();
    }
    monitor.done();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.synchronize.ModelMergeOperation.5
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.synchronize;

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

class ModelMergeOperation$6
  extends FastDiffFilter
{
  final ModelMergeOperation this$0;
  
  ModelMergeOperation$6(ModelMergeOperation paramModelMergeOperation)
  {
    this$0 = paramModelMergeOperation;
  }
  
  public boolean select(IDiff node)
  {
    if ((node instanceof IThreeWayDiff))
    {
      IThreeWayDiff twd = (IThreeWayDiff)node;
      int direction = twd.getDirection();
      if ((direction == 512) || (direction == 768)) {
        return true;
      }
    }
    else
    {
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.synchronize.ModelMergeOperation.6
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.synchronize;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
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.IThreeWayDiff;
import org.eclipse.team.core.mapping.IMergeContext;
import org.eclipse.team.core.mapping.IResourceDiffTree;
import org.eclipse.team.core.mapping.IResourceMappingMerger;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.core.mapping.ISynchronizationScope;
import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.dialogs.NoChangesDialog;
import org.eclipse.ui.IWorkbenchPart;

public abstract class ModelMergeOperation
  extends ModelOperation
{
  public static IStatus validateMerge(IMergeContext context, IProgressMonitor monitor)
  {
    try
    {
      ModelProvider[] providers = context.getScope().getModelProviders();
      monitor.beginTask(null, 100 * providers.length);
      List notOK = new ArrayList();
      for (int i = 0; i < providers.length; i++)
      {
        ModelProvider provider = providers[i];
        IStatus status = validateMerge(provider, context, Policy.subMonitorFor(monitor, 100));
        if (!status.isOK()) {
          notOK.add(status);
        }
      }
      Object localObject2;
      if (notOK.isEmpty()) {
        return Status.OK_STATUS;
      }
      if (notOK.size() == 1) {
        return (IStatus)notOK.get(0);
      }
      return new MultiStatus("org.eclipse.team.ui", 0, (IStatus[])notOK.toArray(new IStatus[notOK.size()]), TeamUIMessages.ResourceMappingMergeOperation_3, null);
    }
    finally
    {
      monitor.done();
    }
  }
  
  private static IStatus validateMerge(ModelProvider provider, IMergeContext context, IProgressMonitor monitor)
  {
    IResourceMappingMerger merger = getMerger(provider);
    if (merger == null) {
      return Status.OK_STATUS;
    }
    return merger.validateMerge(context, monitor);
  }
  
  private static IResourceMappingMerger getMerger(ModelProvider provider)
  {
    Assert.isNotNull(provider);
    return (IResourceMappingMerger)Utils.getAdapter(provider, IResourceMappingMerger.class);
  }
  
  protected ModelMergeOperation(IWorkbenchPart part, ISynchronizationScopeManager manager)
  {
    super(part, manager);
  }
  
  /* Error */
  protected void execute(IProgressMonitor monitor)
    throws java.lang.reflect.InvocationTargetException, InterruptedException
  {
    // Byte code:
    //   0: aload_1
    //   1: aconst_null
    //   2: bipush 100
    //   4: invokeinterface 319 3 0
    //   9: aload_0
    //   10: aload_1
    //   11: bipush 50
    //   13: invokestatic 285	org/eclipse/team/internal/ui/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   16: invokevirtual 292	org/eclipse/team/ui/synchronize/ModelMergeOperation:initializeContext	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   19: aload_0
    //   20: aload_1
    //   21: bipush 50
    //   23: invokestatic 285	org/eclipse/team/internal/ui/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   26: invokevirtual 291	org/eclipse/team/ui/synchronize/ModelMergeOperation:executeMerge	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   29: goto +22 -> 51
    //   32: astore_2
    //   33: new 123	java/lang/reflect/InvocationTargetException
    //   36: dup
    //   37: aload_2
    //   38: invokespecial 276	java/lang/reflect/InvocationTargetException:<init>	(Ljava/lang/Throwable;)V
    //   41: athrow
    //   42: astore_3
    //   43: aload_1
    //   44: invokeinterface 318 1 0
    //   49: aload_3
    //   50: athrow
    //   51: aload_1
    //   52: invokeinterface 318 1 0
    //   57: return
    // Line number table:
    //   Java source line #124	-> byte code offset #0
    //   Java source line #125	-> byte code offset #9
    //   Java source line #126	-> byte code offset #19
    //   Java source line #127	-> byte code offset #32
    //   Java source line #128	-> byte code offset #33
    //   Java source line #129	-> byte code offset #42
    //   Java source line #130	-> byte code offset #43
    //   Java source line #131	-> byte code offset #49
    //   Java source line #130	-> byte code offset #51
    //   Java source line #132	-> byte code offset #57
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	58	0	this	ModelMergeOperation
    //   0	58	1	monitor	IProgressMonitor
    //   32	6	2	e	CoreException
    //   42	8	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	29	32	org/eclipse/core/runtime/CoreException
    //   0	42	42	finally
  }
  
  protected void executeMerge(IProgressMonitor monitor)
    throws CoreException
  {
    monitor.beginTask(null, 100);
    if (!hasChangesOfInterest())
    {
      handleNoChanges();
    }
    else if (isPreviewRequested())
    {
      handlePreviewRequest();
    }
    else
    {
      IStatus status = validateMerge(getMergeContext(), Policy.subMonitorFor(monitor, 10));
      if (!status.isOK())
      {
        handleValidationFailure(status);
      }
      else
      {
        status = performMerge(Policy.subMonitorFor(monitor, 90));
        if (!status.isOK()) {
          handleMergeFailure(status);
        }
      }
    }
    monitor.done();
  }
  
  protected void handlePreviewRequest() {}
  
  protected abstract void initializeContext(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  protected void handleValidationFailure(IStatus status)
  {
    boolean[] result = new boolean[1];
    Runnable runnable = new Runnable()
    {
      private final IStatus val$status;
      private final boolean[] val$result;
      
      public void run()
      {
        ErrorDialog dialog = new ModelMergeOperation.2(this, getShell(), TeamUIMessages.ModelMergeOperation_0, TeamUIMessages.ModelMergeOperation_1, val$status, 7);
        
        int code = dialog.open();
        val$result[0] = (code == 0 ? 1 : false);
      }
    };
    getShell().getDisplay().syncExec(runnable);
    if (result[0] != 0) {
      handlePreviewRequest();
    }
  }
  
  protected void handleMergeFailure(IStatus status)
  {
    Display.getDefault().syncExec(new Runnable()
    {
      private final IStatus val$status;
      
      public void run()
      {
        MessageDialog.openInformation(getShell(), TeamUIMessages.MergeIncomingChangesAction_0, val$status.getMessage());
      }
    });
    handlePreviewRequest();
  }
  
  protected void handleNoChanges()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        NoChangesDialog.open(getShell(), TeamUIMessages.ResourceMappingMergeOperation_0, TeamUIMessages.ResourceMappingMergeOperation_1, TeamUIMessages.ModelMergeOperation_3, getScope().asInputScope());
      }
    });
  }
  
  protected IStatus performMerge(IProgressMonitor monitor)
    throws CoreException
  {
    ISynchronizationContext sc = getContext();
    if ((sc instanceof IMergeContext))
    {
      IMergeContext context = (IMergeContext)sc;
      ModelProvider[] providers = sortByExtension(context.getScope().getModelProviders());
      IStatus[] result = { Status.OK_STATUS };
      context.run(new IWorkspaceRunnable()
      {
        private final ModelProvider[] val$providers;
        private final IStatus[] val$result;
        
        public void run(IProgressMonitor monitor)
          throws CoreException
        {
          try
          {
            int ticks = 100;
            monitor.beginTask(null, ticks + (val$providers.length - 1) * 10);
            for (int i = 0; i < val$providers.length; i++)
            {
              ModelProvider provider = val$providers[i];
              IStatus status = performMerge(provider, Policy.subMonitorFor(monitor, ticks));
              ticks = 10;
              if (!status.isOK())
              {
                val$result[0] = status;
                return;
              }
              try
              {
                Job.getJobManager().join(getContext(), monitor);
              }
              catch (InterruptedException localInterruptedException) {}
            }
          }
          finally
          {
            monitor.done();
          }
          monitor.done();
        }
      }, null, 0, monitor);
      return result[0];
    }
    return noMergeContextAvailable();
  }
  
  protected IStatus performMerge(ModelProvider provider, IProgressMonitor monitor)
    throws CoreException
  {
    ISynchronizationContext sc = getContext();
    if ((sc instanceof IMergeContext))
    {
      IMergeContext context = (IMergeContext)sc;
      IResourceMappingMerger merger = getMerger(provider);
      if (merger != null)
      {
        IStatus status = merger.merge(context, monitor);
        if ((status.isOK()) || (status.getCode() == 1)) {
          return status;
        }
        throw new TeamException(status);
      }
      return Status.OK_STATUS;
    }
    return noMergeContextAvailable();
  }
  
  private IStatus noMergeContextAvailable()
  {
    throw new IllegalStateException(TeamUIMessages.ModelMergeOperation_2);
  }
  
  protected boolean hasChangesOfInterest()
  {
    return (!getContext().getDiffTree().isEmpty()) && (hasIncomingChanges(getContext().getDiffTree()));
  }
  
  private boolean hasIncomingChanges(IDiffTree tree)
  {
    tree.hasMatchingDiffs(ResourcesPlugin.getWorkspace().getRoot().getFullPath(), new FastDiffFilter()
    {
      public boolean select(IDiff node)
      {
        if ((node instanceof IThreeWayDiff))
        {
          IThreeWayDiff twd = (IThreeWayDiff)node;
          int direction = twd.getDirection();
          if ((direction == 512) || (direction == 768)) {
            return true;
          }
        }
        else
        {
          return true;
        }
        return false;
      }
    });
  }
  
  private IMergeContext getMergeContext()
  {
    return (IMergeContext)getContext();
  }
}

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

import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.dialogs.AdditionalMappingsDialog;

class ModelOperation$1
  implements Runnable
{
  final ModelOperation this$0;
  private final String val$requestPreviewMessage;
  private final boolean[] val$canceled;
  private final boolean[] val$forcePreview;
  
  ModelOperation$1(ModelOperation paramModelOperation, String paramString, boolean[] paramArrayOfBoolean1, boolean[] paramArrayOfBoolean2)
  {
    this$0 = paramModelOperation;val$requestPreviewMessage = paramString;val$canceled = paramArrayOfBoolean1;val$forcePreview = paramArrayOfBoolean2;
  }
  
  public void run()
  {
    AdditionalMappingsDialog dialog = new AdditionalMappingsDialog(ModelOperation.access$0(this$0), TeamUIMessages.ResourceMappingOperation_0, this$0.getScope(), this$0.getContext());
    dialog.setPreviewMessage(val$requestPreviewMessage);
    int result = dialog.open();
    val$canceled[0] = (result != 0 ? 1 : false);
    if (val$requestPreviewMessage != null) {
      val$forcePreview[0] = dialog.isForcePreview();
    }
  }
}

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

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IResource;
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.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.core.mapping.ISynchronizationScope;
import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
import org.eclipse.team.internal.core.mapping.CompoundResourceTraversal;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.dialogs.AdditionalMappingsDialog;
import org.eclipse.team.ui.TeamOperation;
import org.eclipse.ui.IWorkbenchPart;

public abstract class ModelOperation
  extends TeamOperation
{
  private boolean previewRequested;
  private ISynchronizationScopeManager manager;
  
  public static ModelProvider[] sortByExtension(ModelProvider[] providers)
  {
    List result = new ArrayList();
    for (int i = 0; i < providers.length; i++)
    {
      ModelProvider providerToInsert = providers[i];
      int index = result.size();
      for (int j = 0; j < result.size(); j++)
      {
        ModelProvider provider = (ModelProvider)result.get(j);
        if (extendsProvider(providerToInsert, provider))
        {
          index = j;
          break;
        }
      }
      result.add(index, providerToInsert);
    }
    return (ModelProvider[])result.toArray(new ModelProvider[result.size()]);
  }
  
  private static boolean extendsProvider(ModelProvider providerToInsert, ModelProvider provider)
  {
    String[] extended = providerToInsert.getDescriptor().getExtendedModels();
    for (int i = 0; i < extended.length; i++)
    {
      String id = extended[i];
      if (id.equals(provider.getDescriptor().getId())) {
        return true;
      }
    }
    return false;
  }
  
  protected ModelOperation(IWorkbenchPart part, ISynchronizationScopeManager manager)
  {
    super(part);
    this.manager = manager;
  }
  
  /* Error */
  public final void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    // Byte code:
    //   0: aload_1
    //   1: aconst_null
    //   2: bipush 100
    //   4: invokeinterface 345 3 0
    //   9: aload_0
    //   10: aload_1
    //   11: iconst_5
    //   12: invokestatic 306	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   15: invokevirtual 313	org/eclipse/team/ui/synchronize/ModelOperation:beginOperation	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   18: aload_0
    //   19: aload_1
    //   20: bipush 90
    //   22: invokestatic 306	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   25: invokevirtual 315	org/eclipse/team/ui/synchronize/ModelOperation:execute	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   28: goto +21 -> 49
    //   31: astore_2
    //   32: aload_0
    //   33: aload_1
    //   34: iconst_5
    //   35: invokestatic 306	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   38: invokevirtual 314	org/eclipse/team/ui/synchronize/ModelOperation:endOperation	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   41: aload_1
    //   42: invokeinterface 344 1 0
    //   47: aload_2
    //   48: athrow
    //   49: aload_0
    //   50: aload_1
    //   51: iconst_5
    //   52: invokestatic 306	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   55: invokevirtual 314	org/eclipse/team/ui/synchronize/ModelOperation:endOperation	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   58: aload_1
    //   59: invokeinterface 344 1 0
    //   64: return
    // Line number table:
    //   Java source line #104	-> byte code offset #0
    //   Java source line #105	-> byte code offset #9
    //   Java source line #106	-> byte code offset #18
    //   Java source line #107	-> byte code offset #31
    //   Java source line #108	-> byte code offset #32
    //   Java source line #109	-> byte code offset #41
    //   Java source line #110	-> byte code offset #47
    //   Java source line #108	-> byte code offset #49
    //   Java source line #109	-> byte code offset #58
    //   Java source line #111	-> byte code offset #64
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	65	0	this	ModelOperation
    //   0	65	1	monitor	IProgressMonitor
    //   31	17	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	31	31	finally
  }
  
  protected void beginOperation(IProgressMonitor monitor)
    throws InvocationTargetException
  {
    initializeScope(monitor);
  }
  
  protected void endOperation(IProgressMonitor monitor)
    throws InvocationTargetException
  {}
  
  protected final void initializeScope(IProgressMonitor monitor)
    throws InvocationTargetException
  {
    try
    {
      if (!manager.isInitialized())
      {
        manager.initialize(monitor);
        promptIfInputChange(monitor);
      }
    }
    catch (CoreException e)
    {
      throw new InvocationTargetException(e);
    }
  }
  
  protected void promptIfInputChange(IProgressMonitor monitor)
  {
    ISynchronizationScope inputScope = getScope().asInputScope();
    if (getScope().hasAdditionalMappings())
    {
      boolean prompt = false;
      
      ModelProvider[] inputModelProviders = inputScope.getModelProviders();
      if (hasAdditionalMappingsFromIndependantModel(inputModelProviders, getScope().getModelProviders()))
      {
        prompt = true;
      }
      else if (getScope().hasAdditonalResources())
      {
        prompt = true;
      }
      else if (inputModelProviders.length == 1)
      {
        String modelProviderId = inputModelProviders[0].getDescriptor().getId();
        ResourceMapping[] mappings = getScope().getMappings();
        for (int i = 0; i < mappings.length; i++)
        {
          ResourceMapping mapping = mappings[i];
          if (inputScope.getTraversals(mapping) == null)
          {
            String id = mapping.getModelProviderId();
            if ((id.equals(modelProviderId)) && (!modelProviderId.equals("org.eclipse.core.resources.modelProvider")))
            {
              prompt = true;
              break;
            }
            if (isIndependantModel(modelProviderId, id))
            {
              prompt = true;
              break;
            }
          }
        }
      }
      else
      {
        for (int i = 0; i < inputModelProviders
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

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