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

 true, true);
    }
    
    public void setRemoved(ChangeSet set)
    {
      provider.performUpdate(new ActiveChangeSetCollector.4(this, set), 
      
        true, true);
    }
    
    public void nameChanged(ChangeSet set)
    {
      provider.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 = getSyncInfo(path);
          if ((info != null) && (info.getKind() != 0)) {
            outOfSync.add(info);
          }
        }
      }
      if (!outOfSync.isEmpty()) {
        provider.performUpdate(new ActiveChangeSetCollector.6(this, outOfSync), 
        
          true, true);
      }
    }
  };
  private IChangeSetChangeListener listener;
  
  public ActiveChangeSetCollector(ISynchronizePageConfiguration configuration, ChangeSetModelProvider provider)
  {
    this.configuration = configuration;
    this.provider = provider;
    getActiveChangeSetManager().addListener(activeChangeSetListener);
  }
  
  public ISynchronizePageConfiguration getConfiguration()
  {
    return configuration;
  }
  
  public ActiveChangeSetManager getActiveChangeSetManager()
  {
    ISynchronizeParticipant participant = getConfiguration().getParticipant();
    if ((participant instanceof IChangeSetProvider)) {
      return ((IChangeSetProvider)participant).getChangeSetCapability().getActiveChangeSetManager();
    }
    return null;
  }
  
  public void reset(SyncInfoSet seedSet)
  {
    rootSet.clear();
    ChangeSet[] sets = (ChangeSet[])activeSets.keySet().toArray(new ChangeSet[activeSets.size()]);
    for (int i = 0; i < sets.length; i++)
    {
      ChangeSet set = sets[i];
      remove(set);
    }
    activeSets.clear();
    if (seedSet != null) {
      if (getConfiguration().getComparisonType() == "three-way")
      {
        sets = getActiveChangeSetManager().getSets();
        for (int i = 0; i < sets.length; i++)
        {
          ChangeSet set = sets[i];
          add(set);
        }
        SyncInfo[] syncInfos = seedSet.getSyncInfos();
        for (int i = 0; i < syncInfos.length; i++)
        {
          SyncInfo info = syncInfos[i];
          if (isLocalChange(info))
          {
            ChangeSet[] containingSets = findChangeSets(info);
            if (containingSets.length == 0) {
              rootSet.add(info);
            }
          }
        }
      }
      else
      {
        add(seedSet.getSyncInfos());
      }
    }
  }
  
  public void handleChange(ISyncInfoSetChangeEvent event)
  {
    List removals = new ArrayList();
    List additions = new ArrayList();
    removals.addAll(Arrays.asList(event.getRemovedResources()));
    additions.addAll(Arrays.asList(event.getAddedResources()));
    SyncInfo[] changed = event.getChangedResources();
    for (int i = 0; i < changed.length; i++)
    {
      SyncInfo info = changed[i];
      additions.add(info);
      removals.add(info.getLocal());
    }
    if (!removals.isEmpty()) {
      remove((IResource[])removals.toArray(new IResource[removals.size()]));
    }
    if (!additions.isEmpty()) {
      add((SyncInfo[])additions.toArray(new SyncInfo[additions.size()]));
    }
  }
  
  protected void remove(IResource[] resources)
  {
    for (Iterator iter = activeSets.values().iterator(); iter.hasNext();)
    {
      SyncInfoSet set = (SyncInfoSet)iter.next();
      set.removeAll(resources);
    }
    rootSet.removeAll(resources);
  }
  
  protected void add(SyncInfo[] infos)
  {
    for (int i = 0; i < infos.length; i++)
    {
      SyncInfo info = infos[i];
      if ((isLocalChange(info)) && (select(info)))
      {
        ChangeSet[] sets = findChangeSets(info);
        if (sets.length == 0) {
          rootSet.add(info);
        } else {
          for (int j = 0; j < sets.length; j++)
          {
            ChangeSet set = sets[j];
            SyncInfoSet targetSet = getSyncInfoSet(set);
            if (targetSet == null) {
              createSyncInfoSet(set);
            } else {
              targetSet.add(info);
            }
          }
        }
      }
    }
  }
  
  private ChangeSet[] findChangeSets(SyncInfo info)
  {
    ActiveChangeSetManager manager = getActiveChangeSetManager();
    ChangeSet[] sets = manager.getSets();
    List result = new ArrayList();
    for (int i = 0; i < sets.length; i++)
    {
      ChangeSet set = sets[i];
      if (set.contains(info.getLocal())) {
        result.add(set);
      }
    }
    return (ChangeSet[])result.toArray(new ChangeSet[result.size()]);
  }
  
  private boolean isLocalChange(SyncInfo info)
  {
    if (!info.getComparator().isThreeWay()) {
      try
      {
        info = ((SubscriberChangeSetManager)getActiveChangeSetManager()).getSubscriber().getSyncInfo(info.getLocal());
      }
      catch (TeamException e)
      {
        TeamUIPlugin.log(e);
      }
    }
    return (info.getComparator().isThreeWay()) && (((info.getKind() & 0xC) == 4) || ((info.getKind() & 0xC) == 12));
  }
  
  public SyncInfoTree getRootSet()
  {
    return rootSet;
  }
  
  public void add(ChangeSet set)
  {
    SyncInfoSet targetSet = getSyncInfoSet(set);
    if (targetSet == null) {
      createSyncInfoSet(set);
    }
    if (listener != null) {
      listener.setAdded(set);
    }
  }
  
  /* Error */
  private SyncInfoTree createSyncInfoSet(ChangeSet set)
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: invokevirtual 408	org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector:getSyncInfoSet	(Lorg/eclipse/team/internal/core/subscribers/ChangeSet;)Lorg/eclipse/team/core/synchronize/SyncInfoTree;
    //   5: astore_2
    //   6: iconst_0
    //   7: istore_3
    //   8: aload_2
    //   9: ifnonnull +25 -> 34
    //   12: new 180	org/eclipse/team/core/synchronize/SyncInfoTree
    //   15: dup
    //   16: invokespecial 378	org/eclipse/team/core/synchronize/SyncInfoTree:<init>	()V
    //   19: astore_2
    //   20: aload_0
    //   21: getfield 357	org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector:activeSets	Ljava/util/Map;
    //   24: aload_1
    //   25: aload_2
    //   26: invokeinterface 432 3 0
    //   31: pop
    //   32: iconst_1
    //   33: istore_3
    //   34: aload_2
    //   35: invokevirtual 379	org/eclipse/team/core/synchronize/SyncInfoTree:beginInput	()V
    //   38: aload_2
    //   39: invokevirtual 381	org/eclipse/team/core/synchronize/SyncInfoTree:isEmpty	()Z
    //   42: ifne +11 -> 53
    //   45: aload_2
    //   46: aload_2
    //   47: invokevirtual 382	org/eclipse/team/core/synchronize/SyncInfoTree:getResources	()[Lorg/eclipse/core/resources/IResource;
    //   50: invokevirtual 383	org/eclipse/team/core/synchronize/SyncInfoTree:removeAll	([Lorg/eclipse/core/resources/IResource;)V
    //   53: aload_2
    //   54: aload_0
    //   55: aload_1
    //   56: invokespecial 406	org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector:getSyncInfos	(Lorg/eclipse/team/internal/core/subscribers/ChangeSet;)Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   59: invokevirtual 386	org/eclipse/team/core/synchronize/SyncInfoTree:addAll	(Lorg/eclipse/team/core/synchronize/SyncInfoSet;)V
    //   62: goto +17 -> 79
    //   65: astore 4
    //   67: aload_2
    //   68: ifnull +8 -> 76
    //   71: aload_2
    //   72: aconst_null
    //   73: invokevirtual 384	org/eclipse/team/core/synchronize/SyncInfoTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   76: aload 4
    //   78: athrow
    //   79: aload_2
    //   80: ifnull +8 -> 88
    //   83: aload_2
    //   84: aconst_null
    //   85: invokevirtual 384	org/eclipse/team/core/synchronize/SyncInfoTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   88: iload_3
    //   89: ifeq +33 -> 122
    //   92: aload_1
    //   93: checkcast 184	org/eclipse/team/internal/core/subscribers/DiffChangeSet
    //   96: invokevirtual 391	org/eclipse/team/internal/core/subscribers/DiffChangeSet:getDiffTree	()Lorg/eclipse/team/core/mapping/IResourceDiffTree;
    //   99: aload_0
    //   100: invokeinterface 437 2 0
    //   105: aload_0
    //   106: getfield 360	org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector:listener	Lorg/eclipse/team/internal/core/subscribers/IChangeSetChangeListener;
    //   109: ifnull +13 -> 122
    //   112: aload_0
    //   113: getfield 360	org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector:listener	Lorg/eclipse/team/internal/core/subscribers/IChangeSetChangeListener;
    //   116: aload_1
    //   117: invokeinterface 443 2 0
    //   122: aload_2
    //   123: areturn
    // Line number table:
    //   Java source line #316	-> byte code offset #0
    //   Java source line #319	-> byte code offset #6
    //   Java source line #322	-> byte code offset #8
    //   Java source line #323	-> byte code offset #12
    //   Java source line #324	-> byte code offset #20
    //   Java source line #325	-> byte code offset #32
    //   Java source line #327	-> byte code offset #34
    //   Java source line #328	-> byte code offset #38
    //   Java source line #329	-> byte code offset #45
    //   Java source line #330	-> byte code offset #53
    //   Java source line #331	-> byte code offset #65
    //   Java source line #332	-> byte code offset #67
    //   Java source line #333	-> byte code offset #71
    //   Java source line #334	-> byte code offset #76
    //   Java source line #332	-> byte code offset #79
    //   Java source line #333	-> byte code offset #83
    //   Java source line #335	-> byte code offset #88
    //   Java source line #336	-> byte code offset #92
    //   Java source line #337	-> byte code offset #105
    //   Java source line #338	-> byte code offset #112
    //   Java source line #340	-> byte code offset #122
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	124	0	this	ActiveChangeSetCollector
    //   0	124	1	set	ChangeSet
    //   5	118	2	sis	SyncInfoTree
    //   7	82	3	added	boolean
    //   65	12	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   8	65	65	finally
  }
  
  private SyncInfoSet getSyncInfos(ChangeSet set)
  {
    IDiff[] diffs = ((ResourceDiffTree)((DiffChangeSet)set).getDiffTree()).getDiffs();
    return asSyncInfoSet(diffs);
  }
  
  private SyncInfoSet asSyncInfoSet(IDiff[] diffs)
  {
    SyncInfoSet result = new SyncInfoSet();
    for (int i = 0; i < diffs.length; i++)
    {
      IDiff diff = diffs[i];
      if (select(diff))
      {
        SyncInfo info = asSyncInfo(diff);
        if (info != null) {
          result.add(info);
        }
      }
    }
    return result;
  }
  
  private SyncInfo asSyncInfo(IDiff diff)
  {
    try
    {
      return ((SubscriberParticipant)getConfiguration().getParticipant()).getSubscriber().getSyncInfo(ResourceDiffTree.getResourceFor(diff));
    }
    catch (TeamException e)
    {
      TeamUIPlugin.log(e);
    }
    return null;
  }
  
  private boolean select(IDiff diff)
  {
    return getSeedSet().getSyncInfo(ResourceDiffTree.getResourceFor(diff)) != null;
  }
  
  SyncInfo getSyncInfo(IPath path)
  {
    return getSyncInfo(getSeedSet(), path);
  }
  
  IResource[] getResources(SyncInfoSet set, IPath[] paths)
  {
    List result = new ArrayList();
    for (int i = 0; i < paths.length; i++)
    {
      IPath path = paths[i];
      SyncInfo info = getSyncInfo(set, path);
      if (info != null) {
        result.add(info.getLocal());
      }
    }
    return (IResource[])result.toArray(new IResource[result.size()]);
  }
  
  private SyncInfo getSyncInfo(SyncInfoSet set, IPath path)
  {
    SyncInfo[] infos = set.getSyncInfos();
    for (int i = 0; i < infos.length; i++)
    {
      SyncInfo info = infos[i];
      if (info.getLocal().getFullPath().equals(path)) {
        return info;
      }
    }
    return null;
  }
  
  public void remove(ChangeSet set)
  {
    ((DiffChangeSet)set).getDiffTree().removeDiffChangeListener(this);
    activeSets.remove(set);
    if (listener != null) {
      listener.setRemoved(set);
    }
  }
  
  public SyncInfoTree getSyncInfoSet(ChangeSet set)
  {
    return (SyncInfoTree)activeSets.get(set);
  }
  
  private ChangeSet getChangeSet(IDiffTree tree)
  {
    for (Iterator iter = activeSets.keySet().iterator(); iter.hasNext();)
    {
      ChangeSet changeSet = (ChangeSet)iter.next();
      if (((DiffChangeSet)changeSet).getDiffTree() == tree) {
        return changeSet;
      }
    }
    return null;
  }
  
  private boolean select(SyncInfo info)
  {
    return getSeedSet().getSyncInfo(info.getLocal()) != null;
  }
  
  private SyncInfoSet getSeedSet()
  {
    return provider.getSyncInfoSet();
  }
  
  public void dispose()
  {
    getActiveChangeSetManager().removeListener(activeChangeSetListener);
  }
  
  public void setChangeSetChangeListener(IChangeSetChangeListener listener)
  {
    this.listener = listener;
    if (listener == null) {
      getActiveChangeSetManager().removeListener(activeChangeSetListener);
    } else {
      getActiveChangeSetManager().addListener(activeChangeSetListener);
    }
  }
  
  public void diffsChanged(IDiffChangeEvent event, IProgressMonitor monitor)
  {
    provider.performUpdate(new IWorkspaceRunnable()
    {
      private final IDiffChangeEvent val$event;
      
      public void run(IProgressMonitor monitor)
      {
        ChangeSet changeSet = ActiveChangeSetCollector.this.getChangeSet(val$event.getTree());
        if (changeSet != null)
        {
          SyncInfoSet targetSet = getSyncInfoSet(changeSet);
          if (targetSet != null)
          {
            targetSet.removeAll(getResources(targetSet, val$event.getRemovals()));
            targetSet.addAll(ActiveChangeSetCollector.this.asSyncInfoSet(val$event.getAdditions()));
            targetSet.addAll(ActiveChangeSetCollector.this.asSyncInfoSet(val$event.getChanges()));
            rootSet.removeAll(((IResourceDiffTree)val$event.getTree()).getAffectedResources());
          }
        }
      }
    }, true, true);
  }
  
  public void propertyChanged(IDiffTree tree, int property, IPath[] paths) {}
}

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

import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSet;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSetManager;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

public abstract class ChangeSetCapability
{
  public boolean supportsCheckedInChangeSets()
  {
    return false;
  }
  
  public boolean supportsActiveChangeSets()
  {
    return false;
  }
  
  public ActiveChangeSetManager getActiveChangeSetManager()
  {
    return null;
  }
  
  public ActiveChangeSet createChangeSet(ISynchronizePageConfiguration configuration, IDiff[] diffs)
  {
    return null;
  }
  
  public void editChangeSet(ISynchronizePageConfiguration configuration, ActiveChangeSet set) {}
  
  public SyncInfoSetChangeSetCollector createSyncInfoSetChangeSetCollector(ISynchronizePageConfiguration configuration)
  {
    return null;
  }
  
  public SynchronizePageActionGroup getActionGroup()
  {
    return null;
  }
  
  public boolean enableCheckedInChangeSetsFor(ISynchronizePageConfiguration configuration)
  {
    return (supportsCheckedInChangeSets()) && ((configuration.getMode() == 1) || (configuration.getComparisonType() == "two-way"));
  }
  
  public boolean enableActiveChangeSetsFor(ISynchronizePageConfiguration configuration)
  {
    return (supportsActiveChangeSets()) && (configuration.getMode() == 2);
  }
  
  public boolean enableChangeSetsByDefault()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ChangeSetCapability
 * 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.jface.resource.ImageDescriptor;
import org.eclipse.team.internal.core.subscribers.ChangeSet;
import org.eclipse.team.internal.ui.TeamUIPlugin;

public class ChangeSetDiffNode
  extends SynchronizeModelElement
{
  private final ChangeSet set;
  
  public ChangeSetDiffNode(IDiffContainer parent, ChangeSet set)
  {
    super(parent);
    this.set = set;
  }
  
  public IResource getResource()
  {
    return null;
  }
  
  public ChangeSet getSet()
  {
    return set;
  }
  
  public ImageDescriptor getImageDescriptor(Object object)
  {
    return TeamUIPlugin.getImageDescriptor("obj/changeset_obj.gif");
  }
  
  public String getName()
  {
    return set.getName();
  }
  
  public String toString()
  {
    return getName();
  }
  
  public int hashCode()
  {
    return set.hashCode();
  }
  
  public boolean equals(Object object)
  {
    if ((object instanceof ChangeSetDiffNode)) {
      return ((ChangeSetDiffNode)object).getSet() == set;
    }
    return super.equals(object);
  }
  
  public Object getAdapter(Class adapter)
  {
    if (adapter.equals(ChangeSet.class)) {
      return set;
    }
    return super.getAdapter(adapter);
  }
}

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

import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.IFontDecorator;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
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.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;

public class ChangeSetLabelDecorator
  extends LabelProvider
  implements ILabelDecorator, IFontDecorator
{
  private Font boldFont;
  private ActiveChangeSetManager collector;
  
  public ChangeSetLabelDecorator(ISynchronizePageConfiguration configuration)
  {
    ISynchronizeParticipant participant = configuration.getParticipant();
    if ((participant instanceof IChangeSetProvider)) {
      collector = ((IChangeSetProvider)participant).getChangeSetCapability().getActiveChangeSetManager();
    }
  }
  
  public String decorateText(String input, Object element)
  {
    String text = input;
    if ((element instanceof ChangeSetDiffNode))
    {
      ChangeSet set = ((ChangeSetDiffNode)element).getSet();
      if (((set instanceof ActiveChangeSet)) && (isDefaultActiveSet((ActiveChangeSet)set))) {
        text = NLS.bind(TeamUIMessages.CommitSetDiffNode_0, new String[] { text });
      }
    }
    return text;
  }
  
  public void dispose()
  {
    if (boldFont != null) {
      boldFont.dispose();
    }
  }
  
  public Font decorateFont(Object element)
  {
    if ((element instanceof ChangeSetDiffNode))
    {
      ChangeSet set = ((ChangeSetDiffNode)element).getSet();
      if (((set instanceof ActiveChangeSet)) && (isDefaultActiveSet((ActiveChangeSet)set)))
      {
        if (boldFont == null)
        {
          Font defaultFont = JFaceResources.getDefaultFont();
          FontData[] data = defaultFont.getFontData();
          for (int i = 0; i < data.length; i++) {
            data[i].setStyle(1);
          }
          boldFont = new Font(TeamUIPlugin.getStandardDisplay(), data);
        }
        return boldFont;
      }
    }
    return null;
  }
  
  private boolean isDefaultActiveSet(ActiveChangeSet set)
  {
    return collector.isDefault(set);
  }
  
  public Image decorateImage(Image image, Object element)
  {
    return image;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ChangeSetLabelDecorator
 * 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;

class ChangeSetModelManager$1
  implements IPropertyChangeListener
{
  final ChangeSetModelManager this$0;
  
  ChangeSetModelManager$1(ChangeSetModelManager paramChangeSetModelManager)
  {
    this$0 = paramChangeSetModelManager;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (event.getProperty().equals("org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE")) {
      ChangeSetModelManager.access$2(this$0);
    }
  }
}

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

import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

class ChangeSetModelManager$CommitSetActionContribution
  extends SynchronizePageActionGroup
{
  final ChangeSetModelManager this$0;
  
  private ChangeSetModelManager$CommitSetActionContribution(ChangeSetModelManager paramChangeSetModelManager)
  {
    this$0 = paramChangeSetModelManager;
  }
  
  ChangeSetModelManager$CommitSetActionContribution(ChangeSetModelManager paramChangeSetModelManager, CommitSetActionContribution paramCommitSetActionContribution)
  {
    this(paramChangeSetModelManager);
  }
  
  public void initialize(ISynchronizePageConfiguration configuration)
  {
    super.initialize(configuration);
    
    ChangeSetModelManager.access$0(this$0, new ChangeSetModelManager.ToggleCommitSetAction(this$0));
    appendToGroup(
      "org.eclipse.team.ui.P_TOOLBAR_MENU", 
      "ChangeSet", 
      ChangeSetModelManager.access$1(this$0));
    ChangeSetModelManager.access$2(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ChangeSetModelManager.CommitSetActionContribution
 * 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.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;

class ChangeSetModelManager$ToggleCommitSetAction
  extends Action
{
  final ChangeSetModelManager this$0;
  
  public ChangeSetModelManager$ToggleCommitSetAction(ChangeSetModelManager paramChangeSetModelManager)
  {
    super(TeamUIMessages.ChangeLogModelManager_0, TeamUIPlugin.getImageDescriptor("obj/changeset_obj.gif"));this$0 = paramChangeSetModelManager;
    setToolTipText(TeamUIMessages.ChangeLogModelManager_0);
    update();
  }
  
  public void run()
  {
    this$0.setCommitSetsEnabled(!this$0.enabled);
    update();
  }
  
  private void update()
  {
    setChecked(this$0.enabled);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ChangeSetModelManager.ToggleCommitSetAction
 * 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.dialogs.IDialogSettings;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;
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;

public class ChangeSetModelManager
  extends HierarchicalModelManager
  implements IPropertyChangeListener
{
  private static final String P_COMMIT_SET_ENABLED = "org.eclipse.team.ui.P_COMMIT_SET_ENABLED";
  public static final String CHANGE_SET_GROUP = "ChangeSet";
  boolean enabled = false;
  private ToggleCommitSetAction toggleCommitSetAction;
  
  private class ToggleCommitSetAction
    extends Action
  {
    public ToggleCommitSetAction()
    {
      super(TeamUIPlugin.getImageDescriptor("obj/changeset_obj.gif"));
      setToolTipText(TeamUIMessages.ChangeLogModelManager_0);
      update();
    }
    
    public void run()
    {
      setCommitSetsEnabled(!enabled);
      update();
    }
    
    private void update()
    {
      setChecked(enabled);
    }
  }
  
  private class CommitSetActionContribution
    extends SynchronizePageActionGroup
  {
    CommitSetActionContribution(CommitSetActionContribution paramCommitSetActionContribution)
    {
      this();
    }
    
    public void initialize(ISynchronizePageConfiguration configuration)
    {
      super.initialize(configuration);
      
      toggleCommitSetAction = new ChangeSetModelManager.ToggleCommitSetAction(ChangeSetModelManager.this);
      appendToGroup(
        "org.eclipse.team.ui.P_TOOLBAR_MENU", 
        "ChangeSet", 
        toggleCommitSetAction);
      ChangeSetModelManager.this.updateEnablement();
    }
    
    private CommitSetActionContribution() {}
  }
  
  public ChangeSetModelManager(ISynchronizePageConfiguration configuration)
  {
    super(configuration);
    configuration.addPropertyChangeListener(this);
    configuration.addMenuGroup("org.eclipse.team.ui.P_TOOLBAR_MENU", "ChangeSet");
    configuration.addActionContribution(new CommitSetActionContribution(null));
    ChangeSetCapability changeSetCapability = getChangeSetCapability(configuration);
    if ((changeSetCapability != null) && (changeSetCapability.supportsActiveChangeSets())) {
      configuration.addLabelDecorator(new ChangeSetLabelDecorator(configuration));
    }
    configuration.addPropertyChangeListener(new IPropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent event)
      {
        if (event.getProperty().equals("org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE")) {
          ChangeSetModelManager.this.updateEnablement();
        }
      }
    });
  }
  
  private ChangeSetCapability getChangeSetCapability(ISynchronizePageConfiguration configuration)
  {
    ISynchronizeParticipant participant = configuration.getParticipant();
    if ((participant instanceof IChangeSetProvider))
    {
      IChangeSetProvider provider = (IChangeSetProvider)participant;
      return provider.getChangeSetCapability();
    }
    return null;
  }
  
  private void updateEnablement()
  {
    if (toggleCommitSetAction != null)
    {
      ISynchronizePageConfiguration configuration = getConfiguration();
      ChangeSetCapability changeSetCapability = getChangeSetCapability(configuration);
      boolean enabled = (changeSetCapability != null) && ((changeSetCapability.enableActiveChangeSetsFor(configuration)) || 
        (changeSetCapability.enableCheckedInChangeSetsFor(configuration)));
      toggleCommitSetAction.setEnabled(enabled);
    }
  }
  
  public void dispose()
  {
    getConfiguration().removePropertyChangeListener(this);
    super.dispose();
  }
  
  protected ISynchronizeModelProvider createModelProvider(String id)
  {
    if (enabled) {
      return new ChangeSetModelProvider(getConfiguration(), getSyncInfoSet(), id);
    }
    return super.createModelProvider(id);
  }
  
  protected String getSelectedProviderId()
  {
    String id = super.getSelectedProviderId();
    if (id.equals("org.eclipse.team.ui.modelprovider_cvs_changelog")) {
      return ((ChangeSetModelProvider)getActiveModelProvider()).getSubproviderId();
    }
    return id;
  }
  
  public void propertyChange(PropertyChangeEvent event) {}
  
  protected void saveProviderSettings(String id)
  {
    super.saveProviderSettings(id);
    IDialogSettings pageSettings = getConfiguration().getSite().getPageSettings();
    if (pageSettings != null) {
      pageSettings.put("org.eclipse.team.ui.P_COMMIT_SET_ENABLED", enabled);
    }
  }
  
  public void initialize(ISynchronizePageConfiguration configuration)
  {
    IDialogSettings pageSettings = getConfiguration().getSite().getPageSettings();
    ChangeSetCapability changeSetCapability = getChangeSetCapability(getConfiguration());
    enabled = ((changeSetCapability != null) && (changeSetCapability.enableChangeSetsByDefault()));
    if ((pageSettings != null) && (pageSettings.get("org.eclipse.team.ui.P_COMMIT_SET_ENABLED") != null)) {
      enabled = pageSettings.getBoolean("org.eclipse.team.ui.P_COMMIT_SET_ENABLED");
    }
    super.initialize(configuration);
  }
  
  public void setCommitSetsEnabled(boolean enable)
  {
    if (enabled != enable)
    {
      enabled = enable;
      setInput(getSelectedProviderId(), null);
    }
  }
  
  public ISynchronizeModelProvider getActiveModelProvider()
  {
    return super.getActiveModelProvider();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ChangeSetModelManager
 * 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.IPath;
import org.eclipse.team.core.synchronize.SyncInfoTree;
import org.eclipse.team.internal.core.subscribers.ChangeSet;
import org.eclipse.team.internal.core.subscribers.CheckedInChangeSet;
import org.eclipse.team.internal.core.subscribers.IChangeSetChangeListener;

class ChangeSetModelProvider$1
  implements IChangeSetChangeListener
{
  final ChangeSetModelProvider this$0;
  
  ChangeSetModelProvider$1(ChangeSetModelProvider paramChangeSetModelProvider)
  {
    this$0 = paramChangeSetModelProvider;
  }
  
  public void setAdded(ChangeSet set)
  {
    SyncInfoTree syncInfoSet;
    SyncInfoTree syncInfoSet;
    if ((set instanceof CheckedInChangeSet)) {
      syncInfoSet = ChangeSetModelProvider.access$0(this$0).getSyncInfoSet(set);
    } else {
      syncInfoSet = ChangeSetModelProvider.access$1(this$0).getSyncInfoSet(set);
    }
    if (syncInfoSet != null) {
      this$0.createChangeSetModelElement(set, syncInfoSet);
    }
  }
  
  public void defaultSetChanged(ChangeSet previousDefault, ChangeSet set)
  {
    this$0.refreshLabel(previousDefault);
    this$0.refreshLabel(set);
  }
  
  public void setRemoved(ChangeSet set)
  {
    this$0.removeModelElementForSet(set);
  }
  
  public void nameChanged(ChangeSet set)
  {
    this$0.refreshLabel(set);
  }
  
  public void resourcesChanged(ChangeSet set, IPath[] paths) {}
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ChangeSetModelProvider.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.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

class ChangeSetModelProvider$2
  implements IPropertyChangeListener
{
  final ChangeSetModelProvider this$0;
  private final ISynchronizeModelProvider val$provider;
  
  ChangeSetModelProvider$2(ChangeSetModelProvider paramChangeSetModelProvider, ISynchronizeModelProvider paramISynchronizeModelProvider)
  {
    this$0 = paramChangeSetModelProvider;val$provider = paramISynchronizeModelProvider;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (event.getProperty().equals("org.eclipse.team.ui.P_VIEWER_SORTER"))
    {
      ChangeSetModelProvider.access$2(this$0, val$provider.getViewerSorter());
      this$0.firePropertyChange("org.eclipse.team.ui.P_VIEWER_SORTER", null, null);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.ChangeSetModelProvider.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.resource.ImageDescriptor;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;

public class ChangeSetModelProvider$ChangeSetModelProviderDescriptor
  implements ISynchronizeModelProviderDescriptor
{
  public static final String ID = "org.eclipse.team.ui.modelprovider_cvs_changelog";
  
  public String getId()
  {
    return "org.eclipse.team.ui.modelprovider_cvs_changelog";
  }
  
  public String getName()
  {
    return TeamUIMessages.ChangeLogModelProvider_5;
  }
  
  public ImageDescriptor getImageDescriptor()
  {
    return TeamUIPlugin.getImageDescriptor("obj/changeset_obj.gif");
  }
}

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

import java.util.HashMap;
import java.util.Map;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.ViewerSorter;
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.internal.core.subscribers.ChangeSet;
import org.eclipse.team.internal.core.subscribers.CheckedInChangeSet;
import org.eclipse.team.internal.core.subscribers.IChangeSetChangeListener;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.actions.ChangeSetActionGroup;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

public class ChangeSetModelProvider
  extends CompositeModelProvider
{
  private ViewerSorter viewerSorter;
  private final String subProvierId;
  private Map rootToProvider = new HashMap();
  private ViewerSorter embeddedSorter;
  private SyncInfoSetChangeSetCollector checkedInCollector;
  private IChangeSetChangeListener changeSetListener = new IChangeSetChangeListener()
  {
    public void setAdded(ChangeSet set)
    {
      SyncInfoTree syncInfoSet;
      SyncInfoTree syncInfoSet;
      if ((set instanceof CheckedInChangeSet)) {
        syncInfoSet = checkedInCollector.getSyncInfoSet(set);
      } else {
        syncInfoSet = activeCollector.getSyncInfoSet(set);
      }
      if (syncInfoSet != null) {
        createChangeSetModelElement(set, syncInfoSet);
      }
    }
    
    public void defaultSetChanged(ChangeSet previousDefault, ChangeSet set)
    {
      refreshLabel(previousDefault);
      refreshLabel(set);
    }
    
    public void setRemoved(ChangeSet set)
    {
      removeModelElementForSet(set);
    }
    
    public void nameChanged(ChangeSet set)
    {
      refreshLabel(set);
    }
    
    public void resourcesChanged(ChangeSet set, IPath[] paths) {}
  };
  private ActiveChangeSetCollector activeCollector;
  
  public static class ChangeSetModelProviderDescriptor
    implements ISynchronizeModelProviderDescriptor
  {
    public static final String ID = "org.eclipse.team.ui.modelprovider_cvs_changelog";
    
    public String getId()
    {
      return "org.eclipse.team.ui.modelprovider_cvs_changelog";
    }
    
    public String getName()
    {
      return TeamUIMessages.ChangeLogModelProvider_5;
    }
    
    public ImageDescriptor getImageDescriptor()
    {
      return TeamUIPlugin.getImageDescriptor("obj/changeset_obj.gif");
    }
  }
  
  private static final ChangeSetModelProviderDescriptor descriptor = new ChangeSetModelProviderDescriptor();
  
  protected ChangeSetModelProvider(ISynchronizePageConfiguration configuration, SyncInfoSet set, String subProvierId)
  {
    super(configuration, set);
    this.subProvierId = subProvierId;
    ChangeSetCapability changeSetCapability = getChangeSetCapability();
    if (changeSetCapability.supportsCheckedInChangeSets())
    {
      checkedInCollector = changeSetCapability.createSyncInfoSetChangeSetCollector(configuration);
      checkedInCollector.setProvider(this);
      checkedInCollector.addListener(changeSetListener);
    }
    if (changeSetCapability.supportsActiveChangeSets())
    {
      activeCollector = new ActiveChangeSetCollector(configuration, this);
      activeCollector.setChangeSetChangeListener(changeSetListener);
      configuration.addMenuGroup("org.eclipse.team.ui.P_CONTEXT_MENU", "change_set_group");
    }
  }
  
  /* Error */
  protected void handleChanges(org.eclipse.team.core.synchronize.ISyncInfoTreeChangeEvent event, IProgressMonitor monitor)
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore_3
    //   2: aload_0
    //   3: getfield 314	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:checkedInCollector	Lorg/eclipse/team/internal/ui/synchronize/SyncInfoSetChangeSetCollector;
    //   6: ifnull +27 -> 33
    //   9: aload_0
    //   10: invokevirtual 341	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:getChangeSetCapability	()Lorg/eclipse/team/internal/ui/synchronize/ChangeSetCapability;
    //   13: aload_0
    //   14: invokevirtual 347	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:getConfiguration	()Lorg/eclipse/team/ui/synchronize/ISynchronizePageConfiguration;
    //   17: invokevirtual 333	org/eclipse/team/internal/ui/synchronize/ChangeSetCapability:enableCheckedInChangeSetsFor	(Lorg/eclipse/team/ui/synchronize/ISynchronizePageConfiguration;)Z
    //   20: ifeq +13 -> 33
    //   23: aload_0
    //   24: getfield 314	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:checkedInCollector	Lorg/eclipse/team/internal/ui/synchronize/SyncInfoSetChangeSetCollector;
    //   27: aload_1
    //   28: invokevirtual 365	org/eclipse/team/internal/ui/synchronize/SyncInfoSetChangeSetCollector:handleChange	(Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeEvent;)V
    //   31: iconst_1
    //   32: istore_3
    //   33: aload_0
    //   34: getfield 312	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:activeCollector	Lorg/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector;
    //   37: ifnull +27 -> 64
    //   40: aload_0
    //   41: invokevirtual 341	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:getChangeSetCapability	()Lorg/eclipse/team/internal/ui/synchronize/ChangeSetCapability;
    //   44: aload_0
    //   45: invokevirtual 347	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:getConfiguration	()Lorg/eclipse/team/ui/synchronize/ISynchronizePageConfiguration;
    //   48: invokevirtual 332	org/eclipse/team/internal/ui/synchronize/ChangeSetCapability:enableActiveChangeSetsFor	(Lorg/eclipse/team/ui/synchronize/ISynchronizePageConfiguration;)Z
    //   51: ifeq +13 -> 64
    //   54: aload_0
    //   55: getfield 312	org/eclipse/team/internal/ui/synchronize/ChangeSetModelProvider:activeCollector	Lorg/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector;
    //   58: aload_1
    //   59: invokevirtual 325	org/eclipse/team/internal/ui/synchronize/ActiveChangeSetCollector:handleChange	(Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeEvent;)V
    //   62: iconst_1
    
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