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

_extensionExistsLong);
        return;
      }
    }
    FileTypeTable.Item item = new FileTypeTable.Extension(extension, false);
    fItems.add(item);
    fTable.getViewer().refresh();
  }
  
  void addName()
  {
    InputDialog dialog = new InputDialog(getShell(), TeamUIMessages.TextPreferencePage_6, TeamUIMessages.TextPreferencePage_7, null, new FilenameValidator(null));
    if (dialog.open() != 0) {
      return;
    }
    String name = dialog.getValue();
    
    Iterator it = fItems.iterator();
    while (it.hasNext())
    {
      FileTypeTable.Item item = (FileTypeTable.Item)it.next();
      if (((item instanceof FileTypeTable.Name)) && (name.equals(name)))
      {
        MessageDialog.openWarning(getShell(), TeamUIMessages.TextPreferencePage_extensionExistsShort, TeamUIMessages.TextPreferencePage_extensionExistsLong);
        return;
      }
    }
    FileTypeTable.Item item = new FileTypeTable.Name(name, false);
    fItems.add(item);
    fTable.getViewer().refresh();
  }
  
  void removePattern()
  {
    IStructuredSelection selection = fTable.getSelection();
    if (selection == null) {
      return;
    }
    for (Iterator it = selection.iterator(); it.hasNext();)
    {
      FileTypeTable.Item item = (FileTypeTable.Item)it.next();
      if (!contributed) {
        fItems.remove(item);
      }
    }
    fTable.getViewer().refresh();
    handleSelection();
  }
  
  void changePattern()
  {
    IStructuredSelection selection = fTable.getSelection();
    if (selection == null) {
      return;
    }
    for (Iterator it = selection.iterator(); it.hasNext();)
    {
      FileTypeTable.Item item = (FileTypeTable.Item)it.next();
      mode = (mode == 1 ? 2 : 1);
      fTable.getViewer().refresh(item);
    }
  }
  
  void handleSelection()
  {
    boolean empty = fTable.getSelection().isEmpty();
    FileTypeTable.Item selectedItem = (FileTypeTable.Item)fTable.getSelection().getFirstElement();
    
    fRemoveButton.setEnabled((!empty) && (!contributed));
    fChangeButton.setEnabled(!empty);
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;

class RegistryReader$1
  implements Runnable
{
  private final Object[] val$ret;
  private final IConfigurationElement val$element;
  private final String val$classAttribute;
  private final CoreException[] val$exc;
  
  RegistryReader$1(Object[] paramArrayOfObject, IConfigurationElement paramIConfigurationElement, String paramString, CoreException[] paramArrayOfCoreException)
  {
    val$ret = paramArrayOfObject;val$element = paramIConfigurationElement;val$classAttribute = paramString;val$exc = paramArrayOfCoreException;
  }
  
  public void run()
  {
    try
    {
      val$ret[0] = val$element
        .createExecutableExtension(val$classAttribute);
    }
    catch (CoreException e)
    {
      val$exc[0] = e;
    }
  }
}

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

import org.eclipse.core.runtime.IExtension;
import org.eclipse.team.internal.ui.Utils.Sorter;

class RegistryReader$2
  extends Utils.Sorter
{
  final RegistryReader this$0;
  
  RegistryReader$2(RegistryReader paramRegistryReader)
  {
    this$0 = paramRegistryReader;
  }
  
  public boolean compare(Object extension1, Object extension2)
  {
    String s1 = ((IExtension)extension1).getNamespaceIdentifier();
    String s2 = ((IExtension)extension2).getNamespaceIdentifier();
    
    return s2.compareToIgnoreCase(s1) > 0;
  }
}

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

import java.util.Hashtable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils.Sorter;
import org.osgi.framework.Bundle;

public abstract class RegistryReader
{
  protected static final String TAG_DESCRIPTION = "description";
  protected static Hashtable extensionPoints = new Hashtable();
  
  public static Object createExtension(IConfigurationElement element, String classAttribute)
    throws CoreException
  {
    try
    {
      if (isActivated(element.getDeclaringExtension()
        .getContributor().getName())) {
        return element.createExecutableExtension(classAttribute);
      }
      Object[] ret = new Object[1];
      CoreException[] exc = new CoreException[1];
      BusyIndicator.showWhile(null, new Runnable()
      {
        private final IConfigurationElement val$element;
        private final String val$classAttribute;
        private final CoreException[] val$exc;
        
        public void run()
        {
          try
          {
            RegistryReader.this[0] = val$element
              .createExecutableExtension(val$classAttribute);
          }
          catch (CoreException e)
          {
            val$exc[0] = e;
          }
        }
      });
      if (exc[0] != null) {
        throw exc[0];
      }
      return ret[0];
    }
    catch (CoreException core)
    {
      throw core;
    }
    catch (Exception e)
    {
      throw new CoreException(new Status(4, "org.eclipse.team.ui", 
        4, NLS.bind(TeamUIMessages.RegistryReader_0, element.getNamespaceIdentifier(), element.getName()), e));
    }
  }
  
  private static boolean isActivated(String bundleId)
  {
    return isActivated(Platform.getBundle(bundleId));
  }
  
  private static boolean isActivated(Bundle bundle)
  {
    return (bundle != null) && ((bundle.getState() & 0x30) != 0);
  }
  
  protected String getDescription(IConfigurationElement config)
  {
    IConfigurationElement[] children = config.getChildren("description");
    if (children.length >= 1) {
      return children[0].getValue();
    }
    return "";
  }
  
  protected void logError(IConfigurationElement element, String text)
  {
    IExtension extension = element.getDeclaringExtension();
    StringBuffer buf = new StringBuffer();
    buf.append("Plugin " + extension.getNamespaceIdentifier() + ", extension " + extension.getExtensionPointUniqueIdentifier());
    buf.append("\n" + text);
    TeamUIPlugin.log(4, buf.toString(), null);
  }
  
  protected void logMissingAttribute(IConfigurationElement element, String attributeName)
  {
    logError(element, "Required attribute '" + attributeName + "' not defined");
  }
  
  protected void logMissingElement(IConfigurationElement element, String elementName)
  {
    logError(element, "Required sub element '" + elementName + "' not defined");
  }
  
  protected void logUnknownElement(IConfigurationElement element)
  {
    logError(element, "Unknown extension tag found: " + element.getName());
  }
  
  protected IExtension[] orderExtensions(IExtension[] extensions)
  {
    Utils.Sorter sorter = new Utils.Sorter()
    {
      public boolean compare(Object extension1, Object extension2)
      {
        String s1 = ((IExtension)extension1).getNamespaceIdentifier();
        String s2 = ((IExtension)extension2).getNamespaceIdentifier();
        
        return s2.compareToIgnoreCase(s1) > 0;
      }
    };
    Object[] sorted = sorter.sort(extensions);
    IExtension[] sortedExtension = new IExtension[sorted.length];
    System.arraycopy(sorted, 0, sortedExtension, 0, sorted.length);
    return sortedExtension;
  }
  
  protected abstract boolean readElement(IConfigurationElement paramIConfigurationElement);
  
  protected void readElementChildren(IConfigurationElement element)
  {
    readElements(element.getChildren());
  }
  
  protected void readElements(IConfigurationElement[] elements)
  {
    for (int i = 0; i < elements.length; i++) {
      if (!readElement(elements[i])) {
        logUnknownElement(elements[i]);
      }
    }
  }
  
  protected void readExtension(IExtension extension)
  {
    readElements(extension.getConfigurationElements());
  }
  
  public void readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint)
  {
    String pointId = pluginId + "-" + extensionPoint;
    IExtension[] extensions = (IExtension[])extensionPoints.get(pointId);
    if (extensions == null)
    {
      IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
      if (point == null) {
        return;
      }
      extensions = point.getExtensions();
      extensionPoints.put(pointId, extensions);
    }
    for (int i = 0; i < extensions.length; i++) {
      readExtension(extensions[i]);
    }
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;

public class SynchronizeParticipantDescriptor
  implements ISynchronizeParticipantDescriptor
{
  public static final String ATT_ID = "id";
  public static final String ATT_NAME = "name";
  public static final String ATT_ICON = "icon";
  public static final String ATT_CLASS = "class";
  private static final String ATT_PERSISTENT = "persistent";
  public static final String ATT_HELP_CONTEXT_ID = "helpContextId";
  private String label;
  private String className;
  private String id;
  private boolean persistent;
  private ImageDescriptor imageDescriptor;
  private String description;
  private String helpContextId;
  private IConfigurationElement configElement;
  
  public SynchronizeParticipantDescriptor(IConfigurationElement e, String desc)
    throws CoreException
  {
    configElement = e;
    description = desc;
    loadFromExtension();
  }
  
  public IConfigurationElement getConfigurationElement()
  {
    return configElement;
  }
  
  public String getDescription()
  {
    return description;
  }
  
  public String getId()
  {
    return id;
  }
  
  public ImageDescriptor getImageDescriptor()
  {
    if (imageDescriptor != null) {
      return imageDescriptor;
    }
    String iconName = configElement.getAttribute("icon");
    if (iconName == null) {
      return null;
    }
    imageDescriptor = TeamUIPlugin.getImageDescriptorFromExtension(configElement.getDeclaringExtension(), iconName);
    return imageDescriptor;
  }
  
  public String getName()
  {
    return label;
  }
  
  public boolean isPersistent()
  {
    return persistent;
  }
  
  public String getHelpContextId()
  {
    return helpContextId;
  }
  
  private void loadFromExtension()
    throws CoreException
  {
    String identifier = configElement.getAttribute("id");
    label = configElement.getAttribute("name");
    className = configElement.getAttribute("class");
    String persistentString = configElement.getAttribute("persistent");
    if (persistentString == null) {
      persistent = true;
    } else {
      persistent = Boolean.valueOf(persistentString).booleanValue();
    }
    helpContextId = configElement.getAttribute("helpContextId");
    if ((label == null) || (className == null) || (identifier == null)) {
      throw new CoreException(new Status(4, configElement.getNamespaceIdentifier(), 0, "Invalid extension (missing label or class name): " + identifier, 
        null));
    }
    id = identifier;
  }
  
  public String toString()
  {
    return "Synchronize Participant(" + getId() + ")";
  }
}

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

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.team.internal.ui.TeamUIPlugin;

public class SynchronizeParticipantRegistry
  extends RegistryReader
{
  public static final String PT_SYNCPARTICIPANTS = "synchronizeParticipants";
  private static final String TAG_SYNCPARTICIPANT = "participant";
  private Map participants = new HashMap();
  
  protected boolean readElement(IConfigurationElement element)
  {
    if (element.getName().equals("participant"))
    {
      String descText = getDescription(element);
      try
      {
        SynchronizeParticipantDescriptor desc = new SynchronizeParticipantDescriptor(element, descText);
        participants.put(desc.getId(), desc);
      }
      catch (CoreException e)
      {
        TeamUIPlugin.log(e);
      }
      return true;
    }
    return false;
  }
  
  public SynchronizeParticipantDescriptor find(String id)
  {
    return (SynchronizeParticipantDescriptor)participants.get(id);
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.team.internal.ui.TeamUIPlugin;

public class SynchronizeWizardDescription
{
  public static final String ATT_ID = "id";
  public static final String ATT_NAME = "name";
  public static final String ATT_ICON = "icon";
  public static final String ATT_CLASS = "class";
  public static final String ATT_DESCRIPTION = "description";
  private String label;
  private String className;
  private String description;
  private String id;
  private ImageDescriptor imageDescriptor;
  private IConfigurationElement configElement;
  
  public SynchronizeWizardDescription(IConfigurationElement e, String descText)
    throws CoreException
  {
    configElement = e;
    loadFromExtension();
  }
  
  public IWizard createWizard()
    throws CoreException
  {
    Object obj = RegistryReader.createExtension(configElement, "class");
    return (IWizard)obj;
  }
  
  private void loadFromExtension()
    throws CoreException
  {
    String identifier = configElement.getAttribute("id");
    label = configElement.getAttribute("name");
    className = configElement.getAttribute("class");
    description = configElement.getAttribute("description");
    if ((label == null) || (className == null) || (identifier == null) || (description == null)) {
      throw new CoreException(new Status(4, configElement.getNamespace(), 0, "Invalid extension (missing label or class name): " + identifier, 
        null));
    }
    id = identifier;
  }
  
  public String getId()
  {
    return id;
  }
  
  public String getDescription()
  {
    return description;
  }
  
  public ImageDescriptor getImageDescriptor()
  {
    if (imageDescriptor != null) {
      return imageDescriptor;
    }
    String iconName = configElement.getAttribute("icon");
    if (iconName == null) {
      return null;
    }
    imageDescriptor = TeamUIPlugin.getImageDescriptorFromExtension(configElement.getDeclaringExtension(), iconName);
    return imageDescriptor;
  }
  
  public String getName()
  {
    return label;
  }
  
  public String toString()
  {
    return "Synchronize Participant Creation Wizard(" + getId() + ")";
  }
}

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

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.team.internal.ui.TeamUIPlugin;

public class SynchronizeWizardRegistry
  extends RegistryReader
{
  public static final String PT_SYNCHRONIZE_WIZARDS = "synchronizeWizards";
  private static final String TAG_SYNCHRONIZE_WIZARD = "wizard";
  private Map wizards = new HashMap();
  
  protected boolean readElement(IConfigurationElement element)
  {
    if (element.getName().equals("wizard"))
    {
      String descText = getDescription(element);
      try
      {
        SynchronizeWizardDescription desc = new SynchronizeWizardDescription(element, descText);
        wizards.put(desc.getId(), desc);
      }
      catch (CoreException e)
      {
        TeamUIPlugin.log(e);
      }
      return true;
    }
    return false;
  }
  
  public SynchronizeWizardDescription[] getSynchronizeWizards()
  {
    return (SynchronizeWizardDescription[])wizards.values().toArray(new SynchronizeWizardDescription[wizards.size()]);
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferencePage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.mapping.ITeamContentProviderDescriptor;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;

public class TeamContentProviderDescriptor
  implements ITeamContentProviderDescriptor
{
  private static final String TAG_TEAM_CONTENT_PROVIDER = "teamContentProvider";
  private static final String ATT_MODEL_PROVIDER_ID = "modelProviderId";
  private static final String ATT_CONTENT_EXTENSION_ID = "contentExtensionId";
  private static final String ATT_ICON = "icon";
  private static final String ATT_PREFERENCE_PAGE = "preferencePage";
  private static final String ATT_SUPPORTS_FLAT_LAYOUT = "supportsFlatLayout";
  private static final String PREF_TEAM_CONTENT_DESCRIPTORS = "teamContentDescriptors";
  private static final String PREF_ENABLED = "enabled";
  private String modelProviderId;
  private String contentExtensionId;
  private String contentProviderName;
  private ImageDescriptor imageDescriptor;
  private IConfigurationElement configElement;
  private boolean supportsFlatLayout;
  
  public TeamContentProviderDescriptor(IExtension extension)
    throws CoreException
  {
    readExtension(extension);
  }
  
  protected void readExtension(IExtension extension)
    throws CoreException
  {
    String id = extension.getUniqueIdentifier();
    IConfigurationElement[] elements = extension.getConfigurationElements();
    if (elements.length == 1)
    {
      IConfigurationElement element = elements[0];
      String name = element.getName();
      if (name.equalsIgnoreCase("teamContentProvider"))
      {
        configElement = element;
        modelProviderId = element.getAttribute("modelProviderId");
        contentExtensionId = element
          .getAttribute("contentExtensionId");
        String supportsFlatLayoutString = element
          .getAttribute("supportsFlatLayout");
        if (supportsFlatLayoutString != null) {
          supportsFlatLayout = Boolean.valueOf(
            supportsFlatLayoutString).booleanValue();
        }
        contentProviderName = extension.getLabel();
      }
    }
    else
    {
      fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_2, 
        new String[] { "teamContentProvider", 
        id == null ? "" : id }));
    }
    if (modelProviderId == null) {
      fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, 
        new String[] { "modelProviderId", 
        "teamContentProvider", id == null ? "" : id }));
    }
    if (contentExtensionId == null) {
      fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, 
        new String[] { "contentExtensionId", 
        "teamContentProvider", id == null ? "" : id }));
    }
  }
  
  protected void fail(String reason)
    throws CoreException
  {
    throw new CoreException(new Status(4, "org.eclipse.team.ui", 0, reason, null));
  }
  
  public String getContentExtensionId()
  {
    return contentExtensionId;
  }
  
  public String getModelProviderId()
  {
    return modelProviderId;
  }
  
  public ImageDescriptor getImageDescriptor()
  {
    if (imageDescriptor != null) {
      return imageDescriptor;
    }
    String iconName = configElement.getAttribute("icon");
    if (iconName == null) {
      return null;
    }
    imageDescriptor = TeamUIPlugin.getImageDescriptorFromExtension(configElement.getDeclaringExtension(), iconName);
    return imageDescriptor;
  }
  
  public IPreferencePage createPreferencePage()
    throws CoreException
  {
    if (configElement.getAttribute("preferencePage") == null) {
      return null;
    }
    Object obj = RegistryReader.createExtension(configElement, "preferencePage");
    return (IPreferencePage)obj;
  }
  
  public boolean isEnabled()
  {
    if (!hasPreferences()) {
      return true;
    }
    return getPreferences().getBoolean("enabled", true);
  }
  
  public void setEnabled(boolean enable)
  {
    if (isEnabled() != enable)
    {
      getPreferences().putBoolean("enabled", enable);
      flushPreferences();
    }
  }
  
  public Preferences getParentPreferences()
  {
    return TeamUIPlugin.getPlugin().getInstancePreferences().node("teamContentDescriptors");
  }
  
  public Preferences getPreferences()
  {
    if (!hasPreferences()) {
      ensurePreferencesStored();
    }
    return internalGetPreferences();
  }
  
  private Preferences internalGetPreferences()
  {
    return getParentPreferences().node(getPreferenceName());
  }
  
  private boolean hasPreferences()
  {
    try
    {
      return getParentPreferences().nodeExists(getPreferenceName());
    }
    catch (BackingStoreException e)
    {
      TeamUIPlugin.log(4, NLS.bind("Error accessing team content preference store for {0}", new String[] { getModelProviderId() }), e);
    }
    return false;
  }
  
  private String getPreferenceName()
  {
    return getModelProviderId();
  }
  
  public void storePreferences()
  {
    Preferences prefs = internalGetPreferences();
    
    prefs.putBoolean("enabled", true);
    flushPreferences();
  }
  
  private void flushPreferences()
  {
    try
    {
      internalGetPreferences().flush();
    }
    catch (BackingStoreException e)
    {
      TeamUIPlugin.log(4, NLS.bind("Error flushing team content preference store for {0}", new String[] { getModelProviderId() }), e);
    }
  }
  
  private void ensurePreferencesStored()
  {
    if (!hasPreferences()) {
      storePreferences();
    }
  }
  
  public String getName()
  {
    if (contentProviderName != null) {
      return contentProviderName;
    }
    return null;
  }
  
  public boolean isFlatLayoutSupported()
  {
    return supportsFlatLayout;
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

class TeamContentProviderManager$1
  implements ISafeRunnable
{
  final TeamContentProviderManager this$0;
  private final IPropertyChangeListener val$listener;
  private final PropertyChangeEvent val$event;
  
  TeamContentProviderManager$1(TeamContentProviderManager paramTeamContentProviderManager, IPropertyChangeListener paramIPropertyChangeListener, PropertyChangeEvent paramPropertyChangeEvent)
  {
    this$0 = paramTeamContentProviderManager;val$listener = paramIPropertyChangeListener;val$event = paramPropertyChangeEvent;
  }
  
  public void run()
    throws Exception
  {
    val$listener.propertyChange(val$event);
  }
  
  public void handleException(Throwable exception) {}
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.team.core.mapping.ISynchronizationScope;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.mapping.ITeamContentProviderDescriptor;
import org.eclipse.team.ui.mapping.ITeamContentProviderManager;

public class TeamContentProviderManager
  implements ITeamContentProviderManager
{
  public static final String PT_TEAM_CONTENT_PROVIDERS = "teamContentProviders";
  private static ITeamContentProviderManager instance;
  Map descriptors;
  private ListenerList listeners = new ListenerList(1);
  
  public static ITeamContentProviderManager getInstance()
  {
    if (instance == null) {
      instance = new TeamContentProviderManager();
    }
    return instance;
  }
  
  public ITeamContentProviderDescriptor[] getDescriptors()
  {
    lazyInitialize();
    return (ITeamContentProviderDescriptor[])descriptors.values().toArray(new ITeamContentProviderDescriptor[descriptors.size()]);
  }
  
  public String[] getContentProviderIds(ISynchronizationScope scope)
  {
    List result = new ArrayList();
    ITeamContentProviderDescriptor[] descriptors = getDescriptors();
    for (int i = 0; i < descriptors.length; i++)
    {
      ITeamContentProviderDescriptor descriptor = descriptors[i];
      if ((descriptor.isEnabled()) && (scope.getMappings(descriptor.getModelProviderId()).length > 0)) {
        result.add(descriptor.getContentExtensionId());
      }
    }
    return (String[])result.toArray(new String[result.size()]);
  }
  
  public ITeamContentProviderDescriptor getDescriptor(String modelProviderId)
  {
    lazyInitialize();
    return (ITeamContentProviderDescriptor)descriptors.get(modelProviderId);
  }
  
  protected void lazyInitialize()
  {
    if (descriptors != null) {
      return;
    }
    IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.ui", "teamContentProviders");
    IExtension[] extensions = point.getExtensions();
    descriptors = new HashMap(extensions.length * 2);
    int i = 0;
    for (int imax = extensions.length; i < imax; i++)
    {
      ITeamContentProviderDescriptor desc = null;
      try
      {
        desc = new TeamContentProviderDescriptor(extensions[i]);
      }
      catch (CoreException e)
      {
        TeamUIPlugin.log(e);
      }
      if (desc != null) {
        descriptors.put(desc.getModelProviderId(), desc);
      }
    }
  }
  
  public void addPropertyChangeListener(IPropertyChangeListener listener)
  {
    listeners.add(listener);
  }
  
  public void removePropertyChangeListener(IPropertyChangeListener listener)
  {
    listeners.remove(listener);
  }
  
  private void firePropertyChange(PropertyChangeEvent event)
  {
    Object[] allListeners = listeners.getListeners();
    for (int i = 0; i < allListeners.length; i++)
    {
      IPropertyChangeListener listener = (IPropertyChangeListener)allListeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final IPropertyChangeListener val$listener;
        private final PropertyChangeEvent val$event;
        
        public void run()
          throws Exception
        {
          val$listener.propertyChange(val$event);
        }
        
        public void handleException(Throwable exception) {}
      });
    }
  }
  
  public void enablementChanged(ITeamContentProviderDescriptor[] oldEnabled, ITeamContentProviderDescriptor[] newEnabled)
  {
    firePropertyChange(new PropertyChangeEvent(this, "org.eclipse.team.ui.ENABLED_MODEL_PROVIDERS", oldEnabled, newEnabled));
  }
  
  public void setEnabledDescriptors(ITeamContentProviderDescriptor[] descriptors)
  {
    List previouslyEnabled = new ArrayList();
    for (Iterator iter = this.descriptors.values().iterator(); iter.hasNext();)
    {
      TeamContentProviderDescriptor descriptor = (TeamContentProviderDescriptor)iter.next();
      if (descriptor.isEnabled())
      {
        previouslyEnabled.add(descriptor);
        descriptor.setEnabled(false);
      }
    }
    for (int i = 0; i < descriptors.length; i++)
    {
      TeamContentProviderDescriptor descriptor = (TeamContentProviderDescriptor)descriptors[i];
      descriptor.setEnabled(true);
    }
    enablementChanged(
      (ITeamContentProviderDescriptor[])previouslyEnabled.toArray(new ITeamContentProviderDescriptor[previouslyEnabled.size()]), 
      descriptors);
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ui.TeamUIMessages;

public class TeamDecoratorDescription
{
  private static final String TAG_TEAM_DECORATOR = "teamDecorator";
  private static final String ATT_REPOSITORY_ID = "repositoryId";
  private static final String ATT_DECORATOR_ID = "decoratorId";
  private static final String ATT_DECORATED_DIRECTION_ID = "decoratedDirection";
  private static final String OUTGOING_FLAG = "OUTGOING";
  private static final String INCOMING_FLAG = "INCOMING";
  private String repositoryId;
  private String decoratorId;
  private int decoratedDirection;
  
  public TeamDecoratorDescription(IExtension extension)
    throws CoreException
  {
    readExtension(extension);
  }
  
  protected void readExtension(IExtension extension)
    throws CoreException
  {
    String id = extension.getUniqueIdentifier();
    IConfigurationElement[] elements = extension.getConfigurationElements();
    int count = elements.length;
    for (int i = 0; i < count; i++)
    {
      IConfigurationElement element = elements[i];
      String name = element.getName();
      if (name.equalsIgnoreCase("teamDecorator"))
      {
        repositoryId = element.getAttribute("repositoryId");
        decoratorId = element.getAttribute("decoratorId");
        String flags = element.getAttribute("decoratedDirection");
        if (flags == null)
        {
          decoratedDirection = 768;
        }
        else
        {
          if (flags.indexOf("INCOMING") != -1) {
            decoratedDirection |= 0x200;
          }
          if (flags.indexOf("OUTGOING") != -1) {
            decoratedDirection |= 0x100;
          }
          if (decoratedDirection == 0) {
            decoratedDirection = 768;
          }
        }
      }
    }
    if (repositoryId == null) {
      fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { "repositoryId", "teamDecorator", id == null ? "" : id }));
    }
    if (repositoryId == null) {
      fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { "decoratorId", "teamDecorator", id == null ? "" : id }));
    }
  }
  
  protected void fail(String reason)
    throws CoreException
  {
    throw new CoreException(new Status(4, "org.eclipse.team.ui", 0, reason, null));
  }
  
  public String getDecoratorId()
  {
    return decoratorId;
  }
  
  public String getRepositoryId()
  {
    return repositoryId;
  }
  
  public int getDecoratedDirectionFlags()
  {
    return decoratedDirection;
  }
}

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

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.mapping.ITeamContentProviderDescriptor;

public class TeamDecoratorManager
{
  public static final String PT_TEAM_DECORATORS = "teamDecorators";
  private static TeamDecoratorManager instance;
  Map descriptors;
  
  public static TeamDecoratorManager getInstance()
  {
    if (instance == null) {
      instance = new TeamDecoratorManager();
    }
    return instance;
  }
  
  public ITeamContentProviderDescriptor[] getDescriptors()
  {
    lazyInitialize();
    return (ITeamContentProviderDescriptor[])descriptors.values().toArray(new ITeamContentProviderDescriptor[descriptors.size()]);
  }
  
  public TeamDecoratorDescription getDecoratorDescription(String providerId)
  {
    lazyInitialize();
    return (TeamDecoratorDescription)descriptors.get(providerId);
  }
  
  protected void lazyInitialize()
  {
    if (descriptors != null) {
      return;
    }
    IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.ui", "teamDecorators");
    IExtension[] extensions = point.getExtensions();
    descriptors = new HashMap(extensions.length * 2 + 1);
    int i = 0;
    for (int imax = extensions.length; i < imax; i++)
    {
      TeamDecoratorDescription desc = null;
      try
      {
        desc = new TeamDecoratorDescription(extensions[i]);
      }
      catch (CoreException e)
      {
        TeamUIPlugin.log(e);
      }
      if (desc != null) {
        descriptors.put(desc.getRepositoryId(), desc);
      }
    }
  }
}

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

class AbstractSynchronizeModelProvider$1
  extends UnchangedResourceModelElement
{
  AbstractSynchronizeModelProvider$1(IDiffContainer $anonymous0, IResource $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  public boolean hasChildren()
  {
    return true;
  }
}

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

class AbstractSynchronizeModelProvider$2
  implements Runnable
{
  final AbstractSynchronizeModelProvider this$0;
  
  AbstractSynchronizeModelProvider$2(AbstractSynchronizeModelProvider paramAbstractSynchronizeModelProvider)
  {
    this$0 = paramAbstractSynchronizeModelProvider;
  }
  
  public void run()
  {
    AbstractSynchronizeModelProvider.access$0(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.AbstractSynchronizeModelProvider.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.IResource;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.widgets.Control;

class AbstractSynchronizeModelProvider$3
  implements Runnable
{
  final AbstractSynchronizeModelProvider this$0;
  private final StructuredViewer val$viewer;
  private final IResource[][] val$expandedResources;
  private final IResource[][] val$selectedResources;
  private final boolean val$storeChecks;
  private final IResource[][] val$checkedResources;
  
  AbstractSynchronizeModelProvider$3(AbstractSynchronizeModelProvider paramAbstractSynchronizeModelProvider, StructuredViewer paramStructuredViewer, IResource[][] paramArrayOfIResource1, IResource[][] paramArrayOfIResource2, boolean paramBoolean, IResource[][] paramArrayOfIResource3)
  {
    this$0 = paramAbstractSynchronizeModelProvider;val$viewer = paramStructuredViewer;val$expandedResources = paramArrayOfIResource1;val$selectedResources = paramArrayOfIResource2;val$storeChecks = paramBoolean;val$checkedResources = paramArrayOfIResource3;
  }
  
  public void run()
  {
    if ((val$viewer != null) && (!val$viewer.getControl().isDisposed()))
    {
      val$expandedResources[0] = this$0.getExpandedResources();
      val$selectedResources[0] = this$0.getSelectedResources();
      if (val$storeChecks) {
        val$checkedResources[0] = this$0.getCheckedResources();
      }
    }
  }
}

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

class AbstractSynchronizeModelProvider$4
  implements Runnable
{
  final AbstractSynchronizeModelProvider this$0;
  
  AbstractSynchronizeModelProvider$4(AbstractSynchronizeModelProvider paramAbstractSynchronizeModelProvider)
  {
    this$0 = paramAbstractSynchronizeModelProvider;
  }
  
  public void run()
  {
    AbstractSynchronizeModelProvider.access$1(this$0).dispose();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchronize.AbstractSynchronizeModelProvider.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.runtime.IProgressMonitor;
import org.eclipse.team.core.synchronize.ISyncInfoSetChangeEvent;
import org.eclipse.team.core.synchronize.ISyncInfoTreeChangeEvent;

class AbstractSynchronizeModelProvider$5
  implements Runnable
{
  final AbstractSynchronizeModelProvider this$0;
  private final ISyncInfoSetChangeEvent val$event;
  private final IProgressMonitor val$monitor;
  
  AbstractSynchronizeModelProvider$5(AbstractSynchronizeModelProvider paramAbstractSynchronizeModelProvider, ISyncInfoSetChangeEvent paramISyncInfoSetChangeEvent, IProgressMonitor paramIProgressMonitor)
  {
    this$0 = paramAbstractSynchronizeModelProvider;val$event = paramISyncInfoSetChangeEvent;val$monitor = paramIProgressMonitor;
  }
  
  public void run()
  {
    this$0.handleChanges((ISyncInfoTreeChangeEvent)val$event, val$monitor);
  }
}

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