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

SetManager().addPropertyChangeListener(this);
  }
  
  public String getName()
  {
    if (sets.length == 0) {
      return TeamUIMessages.WorkingSetScope_0;
    }
    StringBuffer name = new StringBuffer();
    for (int i = 0; i < sets.length; i++)
    {
      IWorkingSet set = sets[i];
      name.append(set.getName());
      if (i < sets.length - 1) {
        name.append(", ");
      }
    }
    return name.toString();
  }
  
  public IResource[] getRoots()
  {
    if (sets.length == 0) {
      return null;
    }
    HashSet roots = new HashSet();
    for (int i = 0; i < sets.length; i++)
    {
      IWorkingSet set = sets[i];
      IResource[] resources = Utils.getResources(set.getElements());
      addNonOverlapping(roots, resources);
    }
    return (IResource[])roots.toArray(new IResource[roots.size()]);
  }
  
  private void addNonOverlapping(HashSet roots, IResource[] resources)
  {
    for (int i = 0; i < resources.length; i++)
    {
      IResource newResource = resources[i];
      boolean add = true;
      for (Iterator iter = roots.iterator(); iter.hasNext();)
      {
        IResource existingResource = (IResource)iter.next();
        if (existingResource.equals(newResource))
        {
          add = false;
          break;
        }
        if (existingResource.getFullPath().isPrefixOf(newResource.getFullPath()))
        {
          add = false;
          break;
        }
        if (newResource.getFullPath().isPrefixOf(existingResource.getFullPath())) {
          iter.remove();
        }
      }
      if (add) {
        roots.add(newResource);
      }
    }
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (event.getProperty() == "workingSetContentChange")
    {
      IWorkingSet newSet = (IWorkingSet)event.getNewValue();
      for (int i = 0; i < sets.length; i++)
      {
        IWorkingSet set = sets[i];
        if (newSet == set)
        {
          fireRootsChanges();
          return;
        }
      }
    }
    else if (event.getProperty() == "workingSetNameChange")
    {
      firePropertyChangedEvent(new PropertyChangeEvent(this, "prop_name", null, event.getNewValue()));
    }
  }
  
  public void dispose()
  {
    super.dispose();
    if (PlatformUI.isWorkbenchRunning()) {
      PlatformUI.getWorkbench().getWorkingSetManager().removePropertyChangeListener(this);
    }
  }
  
  public void saveState(IMemento memento)
  {
    super.saveState(memento);
    for (int i = 0; i < sets.length; i++)
    {
      IWorkingSet set = sets[i];
      IMemento rootNode = memento.createChild("workingset_scope_sets");
      rootNode.putString("workingset_scope_name", set.getName());
    }
  }
  
  protected void init(IMemento memento)
  {
    super.init(memento);
    IMemento[] rootNodes = memento.getChildren("workingset_scope_sets");
    if (rootNodes != null)
    {
      List sets = new ArrayList();
      for (int i = 0; i < rootNodes.length; i++)
      {
        IMemento rootNode = rootNodes[i];
        String setName = rootNode.getString("workingset_scope_name");
        IWorkingSet set = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(setName);
        if (set != null) {
          sets.add(set);
        }
      }
      setWorkingSets((IWorkingSet[])sets.toArray(new IWorkingSet[sets.size()]));
    }
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.team.internal.ui.TeamUIMessages;

public class WorkspaceScope
  extends AbstractSynchronizeScope
{
  public String getName()
  {
    return TeamUIMessages.WorkspaceScope_0;
  }
  
  public IResource[] getRoots()
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.synchronize.WorkspaceScope
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.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