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

irstElement());
    return input.equals(selectionAsInput);
  }
  
  private static IEditorInput getEditorInput(Object input)
  {
    IResource[] resources = Utils.getContributedResources(new Object[] { input });
    if (resources.length > 0) {
      input = resources[0];
    }
    if ((input instanceof IFile)) {
      return new FileEditorInput((IFile)input);
    }
    return null;
  }
  
  private Object getInputFromEditor(IEditorInput editorInput)
  {
    Object input = editorInput.getAdapter(IFile.class);
    if ((input == null) && ((editorInput instanceof FileRevisionEditorInput)))
    {
      IFileRevision fileRevision = ((FileRevisionEditorInput)editorInput).getFileRevision();
      if ((fileRevision instanceof ResourceVariantFileRevision)) {
        return ((ResourceVariantFileRevision)fileRevision).getVariant();
      }
    }
    if ((input == null) && ((editorInput instanceof IStorageEditorInput))) {
      try
      {
        input = ((IStorageEditorInput)editorInput).getStorage();
      }
      catch (CoreException localCoreException) {}
    }
    return input;
  }
  
  private static IEditorPart isOpenInEditor(Object inputElement)
  {
    IEditorInput input = getEditorInput(inputElement);
    if (input != null)
    {
      IWorkbenchPage p = TeamUIPlugin.getActivePage();
      if (p != null)
      {
        IEditorPart editor = p.findEditor(input);
        if (editor == null)
        {
          IEditorReference[] er = p.getEditorReferences();
          for (int i = 0; i < er.length; i++) {
            if ((er[i].getId().equals(
              "org.eclipse.compare.CompareEditor")) && (matches(er[i], input))) {
              editor = er[i].getEditor(false);
            }
          }
        }
        return editor;
      }
    }
    return null;
  }
  
  private static boolean matches(IEditorReference editorRef, IEditorInput input)
  {
    if ((input instanceof FileEditorInput))
    {
      IFile file = ((FileEditorInput)input).getFile();
      
      CompareEditorInput cei = (CompareEditorInput)((EditorPart)editorRef
        .getPart(false)).getEditorInput();
      Object compareResult = cei.getCompareResult();
      if ((compareResult instanceof IAdaptable))
      {
        IResource r = (IResource)((IAdaptable)compareResult)
          .getAdapter(IResource.class);
        if (r != null) {
          return file.equals(r);
        }
      }
      if ((compareResult instanceof ICompareInput))
      {
        ICompareInput compareInput = (ICompareInput)compareResult;
        ITypedElement left = compareInput.getLeft();
        if (((left instanceof ResourceNode)) && 
          (file.equals(((ResourceNode)left).getResource()))) {
          return true;
        }
        ITypedElement right = compareInput.getRight();
        if (((right instanceof ResourceNode)) && 
          (file.equals(((ResourceNode)right).getResource()))) {
          return true;
        }
      }
    }
    return false;
  }
  
  private static IEditorPart openInEditor(IFile file, boolean activate)
    throws PartInitException
  {
    if (file == null) {
      throwPartInitException(TeamUIMessages.SynchronizeView_fileMustNotBeNull);
    }
    IWorkbenchPage p = TeamUIPlugin.getActivePage();
    if (p == null) {
      throwPartInitException(TeamUIMessages.SynchronizeView_noActiveWorkbenchPage);
    }
    IEditorPart editorPart = IDE.openEditor(p, file, activate);
    return editorPart;
  }
  
  private static void throwPartInitException(String message)
    throws PartInitException
  {
    IStatus status = new Status(4, "org.eclipse.team.ui", 0, message, null);
    throw new PartInitException(status);
  }
  
  private static Object getSingleElement(ISelection s)
  {
    if (!(s instanceof IStructuredSelection)) {
      return null;
    }
    IStructuredSelection selection = (IStructuredSelection)s;
    if (selection.size() != 1) {
      return null;
    }
    return selection.getFirstElement();
  }
  
  public boolean show(ShowInContext context)
  {
    Object selection = getSingleElement(context.getSelection());
    if (selection != null) {
      if (showInput(selection)) {
        return true;
      }
    }
    Object input = context.getInput();
    if (input != null)
    {
      if ((input instanceof IEditorInput)) {
        return showInput(getInputFromEditor((IEditorInput)input));
      }
      return showInput(input);
    }
    return false;
  }
  
  public IAction getPastePatchAction()
  {
    return fPastePatchAction;
  }
}

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

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;

public class SynchronizeViewWorkbenchPart
  implements IWorkbenchPart
{
  private ISynchronizeParticipant participant;
  private IWorkbenchPartSite site;
  private ISynchronizePageConfiguration configuration;
  
  public boolean equals(Object obj)
  {
    return ((obj instanceof SynchronizeViewWorkbenchPart)) && (participant.equals(((SynchronizeViewWorkbenchPart)obj).getParticipant()));
  }
  
  public int hashCode()
  {
    return participant.hashCode();
  }
  
  public SynchronizeViewWorkbenchPart(ISynchronizeParticipant participant, IWorkbenchPartSite site)
  {
    this.participant = participant;
    this.site = site;
  }
  
  public void addPropertyListener(IPropertyListener listener) {}
  
  public void createPartControl(Composite parent) {}
  
  public void dispose() {}
  
  public IWorkbenchPartSite getSite()
  {
    return site;
  }
  
  public String getTitle()
  {
    return "";
  }
  
  public Image getTitleImage()
  {
    return null;
  }
  
  public String getTitleToolTip()
  {
    return "";
  }
  
  public void removePropertyListener(IPropertyListener listener) {}
  
  public void setFocus() {}
  
  public Object getAdapter(Class adapter)
  {
    return null;
  }
  
  public ISynchronizeParticipant getParticipant()
  {
    return participant;
  }
  
  public void setConfiguration(ISynchronizePageConfiguration configuration)
  {
    this.configuration = configuration;
  }
  
  public ISynchronizePageConfiguration getConfiguration()
  {
    return configuration;
  }
}

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

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class TeamSynchronizingPerspective
  implements IPerspectiveFactory
{
  public static final String ID = "org.eclipse.team.ui.TeamSynchronizingPerspective";
  
  public void createInitialLayout(IPageLayout layout)
  {
    defineActions(layout);
    defineLayout(layout);
  }
  
  public void defineActions(IPageLayout layout)
  {
    layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.project");
    layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");
    layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");
    
    layout.addShowViewShortcut("org.eclipse.team.sync.views.SynchronizeView");
    layout.addShowViewShortcut("org.eclipse.ui.navigator.ProjectExplorer");
    layout.addShowViewShortcut("org.eclipse.ui.views.ContentOutline");
    layout.addShowViewShortcut("org.eclipse.ui.views.TaskList");
    layout.addShowViewShortcut("org.eclipse.ui.views.ProblemView");
    
    layout.addActionSet("org.eclipse.team.ui.actionSet");
    
    layout.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective");
  }
  
  public void defineLayout(IPageLayout layout)
  {
    String editorArea = layout.getEditorArea();
    IFolderLayout top = layout.createFolder("top", 1, 0.45F, editorArea);
    top.addView("org.eclipse.team.sync.views.SynchronizeView");
    IFolderLayout top2 = layout.createFolder("top2", 4, 0.8F, editorArea);
    top2.addView("org.eclipse.team.ui.GenericHistoryView");
    top2.addView("org.eclipse.ui.views.TaskList");
    top2.addView("org.eclipse.ui.views.ProblemView");
    layout.setEditorAreaVisible(true);
  }
}

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

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;

class TreeViewerAdvisor$1
  implements ISelectionChangedListener
{
  final TreeViewerAdvisor this$0;
  
  TreeViewerAdvisor$1(TreeViewerAdvisor paramTreeViewerAdvisor)
  {
    this$0 = paramTreeViewerAdvisor;
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    this$0.updateStatusLine((IStructuredSelection)event.getSelection());
  }
}

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

import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

class TreeViewerAdvisor$2
  implements ICompareInputChangeListener
{
  final TreeViewerAdvisor this$0;
  private final ISynchronizeModelElement val$modelRoot;
  
  TreeViewerAdvisor$2(TreeViewerAdvisor paramTreeViewerAdvisor, ISynchronizeModelElement paramISynchronizeModelElement)
  {
    this$0 = paramTreeViewerAdvisor;val$modelRoot = paramISynchronizeModelElement;
  }
  
  public void compareInputChanged(ICompareInput source)
  {
    this$0.getActionGroup().modelChanged(val$modelRoot);
  }
}

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

import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;

class TreeViewerAdvisor$3
  implements IPropertyChangeListener
{
  final TreeViewerAdvisor this$0;
  private final StructuredViewer val$viewer;
  private final ISynchronizeModelProvider val$modelProvider;
  
  TreeViewerAdvisor$3(TreeViewerAdvisor paramTreeViewerAdvisor, StructuredViewer paramStructuredViewer, ISynchronizeModelProvider paramISynchronizeModelProvider)
  {
    this$0 = paramTreeViewerAdvisor;val$viewer = paramStructuredViewer;val$modelProvider = paramISynchronizeModelProvider;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if ((event.getProperty() == "org.eclipse.team.ui.P_VIEWER_SORTER") && 
      (val$viewer != null) && (!val$viewer.getControl().isDisposed())) {
      val$viewer.getControl().getDisplay().syncExec(new TreeViewerAdvisor.4(this, val$viewer, val$modelProvider));
    }
  }
}

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

import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.widgets.Control;

class TreeViewerAdvisor$4
  implements Runnable
{
  final TreeViewerAdvisor.3 this$1;
  private final StructuredViewer val$viewer;
  private final ISynchronizeModelProvider val$modelProvider;
  
  TreeViewerAdvisor$4(TreeViewerAdvisor.3 param3, StructuredViewer paramStructuredViewer, ISynchronizeModelProvider paramISynchronizeModelProvider)
  {
    this$1 = param3;val$viewer = paramStructuredViewer;val$modelProvider = paramISynchronizeModelProvider;
  }
  
  public void run()
  {
    if ((val$viewer != null) && (!val$viewer.getControl().isDisposed()))
    {
      ViewerSorter newSorter = val$modelProvider.getViewerSorter();
      ViewerSorter oldSorter = val$viewer.getSorter();
      if (newSorter == oldSorter) {
        val$viewer.refresh();
      } else {
        val$viewer.setSorter(newSorter);
      }
    }
  }
}

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

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.ui.part.ResourceTransfer;

class TreeViewerAdvisor$5
  implements DragSourceListener
{
  final TreeViewerAdvisor this$0;
  private final StructuredViewer val$viewer;
  
  TreeViewerAdvisor$5(TreeViewerAdvisor paramTreeViewerAdvisor, StructuredViewer paramStructuredViewer)
  {
    this$0 = paramTreeViewerAdvisor;val$viewer = paramStructuredViewer;
  }
  
  public void dragStart(DragSourceEvent event)
  {
    IStructuredSelection selection = (IStructuredSelection)val$viewer.getSelection();
    Object[] array = selection.toArray();
    doit = (Utils.getResources(array).length > 0);
  }
  
  public void dragSetData(DragSourceEvent event)
  {
    if (ResourceTransfer.getInstance().isSupportedType(dataType))
    {
      IStructuredSelection selection = (IStructuredSelection)val$viewer.getSelection();
      Object[] array = selection.toArray();
      data = Utils.getResources(array);
    }
  }
  
  public void dragFinished(DragSourceEvent event) {}
}

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

import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;

public class TreeViewerAdvisor$NavigableCheckboxTreeViewer
  extends ContainerCheckedTreeViewer
  implements AbstractTreeViewerAdvisor.ITreeViewerAccessor
{
  public TreeViewerAdvisor$NavigableCheckboxTreeViewer(Composite parent, int style)
  {
    super(parent, style);
    setUseHashlookup(true);
  }
  
  public void createChildren(TreeItem item)
  {
    super.createChildren(item);
  }
  
  public void openSelection()
  {
    fireOpen(new OpenEvent(this, getSelection()));
  }
}

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

import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TreeItem;

public class TreeViewerAdvisor$NavigableTreeViewer
  extends TreeViewer
  implements AbstractTreeViewerAdvisor.ITreeViewerAccessor
{
  public TreeViewerAdvisor$NavigableTreeViewer(Composite parent, int style)
  {
    super(parent, style);
    setUseHashlookup(true);
  }
  
  public void createChildren(TreeItem item)
  {
    super.createChildren(item);
  }
  
  public void openSelection()
  {
    fireOpen(new OpenEvent(this, getSelection()));
  }
}

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

import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.synchronize.actions.StatusLineContributionGroup;
import org.eclipse.team.internal.ui.synchronize.actions.SyncInfoSetStatusLineContributionGroup;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizePageSite;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
import org.eclipse.ui.part.ResourceTransfer;

public class TreeViewerAdvisor
  extends AbstractTreeViewerAdvisor
{
  private StatusLineContributionGroup statusLine;
  public static final int CHECKBOX = 1;
  private SynchronizeModelManager modelManager;
  
  public static class NavigableCheckboxTreeViewer
    extends ContainerCheckedTreeViewer
    implements AbstractTreeViewerAdvisor.ITreeViewerAccessor
  {
    public NavigableCheckboxTreeViewer(Composite parent, int style)
    {
      super(style);
      setUseHashlookup(true);
    }
    
    public void createChildren(TreeItem item)
    {
      super.createChildren(item);
    }
    
    public void openSelection()
    {
      fireOpen(new OpenEvent(this, getSelection()));
    }
  }
  
  public static class NavigableTreeViewer
    extends TreeViewer
    implements AbstractTreeViewerAdvisor.ITreeViewerAccessor
  {
    public NavigableTreeViewer(Composite parent, int style)
    {
      super(style);
      setUseHashlookup(true);
    }
    
    public void createChildren(TreeItem item)
    {
      super.createChildren(item);
    }
    
    public void openSelection()
    {
      fireOpen(new OpenEvent(this, getSelection()));
    }
  }
  
  public static StructuredViewer createViewer(Composite parent, ISynchronizePageConfiguration configuration)
  {
    int style = ((SynchronizePageConfiguration)configuration).getViewerStyle();
    if ((style & 0x1) > 0)
    {
      NavigableCheckboxTreeViewer v = new NavigableCheckboxTreeViewer(parent, 770);
      configuration.getSite().setSelectionProvider(v);
      return v;
    }
    NavigableTreeViewer v = new NavigableTreeViewer(parent, 770);
    configuration.getSite().setSelectionProvider(v);
    return v;
  }
  
  public TreeViewerAdvisor(Composite parent, ISynchronizePageConfiguration configuration)
  {
    super(configuration);
    
    modelManager = ((SynchronizeModelManager)configuration.getProperty("org.eclipse.team.ui.P_MODEL_MANAGER"));
    if (modelManager == null)
    {
      modelManager = createModelManager(configuration);
      configuration.setProperty("org.eclipse.team.ui.P_MODEL_MANAGER", modelManager);
    }
    Assert.isNotNull(modelManager, "model manager must be set");
    modelManager.setViewerAdvisor(this);
    
    StructuredViewer viewer = createViewer(parent, configuration);
    GridData data = new GridData(1808);
    viewer.getControl().setLayoutData(data);
    initializeViewer(viewer);
  }
  
  public void setInitialInput() {}
  
  protected SynchronizeModelManager createModelManager(ISynchronizePageConfiguration configuration)
  {
    ISynchronizeParticipant participant = configuration.getParticipant();
    if ((participant instanceof IChangeSetProvider))
    {
      IChangeSetProvider provider = (IChangeSetProvider)participant;
      ChangeSetCapability changeSetCapability = provider.getChangeSetCapability();
      if ((changeSetCapability != null) && (
        (changeSetCapability.supportsActiveChangeSets()) || (changeSetCapability.supportsCheckedInChangeSets()))) {
        return new ChangeSetModelManager(configuration);
      }
    }
    return new HierarchicalModelManager(configuration);
  }
  
  public SynchronizeModelManager getModelManager()
  {
    return modelManager;
  }
  
  public boolean validateViewer(StructuredViewer viewer)
  {
    return viewer instanceof AbstractTreeViewer;
  }
  
  protected void initializeListeners(StructuredViewer viewer)
  {
    super.initializeListeners(viewer);
    viewer.addSelectionChangedListener(new ISelectionChangedListener()
    {
      public void selectionChanged(SelectionChangedEvent event)
      {
        updateStatusLine((IStructuredSelection)event.getSelection());
      }
    });
  }
  
  void updateStatusLine(IStructuredSelection selection)
  {
    IWorkbenchSite ws = getConfiguration().getSite().getWorkbenchSite();
    if ((ws != null) && ((ws instanceof IViewSite)))
    {
      String msg = getStatusLineMessage(selection);
      ((IViewSite)ws).getActionBars().getStatusLineManager().setMessage(msg);
    }
  }
  
  private String getStatusLineMessage(IStructuredSelection selection)
  {
    if (selection.size() == 1)
    {
      Object first = selection.getFirstElement();
      if ((first instanceof SyncInfoModelElement))
      {
        SyncInfoModelElement node = (SyncInfoModelElement)first;
        IResource resource = node.getResource();
        if (resource == null) {
          return node.getName();
        }
        return resource.getFullPath().makeRelative().toString();
      }
    }
    if (selection.size() > 1) {
      return selection.size() + TeamUIMessages.SynchronizeView_13;
    }
    return "";
  }
  
  public final void setInput(ISynchronizeModelProvider modelProvider)
  {
    ISynchronizeModelElement modelRoot = modelProvider.getModelRoot();
    getActionGroup().modelChanged(modelRoot);
    modelRoot.addCompareInputChangeListener(new ICompareInputChangeListener()
    {
      private final ISynchronizeModelElement val$modelRoot;
      
      public void compareInputChanged(ICompareInput source)
      {
        getActionGroup().modelChanged(val$modelRoot);
      }
    });
    StructuredViewer viewer = getViewer();
    if (viewer != null)
    {
      viewer.setSorter(modelProvider.getViewerSorter());
      viewer.setInput(modelRoot);
      modelProvider.addPropertyChangeListener(new IPropertyChangeListener()
      {
        private final StructuredViewer val$viewer;
        private final ISynchronizeModelProvider val$modelProvider;
        
        public void propertyChange(PropertyChangeEvent event)
        {
          if ((event.getProperty() == "org.eclipse.team.ui.P_VIEWER_SORTER") && 
            (val$viewer != null) && (!val$viewer.getControl().isDisposed())) {
            val$viewer.getControl().getDisplay().syncExec(new TreeViewerAdvisor.4(this, val$viewer, val$modelProvider));
          }
        }
      });
    }
  }
  
  public final void initializeViewer(StructuredViewer viewer)
  {
    super.initializeViewer(viewer);
    
    DragSourceListener listener = new DragSourceListener()
    {
      private final StructuredViewer val$viewer;
      
      public void dragStart(DragSourceEvent event)
      {
        IStructuredSelection selection = (IStructuredSelection)val$viewer.getSelection();
        Object[] array = selection.toArray();
        doit = (Utils.getResources(array).length > 0);
      }
      
      public void dragSetData(DragSourceEvent event)
      {
        if (ResourceTransfer.getInstance().isSupportedType(dataType))
        {
          IStructuredSelection selection = (IStructuredSelection)val$viewer.getSelection();
          Object[] array = selection.toArray();
          data = Utils.getResources(array);
        }
      }
      
      public void dragFinished(DragSourceEvent event) {}
    };
    viewer.addDragSupport(5, new Transfer[] { ResourceTransfer.getInstance() }, listener);
    
    viewer.setLabelProvider(getLabelProvider());
    viewer.setContentProvider(getContentProvider());
  }
  
  protected IStructuredContentProvider getContentProvider()
  {
    return new BaseWorkbenchContentProvider();
  }
  
  protected ILabelProvider getLabelProvider()
  {
    ILabelProvider provider = new SynchronizeModelElementLabelProvider();
    ILabelDecorator[] decorators = (ILabelDecorator[])getConfiguration().getProperty("org.eclipse.team.ui.P_LABEL_DECORATORS");
    if (decorators == null) {
      return provider;
    }
    return new DecoratingColorLabelProvider(provider, decorators);
  }
  
  public void dispose()
  {
    if (statusLine != null) {
      statusLine.dispose();
    }
    super.dispose();
  }
  
  protected void initializeStatusLine(IActionBars actionBars)
  {
    statusLine = new SyncInfoSetStatusLineContributionGroup(
      getConfiguration().getSite().getShell(), 
      getConfiguration());
    IStatusLineManager statusLineMgr = actionBars.getStatusLineManager();
    if ((statusLineMgr != null) && (statusLine != null)) {
      statusLine.fillActionBars(actionBars);
    }
  }
}

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

import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;

public class UnchangedResourceModelElement
  extends SynchronizeModelElement
{
  private final IResource resource;
  
  public UnchangedResourceModelElement(IDiffContainer parent, IResource resource)
  {
    super(parent);
    Assert.isNotNull(resource);
    this.resource = resource;
  }
  
  public IResource getResource()
  {
    return resource;
  }
  
  public String getName()
  {
    return resource.getName();
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;

public class WorkbenchAction
  extends Action
  implements ActionFactory.IWorkbenchAction
{
  public void dispose() {}
}

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

import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.ui.synchronize.ISynchronizePageSite;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.part.IPageSite;

public class WorkbenchPartSynchronizePageSite
  implements ISynchronizePageSite
{
  private IWorkbenchPart part;
  private IDialogSettings settings;
  private IPageSite site;
  
  public WorkbenchPartSynchronizePageSite(IWorkbenchPart part, IPageSite site, IDialogSettings settings)
  {
    this.part = part;
    this.site = site;
    this.settings = settings;
  }
  
  public IWorkbenchPart getPart()
  {
    return part;
  }
  
  public Shell getShell()
  {
    return part.getSite().getShell();
  }
  
  public ISelectionProvider getSelectionProvider()
  {
    return site.getSelectionProvider();
  }
  
  public void setSelectionProvider(ISelectionProvider provider)
  {
    site.setSelectionProvider(provider);
  }
  
  public IWorkbenchSite getWorkbenchSite()
  {
    return part.getSite();
  }
  
  public IKeyBindingService getKeyBindingService()
  {
    return part.getSite().getKeyBindingService();
  }
  
  public void setFocus()
  {
    part.getSite().getPage().activate(part);
  }
  
  public IDialogSettings getPageSettings()
  {
    return settings;
  }
  
  public IActionBars getActionBars()
  {
    return site.getActionBars();
  }
  
  public boolean isModal()
  {
    return false;
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;

class ChangeSetActionGroup$1
  extends SynchronizeModelOperation
{
  final ChangeSetActionGroup.CreateChangeSetAction this$1;
  
  ChangeSetActionGroup$1(ChangeSetActionGroup.CreateChangeSetAction paramCreateChangeSetAction, ISynchronizePageConfiguration $anonymous0, IDiffElement[] $anonymous1)
  {
    super($anonymous0, $anonymous1);this$1 = paramCreateChangeSetAction;
  }
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    ChangeSetActionGroup.access$2(ChangeSetActionGroup.CreateChangeSetAction.access$0(this$1), new ChangeSetActionGroup.2(this));
  }
}

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

import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSet;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSetManager;

class ChangeSetActionGroup$2
  implements Runnable
{
  final ChangeSetActionGroup.1 this$2;
  
  ChangeSetActionGroup$2(ChangeSetActionGroup.1 param1)
  {
    this$2 = param1;
  }
  
  public void run()
  {
    ActiveChangeSet set = ChangeSetActionGroup.access$1(ChangeSetActionGroup.CreateChangeSetAction.access$0(ChangeSetActionGroup.1.access$1(this$2)), ChangeSetActionGroup.access$0(ChangeSetActionGroup.CreateChangeSetAction.access$0(ChangeSetActionGroup.1.access$1(this$2)), ChangeSetActionGroup.1.access$0(this$2).getResources()));
    if (set != null) {
      ChangeSetActionGroup.CreateChangeSetAction.access$0(ChangeSetActionGroup.1.access$1(this$2)).getActiveChangeSetManager().add(set);
    }
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSet;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSetManager;
import org.eclipse.team.internal.core.subscribers.ChangeSet;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;

class ChangeSetActionGroup$3
  extends SynchronizeModelOperation
{
  final ChangeSetActionGroup.AddToChangeSetAction this$1;
  
  ChangeSetActionGroup$3(ChangeSetActionGroup.AddToChangeSetAction paramAddToChangeSetAction, ISynchronizePageConfiguration $anonymous0, IDiffElement[] $anonymous1)
  {
    super($anonymous0, $anonymous1);this$1 = paramAddToChangeSetAction;
  }
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    IResource[] resources = getSyncInfoSet().getResources();
    if (ChangeSetActionGroup.AddToChangeSetAction.access$0(this$1) != null)
    {
      IDiff[] diffArray = ChangeSetActionGroup.access$0(ChangeSetActionGroup.AddToChangeSetAction.access$1(this$1), resources);
      ChangeSetActionGroup.AddToChangeSetAction.access$0(this$1).add(diffArray);
    }
    else
    {
      ChangeSet[] sets = ChangeSetActionGroup.AddToChangeSetAction.access$1(this$1).getActiveChangeSetManager().getSets();
      for (int i = 0; i < sets.length; i++)
      {
        ActiveChangeSet activeSet = (ActiveChangeSet)sets[i];
        activeSet.remove(resources);
      }
    }
  }
}

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

import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;

class ChangeSetActionGroup$4
  implements IMenuListener
{
  final ChangeSetActionGroup this$0;
  
  ChangeSetActionGroup$4(ChangeSetActionGroup paramChangeSetActionGroup)
  {
    this$0 = paramChangeSetActionGroup;
  }
  
  public void menuAboutToShow(IMenuManager manager)
  {
    this$0.addChangeSets(manager);
  }
}

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

import java.text.Collator;
import java.util.Comparator;
import org.eclipse.team.internal.core.subscribers.ChangeSet;

class ChangeSetActionGroup$5
  implements Comparator
{
  private Collator collator;
  final ChangeSetActionGroup this$0;
  
  ChangeSetActionGroup$5(ChangeSetActionGroup paramChangeSetActionGroup)
  {
    this$0 = paramChangeSetActionGroup;
    collator = Collator.getInstance();
  }
  
  public int compare(Object o1, Object o2)
  {
    return collator.compare(((ChangeSet)o1).getName(), ((ChangeSet)o2).getName());
  }
}

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

import org.eclipse.swt.widgets.Control;

class ChangeSetActionGroup$6
  implements Runnable
{
  final ChangeSetActionGroup this$0;
  private final Control val$ctrl;
  private final Runnable val$runnable;
  
  ChangeSetActionGroup$6(ChangeSetActionGroup paramChangeSetActionGroup, Control paramControl, Runnable paramRunnable)
  {
    this$0 = paramChangeSetActionGroup;val$ctrl = paramControl;val$runnable = paramRunnable;
  }
  
  public void run()
  {
    if (!val$ctrl.isDisposed()) {
      val$runnable.run();
    }
  }
}

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

import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.jface.action.LegacyActionTools;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSet;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelAction;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;

class ChangeSetActionGroup$AddToChangeSetAction
  extends SynchronizeModelAction
{
  private final ActiveChangeSet set;
  final ChangeSetActionGroup this$0;
  
  public ChangeSetActionGroup$AddToChangeSetAction(ChangeSetActionGroup paramChangeSetActionGroup, ISynchronizePageConfiguration configuration, ActiveChangeSet set, ISelection selection)
  {
    super(set == null ? TeamUIMessages.ChangeSetActionGroup_2 : LegacyActionTools.escapeMnemonics(set.getTitle()), configuration);this$0 = paramChangeSetActionGroup;
    this.set = set;
    selectionChanged(selection);
  }
  
  protected FastSyncInfoFilter getSyncInfoFilter()
  {
    return ChangeSetActionGroup.OUTGOING_RESOURCE_FILTER;
  }
  
  protected boolean needsToSaveDirtyEditors()
  {
    return false;
  }
  
  protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements)
  {
    return new ChangeSetActionGroup.3(this, configuration, elements);
  }
}

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

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSet;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.ui.actions.BaseSelectionListenerAction;

abstract class ChangeSetActionGroup$ChangeSetAction
  extends BaseSelectionListenerAction
{
  final ChangeSetActionGroup this$0;
  
  public ChangeSetActionGroup$ChangeSetAction(ChangeSetActionGroup paramChangeSetActionGroup, String title, ISynchronizePageConfiguration configuration)
  {
    super(title);
    this$0 = paramChangeSetActionGroup;
  }
  
  protected boolean updateSelection(IStructuredSelection selection)
  {
    return getSelectedSet() != null;
  }
  
  protected ActiveChangeSet getSelectedSet()
  {
    IStructuredSelection selection = getStructuredSelection();
    if (selection.size() == 1)
    {
      Object first = selection.getFirstElement();
      if ((first instanceof IAdaptable))
      {
        Class tmp36_33 = ChangeSetActionGroup.class$0;
        if (tmp36_33 == null)
        {
          tmp36_33;
          try
          {
            tmpTernaryOp = (ChangeSetActionGroup.class$0 = Class.forName("org.eclipse.team.internal.core.subscribers.ChangeSet"));
          }
          catch (ClassNotFoundException localClassNotFoundException)
          {
            throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
          }
        }
        Object adapter = ((IAdaptable)first).getAdapter(tmp36_33);
        if ((adapter instanceof ActiveChangeSet)) {
          return (ActiveChangeSet)adapter;
        }
      }
    }
    return null;
  }
}

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

import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.FastSync
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