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

sor.setInitialInput();
  }
  
  protected abstract AbstractViewerAdvisor createViewerAdvisor(Composite paramComposite);
  
  public AbstractViewerAdvisor getViewerAdvisor()
  {
    return viewerAdvisor;
  }
  
  public void setActionBars(IActionBars actionBars)
  {
    viewerAdvisor.setActionBars(actionBars);
  }
  
  public Control getControl()
  {
    return composite;
  }
  
  public void setFocus()
  {
    changesSection.setFocus();
  }
  
  public void init(ISynchronizePageSite site)
  {
    this.site = site;
    IDialogSettings settings = getSettings();
    if (settings != null) {
      try
      {
        int mode = settings.getInt("org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE");
        if (mode != 0) {
          configuration.setMode(mode);
        }
      }
      catch (NumberFormatException localNumberFormatException) {}
    }
  }
  
  public void dispose()
  {
    changesSection.dispose();
    composite.dispose();
    super.dispose();
  }
  
  public Viewer getViewer()
  {
    return changesViewer;
  }
  
  public boolean aboutToChangeProperty(ISynchronizePageConfiguration configuration, String key, Object newValue)
  {
    if (key.equals("org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE")) {
      return internalSetMode(configuration.getMode(), ((Integer)newValue).intValue());
    }
    return true;
  }
  
  private boolean internalSetMode(int oldMode, int mode)
  {
    if (oldMode == mode) {
      return false;
    }
    updateMode(mode);
    IDialogSettings settings = getSettings();
    if (settings != null) {
      settings.put("org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE", mode);
    }
    return true;
  }
  
  public Object getAdapter(Class key)
  {
    if (key.equals(ISelectionProvider.class)) {
      return changesViewer;
    }
    if (key == IShowInSource.class) {
      new IShowInSource()
      {
        public ShowInContext getShowInContext()
        {
          StructuredViewer v = (StructuredViewer)changesViewer;
          if (v == null) {
            return null;
          }
          ISelection s = v.getSelection();
          if ((s instanceof IStructuredSelection))
          {
            Object[] resources = Utils.getResources(((IStructuredSelection)s).toArray());
            return new ShowInContext(null, new StructuredSelection(resources));
          }
          return null;
        }
      };
    }
    if (key == IShowInTargetList.class) {
      new IShowInTargetList()
      {
        public String[] getShowInTargetIds()
        {
          return new String[] { "org.eclipse.ui.views.ResourceNavigator" };
        }
      };
    }
    return null;
  }
  
  public ISynchronizePageSite getSynchronizePageSite()
  {
    return site;
  }
  
  public ISynchronizePageConfiguration getConfiguration()
  {
    return configuration;
  }
  
  protected IDialogSettings getSettings()
  {
    return configuration.getSite().getPageSettings();
  }
  
  public abstract void reset();
  
  protected abstract void updateMode(int paramInt);
  
  public ChangesSection getChangesSection()
  {
    return changesSection;
  }
}

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

import org.eclipse.compare.INavigatable;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Control;

class AbstractTreeViewerAdvisor$1
  implements INavigatable
{
  final AbstractTreeViewerAdvisor this$0;
  
  AbstractTreeViewerAdvisor$1(AbstractTreeViewerAdvisor paramAbstractTreeViewerAdvisor)
  {
    this$0 = paramAbstractTreeViewerAdvisor;
  }
  
  public boolean selectChange(int flag)
  {
    if (flag == 3)
    {
      this$0.getViewer().setSelection(StructuredSelection.EMPTY);
      flag = 1;
    }
    else if (flag == 4)
    {
      this$0.getViewer().setSelection(StructuredSelection.EMPTY);
      flag = 2;
    }
    return AbstractTreeViewerAdvisor.navigate((TreeViewer)this$0.getViewer(), flag == 1, true, false);
  }
  
  public boolean openSelectedChange()
  {
    Viewer v = this$0.getViewer();
    if (((v instanceof AbstractTreeViewerAdvisor.ITreeViewerAccessor)) && (!v.getControl().isDisposed()))
    {
      AbstractTreeViewerAdvisor.ITreeViewerAccessor tva = (AbstractTreeViewerAdvisor.ITreeViewerAccessor)v;
      tva.openSelection();
      return true;
    }
    return false;
  }
  
  public boolean hasChange(int changeFlag)
  {
    return this$0.hasChange(changeFlag == 1);
  }
  
  public Object getInput()
  {
    return this$0.getViewer().getInput();
  }
}

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

import org.eclipse.swt.widgets.TreeItem;

public abstract interface AbstractTreeViewerAdvisor$ITreeViewerAccessor
{
  public abstract void createChildren(TreeItem paramTreeItem);
  
  public abstract void openSelection();
}

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

import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.CompareNavigator;
import org.eclipse.compare.ICompareNavigator;
import org.eclipse.compare.INavigatable;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction;
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.ModelSynchronizeParticipant;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchSite;

class AbstractTreeViewerAdvisor$TreeCompareNavigator
  extends CompareNavigator
{
  final AbstractTreeViewerAdvisor this$0;
  
  private AbstractTreeViewerAdvisor$TreeCompareNavigator(AbstractTreeViewerAdvisor paramAbstractTreeViewerAdvisor)
  {
    this$0 = paramAbstractTreeViewerAdvisor;
  }
  
  AbstractTreeViewerAdvisor$TreeCompareNavigator(AbstractTreeViewerAdvisor paramAbstractTreeViewerAdvisor, TreeCompareNavigator paramTreeCompareNavigator)
  {
    this(paramAbstractTreeViewerAdvisor);
  }
  
  protected INavigatable[] getNavigatables()
  {
    INavigatable navigatable = AbstractTreeViewerAdvisor.access$0(this$0);
    return new INavigatable[] { navigatable };
  }
  
  public boolean selectChange(boolean next)
  {
    if ((getSubNavigator() != null) && 
      (getSubNavigator().hasChange(next)))
    {
      getSubNavigator().selectChange(next);
      return false;
    }
    boolean noNextChange = super.selectChange(next);
    if (!noNextChange)
    {
      Object selectedObject = AbstractTreeViewerAdvisor.access$1(this$0, (IStructuredSelection)this$0.getViewer().getSelection());
      if (!hasCompareInput(selectedObject)) {
        return selectChange(next);
      }
    }
    return noNextChange;
  }
  
  private boolean hasCompareInput(Object selectedObject)
  {
    SyncInfo syncInfo = getSyncInfo(selectedObject);
    if (syncInfo != null) {
      return syncInfo.getLocal().getType() == 1;
    }
    ISynchronizeParticipant p = this$0.getConfiguration().getParticipant();
    if ((p instanceof ModelSynchronizeParticipant))
    {
      ModelSynchronizeParticipant msp = (ModelSynchronizeParticipant)p;
      return msp.hasCompareInputFor(selectedObject);
    }
    return true;
  }
  
  private SyncInfo getSyncInfo(Object obj)
  {
    if ((obj instanceof SyncInfoModelElement)) {
      return ((SyncInfoModelElement)obj).getSyncInfo();
    }
    return null;
  }
  
  public boolean hasChange(boolean next)
  {
    if ((getSubNavigator() != null) && 
      (getSubNavigator().hasChange(next))) {
      return true;
    }
    return super.hasChange(next);
  }
  
  private CompareNavigator getSubNavigator()
  {
    IWorkbenchSite ws = this$0.getConfiguration().getSite().getWorkbenchSite();
    if ((ws instanceof IWorkbenchPartSite))
    {
      Object selectedObject = AbstractTreeViewerAdvisor.access$1(this$0, (IStructuredSelection)this$0.getViewer().getSelection());
      IEditorPart editor = OpenInCompareAction.findOpenCompareEditor((IWorkbenchPartSite)ws, selectedObject, this$0.getConfiguration().getParticipant());
      if (editor != null)
      {
        CompareEditorInput input = (CompareEditorInput)editor.getEditorInput();
        ICompareNavigator navigator = input.getNavigator();
        if ((navigator instanceof TreeCompareNavigator)) {
          navigator = (ICompareNavigator)this$0.getConfiguration().getProperty("org.eclipse.team.ui.P_INPUT_NAVIGATOR");
        }
        if ((navigator instanceof CompareNavigator)) {
          return (CompareNavigator)navigator;
        }
      }
    }
    return null;
  }
}

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

import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.CompareNavigator;
import org.eclipse.compare.ICompareNavigator;
import org.eclipse.compare.INavigatable;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction;
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.ModelSynchronizeParticipant;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchSite;

public abstract class AbstractTreeViewerAdvisor
  extends StructuredViewerAdvisor
  implements IAdaptable
{
  private ICompareNavigator nav;
  private INavigatable navigatable;
  
  public static abstract interface ITreeViewerAccessor
  {
    public abstract void createChildren(TreeItem paramTreeItem);
    
    public abstract void openSelection();
  }
  
  private class TreeCompareNavigator
    extends CompareNavigator
  {
    TreeCompareNavigator(TreeCompareNavigator paramTreeCompareNavigator)
    {
      this();
    }
    
    protected INavigatable[] getNavigatables()
    {
      INavigatable navigatable = AbstractTreeViewerAdvisor.this.getNavigatable();
      return new INavigatable[] { navigatable };
    }
    
    public boolean selectChange(boolean next)
    {
      if ((getSubNavigator() != null) && 
        (getSubNavigator().hasChange(next)))
      {
        getSubNavigator().selectChange(next);
        return false;
      }
      boolean noNextChange = super.selectChange(next);
      if (!noNextChange)
      {
        Object selectedObject = AbstractTreeViewerAdvisor.this.getFirstElement((IStructuredSelection)getViewer().getSelection());
        if (!hasCompareInput(selectedObject)) {
          return selectChange(next);
        }
      }
      return noNextChange;
    }
    
    private boolean hasCompareInput(Object selectedObject)
    {
      SyncInfo syncInfo = getSyncInfo(selectedObject);
      if (syncInfo != null) {
        return syncInfo.getLocal().getType() == 1;
      }
      ISynchronizeParticipant p = getConfiguration().getParticipant();
      if ((p instanceof ModelSynchronizeParticipant))
      {
        ModelSynchronizeParticipant msp = (ModelSynchronizeParticipant)p;
        return msp.hasCompareInputFor(selectedObject);
      }
      return true;
    }
    
    private SyncInfo getSyncInfo(Object obj)
    {
      if ((obj instanceof SyncInfoModelElement)) {
        return ((SyncInfoModelElement)obj).getSyncInfo();
      }
      return null;
    }
    
    public boolean hasChange(boolean next)
    {
      if ((getSubNavigator() != null) && 
        (getSubNavigator().hasChange(next))) {
        return true;
      }
      return super.hasChange(next);
    }
    
    private CompareNavigator getSubNavigator()
    {
      IWorkbenchSite ws = getConfiguration().getSite().getWorkbenchSite();
      if ((ws instanceof IWorkbenchPartSite))
      {
        Object selectedObject = AbstractTreeViewerAdvisor.this.getFirstElement((IStructuredSelection)getViewer().getSelection());
        IEditorPart editor = OpenInCompareAction.findOpenCompareEditor((IWorkbenchPartSite)ws, selectedObject, getConfiguration().getParticipant());
        if (editor != null)
        {
          CompareEditorInput input = (CompareEditorInput)editor.getEditorInput();
          ICompareNavigator navigator = input.getNavigator();
          if ((navigator instanceof TreeCompareNavigator)) {
            navigator = (ICompareNavigator)getConfiguration().getProperty("org.eclipse.team.ui.P_INPUT_NAVIGATOR");
          }
          if ((navigator instanceof CompareNavigator)) {
            return (CompareNavigator)navigator;
          }
        }
      }
      return null;
    }
    
    private TreeCompareNavigator() {}
  }
  
  private static boolean hasNextPrev(TreeViewer viewer, TreeItem item, boolean next)
  {
    if ((item == null) || (!(viewer instanceof ITreeViewerAccessor))) {
      return false;
    }
    TreeItem[] children = (TreeItem[])null;
    if (next)
    {
      if (viewer.isExpandable(item.getData())) {
        return true;
      }
      while (item != null)
      {
        parent = item.getParentItem();
        if (parent != null) {
          children = parent.getItems();
        } else {
          children = item.getParent().getItems();
        }
        if ((children != null) && (children.length > 0))
        {
          if (children[(children.length - 1)] != item) {
            return true;
          }
          item = parent;
        }
      }
    }
    else
    {
      while (item != null)
      {
        TreeItem parent;
        TreeItem parent = item.getParentItem();
        if (parent != null) {
          children = parent.getItems();
        } else {
          children = item.getParent().getItems();
        }
        if ((children != null) && (children.length > 0))
        {
          if (children[0] != item) {
            return true;
          }
          item = parent;
        }
      }
    }
    return false;
  }
  
  private static TreeItem findNextPrev(TreeViewer viewer, TreeItem item, boolean next)
  {
    if ((item == null) || (!(viewer instanceof ITreeViewerAccessor))) {
      return null;
    }
    TreeItem[] children = (TreeItem[])null;
    ITreeViewerAccessor treeAccessor = (ITreeViewerAccessor)viewer;
    if (!next)
    {
      TreeItem parent = item.getParentItem();
      if (parent != null) {
        children = parent.getItems();
      } else {
        children = item.getParent().getItems();
      }
      if ((children != null) && (children.length > 0))
      {
        for (int index = 0; index < children.length; index++) {
          if (children[index] == item) {
            break;
          }
        }
        if (index > 0)
        {
          item = children[(index - 1)];
          for (;;)
          {
            treeAccessor.createChildren(item);
            int n = item.getItemCount();
            if (n <= 0) {
              break;
            }
            item.setExpanded(true);
            item = item.getItems()[(n - 1)];
          }
          return item;
        }
      }
      return parent;
    }
    item.setExpanded(true);
    treeAccessor.createChildren(item);
    if (item.getItemCount() > 0)
    {
      children = item.getItems();
      return children[0];
    }
    while (item != null)
    {
      children = (TreeItem[])null;
      TreeItem parent = item.getParentItem();
      if (parent != null) {
        children = parent.getItems();
      } else {
        children = item.getParent().getItems();
      }
      if ((children != null) && (children.length > 0))
      {
        for (int index = 0; index < children.length; index++) {
          if (children[index] == item) {
            break;
          }
        }
        if (index < children.length - 1) {
          return children[(index + 1)];
        }
      }
      item = parent;
    }
    return item;
  }
  
  private static void setSelection(TreeViewer viewer, TreeItem ti, boolean fireOpen, boolean expandOnly)
  {
    if (ti != null)
    {
      Object data = ti.getData();
      if (data != null)
      {
        ISelection selection = new StructuredSelection(data);
        if (expandOnly)
        {
          viewer.expandToLevel(data, 0);
        }
        else
        {
          viewer.setSelection(selection, true);
          ISelection currentSelection = viewer.getSelection();
          if ((fireOpen) && (currentSelection != null) && (selection.equals(currentSelection)) && 
            ((viewer instanceof ITreeViewerAccessor))) {
            ((ITreeViewerAccessor)viewer).openSelection();
          }
        }
      }
    }
  }
  
  public static boolean navigate(TreeViewer viewer, boolean next, boolean fireOpen, boolean expandOnly)
  {
    Tree tree = viewer.getTree();
    if (tree == null) {
      return false;
    }
    TreeItem item = getNextItem(viewer, next);
    if (item != null) {
      setSelection(viewer, item, fireOpen, expandOnly);
    }
    return item == null;
  }
  
  private static TreeItem getNextItem(TreeViewer viewer, boolean next)
  {
    TreeItem item = getCurrentItem(viewer);
    if (item != null) {
      do
      {
        item = findNextPrev(viewer, item, next);
      } while ((item != null) && 
      
        (item.getItemCount() > 0));
    }
    return item;
  }
  
  private static TreeItem getCurrentItem(TreeViewer viewer)
  {
    Tree tree = viewer.getTree();
    if (tree == null) {
      return null;
    }
    TreeItem item = null;
    TreeItem[] children = tree.getSelection();
    if ((children != null) && (children.length > 0)) {
      item = children[0];
    }
    if (item == null)
    {
      children = tree.getItems();
      if ((children != null) && (children.length > 0)) {
        item = children[0];
      }
    }
    return item;
  }
  
  private static boolean hasChange(TreeViewer viewer, boolean next)
  {
    TreeItem item = getCurrentItem(viewer);
    if (item != null) {
      return hasNextPrev(viewer, item, next);
    }
    return false;
  }
  
  public AbstractTreeViewerAdvisor(ISynchronizePageConfiguration configuration)
  {
    super(configuration);
    ICompareNavigator nav = (ICompareNavigator)configuration.getProperty("org.eclipse.team.ui.P_NAVIGATOR");
    if (nav == null) {
      configuration.setProperty("org.eclipse.team.ui.P_NAVIGATOR", getAdapter(ICompareNavigator.class));
    }
    configuration.addActionContribution(new NavigationActionGroup());
  }
  
  public boolean navigate(boolean next)
  {
    return navigate((TreeViewer)getViewer(), next, false, false);
  }
  
  protected boolean hasChange(boolean next)
  {
    return hasChange((TreeViewer)getViewer(), next);
  }
  
  public Object getAdapter(Class adapter)
  {
    if (adapter == ICompareNavigator.class)
    {
      if (nav == null) {
        nav = new TreeCompareNavigator(null);
      }
      return nav;
    }
    if (adapter == INavigatable.class) {
      return getNavigatable();
    }
    return null;
  }
  
  private synchronized INavigatable getNavigatable()
  {
    if (navigatable == null) {
      navigatable = new INavigatable()
      {
        public boolean selectChange(int flag)
        {
          if (flag == 3)
          {
            getViewer().setSelection(StructuredSelection.EMPTY);
            flag = 1;
          }
          else if (flag == 4)
          {
            getViewer().setSelection(StructuredSelection.EMPTY);
            flag = 2;
          }
          return AbstractTreeViewerAdvisor.navigate((TreeViewer)getViewer(), flag == 1, true, false);
        }
        
        public boolean openSelectedChange()
        {
          Viewer v = getViewer();
          if (((v instanceof AbstractTreeViewerAdvisor.ITreeViewerAccessor)) && (!v.getControl().isDisposed()))
          {
            AbstractTreeViewerAdvisor.ITreeViewerAccessor tva = (AbstractTreeViewerAdvisor.ITreeViewerAccessor)v;
            tva.openSelection();
            return true;
          }
          return false;
        }
        
        public boolean hasChange(int changeFlag)
        {
          return hasChange(changeFlag == 1);
        }
        
        public Object getInput()
        {
          return getViewer().getInput();
        }
      };
    }
    return navigatable;
  }
  
  protected boolean handleDoubleClick(StructuredViewer viewer, DoubleClickEvent event)
  {
    if (super.handleDoubleClick(viewer, event)) {
      return true;
    }
    IStructuredSelection selection = (IStructuredSelection)event.getSelection();
    Object element = getFirstElementOrPath(selection);
    AbstractTreeViewer treeViewer = (AbstractTreeViewer)getViewer();
    if (element != null) {
      if (treeViewer.getExpandedState(element)) {
        treeViewer.collapseToLevel(element, -1);
      } else {
        expandToNextDiff(element);
      }
    }
    return true;
  }
  
  private Object getFirstElementOrPath(IStructuredSelection selection)
  {
    if ((selection instanceof TreeSelection))
    {
      TreeSelection ts = (TreeSelection)selection;
      TreePath[] paths = ts.getPaths();
      if (paths.length > 0) {
        return paths[0];
      }
    }
    Object element = selection.getFirstElement();
    return element;
  }
  
  private Object getFirstElement(IStructuredSelection selection)
  {
    Object element = getFirstElementOrPath(selection);
    if ((element instanceof TreePath))
    {
      TreePath path = (TreePath)element;
      element = path.getLastSegment();
    }
    return element;
  }
  
  protected void expandToNextDiff(Object elementOrPath)
  {
    navigate((TreeViewer)getViewer(), true, false, true);
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.ui.IActionBars;

public abstract class AbstractViewerAdvisor
{
  private ISynchronizePageConfiguration configuration;
  private StructuredViewer viewer;
  
  public AbstractViewerAdvisor(ISynchronizePageConfiguration configuration)
  {
    this.configuration = configuration;
    configuration.setProperty("org.eclipse.team.ui.P_ADVISOR", this);
  }
  
  public ISynchronizePageConfiguration getConfiguration()
  {
    return configuration;
  }
  
  protected void initializeViewer(StructuredViewer viewer)
  {
    Assert.isTrue(this.viewer == null, "Can only be initialized once.");
    Assert.isTrue(validateViewer(viewer));
    this.viewer = viewer;
  }
  
  protected boolean validateViewer(StructuredViewer viewer)
  {
    return true;
  }
  
  public StructuredViewer getViewer()
  {
    return viewer;
  }
  
  public abstract void setActionBars(IActionBars paramIActionBars);
  
  public abstract void setInitialInput();
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.AbstractViewerAdvisor
 * 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.ISelectionProvider;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizePageSite;

class ActionDelegateWrapper$1
  implements DisposeListener
{
  final ActionDelegateWrapper this$0;
  private final ISynchronizePageConfiguration val$configuration;
  
  ActionDelegateWrapper$1(ActionDelegateWrapper paramActionDelegateWrapper, ISynchronizePageConfiguration paramISynchronizePageConfiguration)
  {
    this$0 = paramActionDelegateWrapper;val$configuration = paramISynchronizePageConfiguration;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    val$configuration.getSite().getSelectionProvider().removeSelectionChangedListener(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ActionDelegateWrapper.1
 * 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.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Control;
import org.eclipse.team.ui.synchronize.ISynchronizePage;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizePageSite;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPart;

public class ActionDelegateWrapper
  extends Action
  implements ISelectionChangedListener
{
  private IActionDelegate delegate;
  
  public ActionDelegateWrapper(IActionDelegate delegate, ISynchronizePageConfiguration configuration)
  {
    this.delegate = delegate;
    IWorkbenchPart part = configuration.getSite().getPart();
    if (part != null)
    {
      if ((delegate instanceof IObjectActionDelegate)) {
        ((IObjectActionDelegate)delegate).setActivePart(this, part);
      }
      if (((part instanceof IViewPart)) && 
        ((delegate instanceof IViewActionDelegate))) {
        ((IViewActionDelegate)delegate).init((IViewPart)part);
      }
      if (((part instanceof IEditorPart)) && 
        ((delegate instanceof IEditorActionDelegate))) {
        ((IEditorActionDelegate)delegate).setActiveEditor(this, (IEditorPart)part);
      }
    }
    initialize(configuration);
  }
  
  public ActionDelegateWrapper(IActionDelegate delegate, ISynchronizePageConfiguration configuration, String id)
  {
    this(delegate, configuration);
    setId(id);
    setActionDefinitionId(id);
  }
  
  protected void initialize(ISynchronizePageConfiguration configuration)
  {
    configuration.getSite().getSelectionProvider().addSelectionChangedListener(this);
    configuration.getPage().getViewer().getControl().addDisposeListener(new DisposeListener()
    {
      private final ISynchronizePageConfiguration val$configuration;
      
      public void widgetDisposed(DisposeEvent e)
      {
        val$configuration.getSite().getSelectionProvider().removeSelectionChangedListener(ActionDelegateWrapper.this);
      }
    });
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    getDelegate().selectionChanged(this, event.getSelection());
  }
  
  public void run()
  {
    getDelegate().run(this);
  }
  
  public IActionDelegate getDelegate()
  {
    return delegate;
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.core.subscribers.ChangeSet;
import org.eclipse.team.internal.core.subscribers.DiffChangeSet;
import org.eclipse.team.internal.core.subscribers.IChangeSetChangeListener;

class ActiveChangeSetCollector$1
  implements IChangeSetChangeListener
{
  final ActiveChangeSetCollector this$0;
  
  ActiveChangeSetCollector$1(ActiveChangeSetCollector paramActiveChangeSetCollector)
  {
    this$0 = paramActiveChangeSetCollector;
  }
  
  public void setAdded(ChangeSet set)
  {
    ActiveChangeSetCollector.access$0(this$0).performUpdate(new ActiveChangeSetCollector.2(this, set), 
    
      true, true);
  }
  
  public void defaultSetChanged(ChangeSet previousDefault, ChangeSet set)
  {
    ActiveChangeSetCollector.access$0(this$0).performUpdate(new ActiveChangeSetCollector.3(this, previousDefault, set), 
    
      true, true);
  }
  
  public void setRemoved(ChangeSet set)
  {
    ActiveChangeSetCollector.access$0(this$0).performUpdate(new ActiveChangeSetCollector.4(this, set), 
    
      true, true);
  }
  
  public void nameChanged(ChangeSet set)
  {
    ActiveChangeSetCollector.access$0(this$0).performUpdate(new ActiveChangeSetCollector.5(this, set), 
    
      true, true);
  }
  
  public void resourcesChanged(ChangeSet set, IPath[] paths)
  {
    List outOfSync = new ArrayList();
    for (int i = 0; i < paths.length; i++)
    {
      IPath path = paths[i];
      if (!((DiffChangeSet)set).contains(path))
      {
        SyncInfo info = this$0.getSyncInfo(path);
        if ((info != null) && (info.getKind() != 0)) {
          outOfSync.add(info);
        }
      }
    }
    if (!outOfSync.isEmpty()) {
      ActiveChangeSetCollector.access$0(this$0).performUpdate(new ActiveChangeSetCollector.6(this, outOfSync), 
      
        true, true);
    }
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.core.subscribers.ChangeSet;

class ActiveChangeSetCollector$2
  implements IWorkspaceRunnable
{
  final ActiveChangeSetCollector.1 this$1;
  private final ChangeSet val$set;
  
  ActiveChangeSetCollector$2(ActiveChangeSetCollector.1 param1, ChangeSet paramChangeSet)
  {
    this$1 = param1;val$set = paramChangeSet;
  }
  
  public void run(IProgressMonitor monitor)
  {
    ActiveChangeSetCollector.1.access$0(this$1).remove(val$set.getResources());
    ActiveChangeSetCollector.access$1(ActiveChangeSetCollector.1.access$0(this$1), val$set);
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.core.subscribers.ChangeSet;
import org.eclipse.team.internal.core.subscribers.IChangeSetChangeListener;

class ActiveChangeSetCollector$3
  implements IWorkspaceRunnable
{
  final ActiveChangeSetCollector.1 this$1;
  private final ChangeSet val$previousDefault;
  private final ChangeSet val$set;
  
  ActiveChangeSetCollector$3(ActiveChangeSetCollector.1 param1, ChangeSet paramChangeSet1, ChangeSet paramChangeSet2)
  {
    this$1 = param1;val$previousDefault = paramChangeSet1;val$set = paramChangeSet2;
  }
  
  public void run(IProgressMonitor monitor)
  {
    if (ActiveChangeSetCollector.access$2(ActiveChangeSetCollector.1.access$0(this$1)) != null) {
      ActiveChangeSetCollector.access$2(ActiveChangeSetCollector.1.access$0(this$1)).defaultSetChanged(val$previousDefault, val$set);
    }
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.core.subscribers.ChangeSet;

class ActiveChangeSetCollector$4
  implements IWorkspaceRunnable
{
  final ActiveChangeSetCollector.1 this$1;
  private final ChangeSet val$set;
  
  ActiveChangeSetCollector$4(ActiveChangeSetCollector.1 param1, ChangeSet paramChangeSet)
  {
    this$1 = param1;val$set = paramChangeSet;
  }
  
  public void run(IProgressMonitor monitor)
  {
    ActiveChangeSetCollector.1.access$0(this$1).remove(val$set);
    if (!val$set.isEmpty()) {
      ActiveChangeSetCollector.1.access$0(this$1).add(ActiveChangeSetCollector.access$3(ActiveChangeSetCollector.1.access$0(this$1), val$set).getSyncInfos());
    }
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.core.subscribers.ChangeSet;
import org.eclipse.team.internal.core.subscribers.IChangeSetChangeListener;

class ActiveChangeSetCollector$5
  implements IWorkspaceRunnable
{
  final ActiveChangeSetCollector.1 this$1;
  private final ChangeSet val$set;
  
  ActiveChangeSetCollector$5(ActiveChangeSetCollector.1 param1, ChangeSet paramChangeSet)
  {
    this$1 = param1;val$set = paramChangeSet;
  }
  
  public void run(IProgressMonitor monitor)
  {
    if (ActiveChangeSetCollector.access$2(ActiveChangeSetCollector.1.access$0(this$1)) != null) {
      ActiveChangeSetCollector.access$2(ActiveChangeSetCollector.1.access$0(this$1)).nameChanged(val$set);
    }
  }
}

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

import java.util.List;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.synchronize.SyncInfo;

class ActiveChangeSetCollector$6
  implements IWorkspaceRunnable
{
  final ActiveChangeSetCollector.1 this$1;
  private final List val$outOfSync;
  
  ActiveChangeSetCollector$6(ActiveChangeSetCollector.1 param1, List paramList)
  {
    this$1 = param1;val$outOfSync = paramList;
  }
  
  public void run(IProgressMonitor monitor)
  {
    ActiveChangeSetCollector.1.access$0(this$1).add((SyncInfo[])val$outOfSync.toArray(new SyncInfo[val$outOfSync.size()]));
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.diff.IDiffChangeEvent;
import org.eclipse.team.core.mapping.IResourceDiffTree;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.core.synchronize.SyncInfoTree;
import org.eclipse.team.internal.core.subscribers.ChangeSet;

class ActiveChangeSetCollector$7
  implements IWorkspaceRunnable
{
  final ActiveChangeSetCollector this$0;
  private final IDiffChangeEvent val$event;
  
  ActiveChangeSetCollector$7(ActiveChangeSetCollector paramActiveChangeSetCollector, IDiffChangeEvent paramIDiffChangeEvent)
  {
    this$0 = paramActiveChangeSetCollector;val$event = paramIDiffChangeEvent;
  }
  
  public void run(IProgressMonitor monitor)
  {
    ChangeSet changeSet = ActiveChangeSetCollector.access$4(this$0, val$event.getTree());
    if (changeSet != null)
    {
      SyncInfoSet targetSet = this$0.getSyncInfoSet(changeSet);
      if (targetSet != null)
      {
        targetSet.removeAll(this$0.getResources(targetSet, val$event.getRemovals()));
        targetSet.addAll(ActiveChangeSetCollector.access$5(this$0, val$event.getAdditions()));
        targetSet.addAll(ActiveChangeSetCollector.access$5(this$0, val$event.getChanges()));
        ActiveChangeSetCollector.access$6(this$0).removeAll(((IResourceDiffTree)val$event.getTree()).getAffectedResources());
      }
    }
  }
}

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IDiffChangeEvent;
import org.eclipse.team.core.diff.IDiffChangeListener;
import org.eclipse.team.core.diff.IDiffTree;
import org.eclipse.team.core.mapping.IResourceDiffTree;
import org.eclipse.team.core.mapping.provider.ResourceDiffTree;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.ISyncInfoSetChangeEvent;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.core.synchronize.SyncInfoTree;
import org.eclipse.team.core.variants.IResourceVariantComparator;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSetManager;
import org.eclipse.team.internal.core.subscribers.ChangeSet;
import org.eclipse.team.internal.core.subscribers.DiffChangeSet;
import org.eclipse.team.internal.core.subscribers.IChangeSetChangeListener;
import org.eclipse.team.internal.core.subscribers.SubscriberChangeSetManager;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.SubscriberParticipant;

public class ActiveChangeSetCollector
  implements IDiffChangeListener
{
  private final ISynchronizePageConfiguration configuration;
  private final Map activeSets = new HashMap();
  private SyncInfoTree rootSet = new SyncInfoTree();
  private final ChangeSetModelProvider provider;
  private IChangeSetChangeListener activeChangeSetListener = new IChangeSetChangeListener()
  {
    public void setAdded(ChangeSet set)
    {
      provider.performUpdate(new ActiveChangeSetCollector.2(this, set), 
      
        true, true);
    }
    
    public void defaultSetChanged(ChangeSet previousDefault, ChangeSet set)
    {
      provider.performUpdate(new ActiveChangeSetCollector.3(this, previousDefault, set), 
      
       
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