org.eclipse.mylyn.tasks.bugs_3.7.1.v20120425-0100

16:46:51.334 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.tasks.bugs_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.tasks.bugs;

import org.eclipse.core.runtime.IProgressMonitor;

public abstract class AbstractSupportHandler
{
  public void preProcess(ISupportRequest request) {}
  
  public void process(ITaskContribution contribution, IProgressMonitor monitor) {}
  
  public void postProcess(ISupportResponse response, IProgressMonitor monitor) {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.bugs.AbstractSupportHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.bugs;

public abstract interface IProvider
{
  public abstract String getName();
  
  public abstract String getDescription();
  
  public abstract String getId();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.bugs.IProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.bugs;

import org.eclipse.core.runtime.IStatus;

public abstract interface ITaskContribution
{
  public abstract void appendToDescription(String paramString);
  
  public abstract String getAttribute(String paramString);
  
  public abstract IProduct getProduct();
  
  public abstract IStatus getStatus();
  
  public abstract boolean isHandled();
  
  public abstract void setAttribute(String paramString1, String paramString2);
  
  public abstract void setHandled(boolean paramBoolean);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.bugs.ITaskContribution
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.bugs;

import org.eclipse.core.runtime.IStatus;

public abstract interface ISupportRequest
{
  public abstract ITaskContribution getOrCreateContribution(IProduct paramIProduct);
  
  public abstract ITaskContribution getDefaultContribution();
  
  public abstract IStatus getStatus();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.bugs.ISupportRequest
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.bugs;

public abstract interface IProduct
{
  public abstract String getName();
  
  public abstract String getDescription();
  
  public abstract String getId();
  
  public abstract IProvider getProvider();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.bugs.IProduct
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.bugs;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.tasks.core.data.TaskData;

public abstract interface ISupportResponse
{
  public abstract IProduct getProduct();
  
  public abstract IStatus getStatus();
  
  public abstract TaskData getTaskData();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.bugs.ISupportResponse
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.data.TaskData;

class TaskErrorReporter$2
  implements Runnable
{
  TaskErrorReporter$2(TaskErrorReporter paramTaskErrorReporter, TaskData paramTaskData) {}
  
  public void run()
  {
    try
    {
      TasksUiInternal.createAndOpenNewTask(val$taskData);
    }
    catch (CoreException e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.bugs", 
        "Unexpected error while creating task", e));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.TaskErrorReporter.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.tasks.bugs.AbstractSupportHandler;
import org.eclipse.mylyn.tasks.bugs.ISupportResponse;

class SupportHandlerManager$2
  implements ISafeRunnable
{
  SupportHandlerManager$2(SupportHandlerManager paramSupportHandlerManager, AbstractSupportHandler paramAbstractSupportHandler, ISupportResponse paramISupportResponse, IProgressMonitor paramIProgressMonitor) {}
  
  public void handleException(Throwable e)
  {
    StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.bugs", "Task contributor failed", e));
  }
  
  public void run()
    throws Exception
  {
    val$contributor.postProcess(val$response, val$monitor);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.SupportHandlerManager.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.core.ICoreRunnable;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.ui.CommonUiUtil;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.bugs.wizards.ReportErrorWizard;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.bugs.IProduct;
import org.eclipse.mylyn.tasks.bugs.ITaskContribution;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.swt.widgets.Display;

public class TaskErrorReporter
{
  private final SupportHandlerManager handlerManager;
  private final SupportProviderManager providerManager;
  
  public TaskErrorReporter()
  {
    handlerManager = new SupportHandlerManager();
    providerManager = new SupportProviderManager();
  }
  
  public SupportHandlerManager getHandlerManager()
  {
    return handlerManager;
  }
  
  public SupportRequest preProcess(IStatus status, IProduct product)
  {
    Assert.isNotNull(status);
    
    SupportRequest request = new SupportRequest(providerManager, status, product);
    handlerManager.preProcess(request);
    return request;
  }
  
  public boolean process(final ITaskContribution response, IRunnableContext context)
  {
    Assert.isNotNull(response);
    ICoreRunnable runner = new ICoreRunnable()
    {
      /* Error */
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        // Byte code:
        //   0: aload_1
        //   1: getstatic 46	org/eclipse/mylyn/internal/tasks/bugs/Messages:TaskErrorReporter_Job_Progress_Process_support_request	Ljava/lang/String;
        //   4: iconst_m1
        //   5: invokeinterface 52 3 0
        //   10: aload_0
        //   11: getfield 47	org/eclipse/mylyn/internal/tasks/bugs/TaskErrorReporter$1:this$0	Lorg/eclipse/mylyn/internal/tasks/bugs/TaskErrorReporter;
        //   14: aload_0
        //   15: getfield 48	org/eclipse/mylyn/internal/tasks/bugs/TaskErrorReporter$1:val$response	Lorg/eclipse/mylyn/tasks/bugs/ITaskContribution;
        //   18: checkcast 24	org/eclipse/mylyn/internal/tasks/bugs/AttributeTaskMapper
        //   21: aload_1
        //   22: invokevirtual 50	org/eclipse/mylyn/internal/tasks/bugs/TaskErrorReporter:process	(Lorg/eclipse/mylyn/internal/tasks/bugs/AttributeTaskMapper;Lorg/eclipse/core/runtime/IProgressMonitor;)V
        //   25: goto +12 -> 37
        //   28: astore_2
        //   29: aload_1
        //   30: invokeinterface 51 1 0
        //   35: aload_2
        //   36: athrow
        //   37: aload_1
        //   38: invokeinterface 51 1 0
        //   43: return
        // Line number table:
        //   Java source line #64	-> byte code offset #0
        //   Java source line #65	-> byte code offset #4
        //   Java source line #64	-> byte code offset #5
        //   Java source line #66	-> byte code offset #10
        //   Java source line #67	-> byte code offset #28
        //   Java source line #68	-> byte code offset #29
        //   Java source line #69	-> byte code offset #35
        //   Java source line #68	-> byte code offset #37
        //   Java source line #70	-> byte code offset #43
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	44	0	this	1
        //   0	44	1	monitor	IProgressMonitor
        //   28	8	2	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   0	28	28	finally
      }
    };
    try
    {
      CommonUiUtil.run(context, runner);
    }
    catch (CoreException e)
    {
      TasksUiInternal.logAndDisplayStatus(Messages.TaskErrorReporter_Create_Task_Error_Title, new Status(
        4, "org.eclipse.mylyn.tasks.bugs", Messages.TaskErrorReporter_Create_Task_Error_Message, e));
      return false;
    }
    catch (OperationCanceledException localOperationCanceledException)
    {
      return false;
    }
    return true;
  }
  
  public void process(AttributeTaskMapper mapper, IProgressMonitor monitor)
    throws CoreException
  {
    Assert.isNotNull(mapper);
    handlerManager.process(mapper, monitor);
    if (!mapper.isHandled())
    {
      final TaskData taskData = mapper.createTaskData(monitor);
      mapper.setTaskData(taskData);
      handlerManager.postProcess(mapper, monitor);
      
      Display.getDefault().asyncExec(new Runnable()
      {
        public void run()
        {
          try
          {
            TasksUiInternal.createAndOpenNewTask(taskData);
          }
          catch (CoreException e)
          {
            StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.bugs", 
              "Unexpected error while creating task", e));
          }
        }
      });
    }
  }
  
  public void handle(IStatus status)
  {
    ReportErrorWizard wizard = new ReportErrorWizard(this, status);
    WizardDialog dialog = new WizardDialog(WorkbenchUtil.getShell(), wizard);
    dialog.setBlockOnOpen(false);
    dialog.setPageSize(500, 200);
    dialog.open();
  }
  
  public SupportProviderManager getProviderManager()
  {
    return providerManager;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.TaskErrorReporter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.mylyn.tasks.core.TaskMapping;

class DefaultSupportHandler$1
  extends TaskMapping
{
  DefaultSupportHandler$1(DefaultSupportHandler paramDefaultSupportHandler) {}
  
  public String getSeverity()
  {
    return "enhancement";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.DefaultSupportHandler.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.core.runtime.IBundleGroupProvider;
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.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.tasks.bugs.IProvider;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.plugin.AbstractUIPlugin;

public class SupportProviderManager
{
  private static final String ATTRIBUTE_CATEGORY_ID = "categoryId";
  private static final String ATTRIBUTE_DESCRIPTION = "description";
  private static final String ATTRIBUTE_FEATURE_ID = "featureId";
  private static final String ATTRIBUTE_ICON = "icon";
  private static final String ATTRIBUTE_ID = "id";
  private static final String ATTRIBUTE_NAME = "name";
  private static final String ATTRIBUTE_NAMESPACE = "namespace";
  private static final String ATTRIBUTE_PLUGIN_ID = "pluginId";
  private static final String ATTRIBUTE_PRODUCT_ID = "productId";
  private static final String ATTRIBUTE_PROVIDER_ID = "providerId";
  private static final String ATTRIBUTE_REPOSITORY_KIND = "kind";
  private static final String ATTRIBUTE_REPOSITORY_URL = "url";
  private static final String ATTRIBUTE_URL = "url";
  private static final String ATTRIBUTE_VALUE = "value";
  private static final String ATTRIBUTE_WEIGHT = "weight";
  private static final String ELEMENT_CATEGORY = "category";
  private static final String ELEMENT_MAPPING = "mapping";
  private static final String ELEMENT_PRODUCT = "product";
  private static final String ELEMENT_PROPERTY = "property";
  private static final String ELEMENT_PROVIDER = "provider";
  private static final String ELEMENT_REPOSITORY = "repository";
  private static final String EXTENSION_ID_PLUGIN_SUPPORT = "org.eclipse.mylyn.tasks.bugs.support";
  private HashMap<String, IBundleGroup> bundleGroupById;
  private List<SupportCategory> categories;
  private SupportProduct defaultProduct;
  private Map<String, SupportProduct> productById;
  private Map<String, SupportProvider> providerById;
  
  public SupportProviderManager()
  {
    readExtensions();
  }
  
  public void addCategory(SupportCategory category)
  {
    categories.add(category);
  }
  
  public boolean addProduct(SupportProduct product)
  {
    if (providerById.containsKey(product.getId())) {
      return false;
    }
    productById.put(product.getId(), product);
    return true;
  }
  
  public boolean addProvider(SupportProvider provider)
  {
    if (providerById.containsKey(provider.getId())) {
      return false;
    }
    providerById.put(provider.getId(), provider);
    return true;
  }
  
  private IBundleGroup getBundleGroup(String featureId)
  {
    if (bundleGroupById == null)
    {
      bundleGroupById = new HashMap();
      IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
      if (providers != null)
      {
        IBundleGroupProvider[] arrayOfIBundleGroupProvider1;
        int j = (arrayOfIBundleGroupProvider1 = providers).length;
        for (int i = 0; i < j; i++)
        {
          IBundleGroupProvider provider = arrayOfIBundleGroupProvider1[i];
          IBundleGroup[] arrayOfIBundleGroup;
          int m = (arrayOfIBundleGroup = provider.getBundleGroups()).length;
          for (int k = 0; k < m; k++)
          {
            IBundleGroup bundleGroup = arrayOfIBundleGroup[k];
            bundleGroupById.put(bundleGroup.getIdentifier(), bundleGroup);
          }
        }
      }
    }
    return (IBundleGroup)bundleGroupById.get(featureId);
  }
  
  public Collection<SupportCategory> getCategories()
  {
    return Collections.unmodifiableList(categories);
  }
  
  public SupportCategory getCategory(String categoryId)
  {
    for (SupportCategory category : categories) {
      if (category.getId().equals(categoryId)) {
        return category;
      }
    }
    return null;
  }
  
  public SupportProduct getDefaultProduct()
  {
    return defaultProduct;
  }
  
  public SupportProduct getProduct(String productId)
  {
    return (SupportProduct)productById.get(productId);
  }
  
  public Collection<SupportProduct> getProducts()
  {
    return Collections.unmodifiableCollection(productById.values());
  }
  
  public SupportProvider getProvider(String providerId)
  {
    return (SupportProvider)providerById.get(providerId);
  }
  
  public Collection<SupportProvider> getProviders()
  {
    return Collections.unmodifiableCollection(providerById.values());
  }
  
  private boolean readAttributes(IConfigurationElement element, AbstractSupportElement item)
  {
    item.setId(element.getAttribute("id"));
    item.setName(element.getAttribute("name"));
    item.setDescription(element.getAttribute("description"));
    item.setUrl(element.getAttribute("url"));
    String iconPath = element.getAttribute("icon");
    if (iconPath != null)
    {
      ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(), 
        iconPath);
      if (descriptor != null) {
        item.setIcon(descriptor);
      }
    }
    boolean available = true;
    String featureId = element.getAttribute("featureId");
    if (featureId != null)
    {
      IBundleGroup bundleGroup = getBundleGroup(featureId);
      if (bundleGroup == null)
      {
        available = false;
      }
      else
      {
        if (item.getName() == null) {
          item.setName(bundleGroup.getName());
        }
        if (item.getDescription() == null) {
          item.setDescription(bundleGroup.getDescription());
        }
        if (item.getIcon() == null)
        {
          String imageUrl = bundleGroup.getProperty("featureImage");
          if (imageUrl != null) {
            try
            {
              item.setIcon(ImageDescriptor.createFromURL(new URL(imageUrl)));
            }
            catch (MalformedURLException localMalformedURLException) {}
          }
        }
        if ((item instanceof SupportProduct)) {
          ((SupportProduct)item).setBundleGroup(bundleGroup);
        }
      }
    }
    if (item.getName() == null) {
      item.setName(Messages.SupportProviderManager_Product_Unknown);
    }
    return available;
  }
  
  private void readCategory(IConfigurationElement element)
  {
    SupportCategory category = new SupportCategory();
    readAttributes(element, category);
    String weight = element.getAttribute("weight");
    if (weight != null) {
      try
      {
        category.setWeight(Integer.parseInt(weight));
      }
      catch (NumberFormatException localNumberFormatException) {}
    }
    categories.add(category);
  }
  
  private void readExtensions()
  {
    categories = new ArrayList();
    productById = new HashMap();
    providerById = new HashMap();
    defaultProduct = new SupportProduct();
    
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IExtensionPoint extensionPoint = registry.getExtensionPoint("org.eclipse.mylyn.tasks.bugs.support");
    IExtension[] extensions = extensionPoint.getExtensions();
    IExtension[] arrayOfIExtension1;
    int j = (arrayOfIExtension1 = extensions).length;
    IConfigurationElement[] arrayOfIConfigurationElement1;
    int m;
    int k;
    for (int i = 0; i < j; i++)
    {
      IExtension extension = arrayOfIExtension1[i];
      IConfigurationElement[] elements = extension.getConfigurationElements();
      m = (arrayOfIConfigurationElement1 = elements).length;
      for (k = 0; k < m; k++)
      {
        IConfigurationElement element = arrayOfIConfigurationElement1[k];
        if (element.getName().equals("category")) {
          readCategory(element);
        }
      }
    }
    j = (arrayOfIExtension1 = extensions).length;
    for (i = 0; i < j; i++)
    {
      IExtension extension = arrayOfIExtension1[i];
      IConfigurationElement[] elements = extension.getConfigurationElements();
      m = (arrayOfIConfigurationElement1 = elements).length;
      for (k = 0; k < m; k++)
      {
        IConfigurationElement element = arrayOfIConfigurationElement1[k];
        if (element.getName().equals("provider")) {
          readProvider(element);
        }
      }
    }
    j = (arrayOfIExtension1 = extensions).length;
    for (i = 0; i < j; i++)
    {
      IExtension extension = arrayOfIExtension1[i];
      IConfigurationElement[] elements = extension.getConfigurationElements();
      m = (arrayOfIConfigurationElement1 = elements).length;
      for (k = 0; k < m; k++)
      {
        IConfigurationElement element = arrayOfIConfigurationElement1[k];
        if (element.getName().equals("product")) {
          readProduct(element);
        }
      }
    }
    j = (arrayOfIExtension1 = extensions).length;
    for (i = 0; i < j; i++)
    {
      IExtension extension = arrayOfIExtension1[i];
      IConfigurationElement[] elements = extension.getConfigurationElements();
      m = (arrayOfIConfigurationElement1 = elements).length;
      for (k = 0; k < m; k++)
      {
        IConfigurationElement element = arrayOfIConfigurationElement1[k];
        if (element.getName().equals("mapping")) {
          readMapping(element);
        }
      }
    }
    bundleGroupById = null;
  }
  
  private ProductRepositoryMapping readMapping(IConfigurationElement element)
  {
    String namespace = element.getAttribute("namespace");
    String productId = element.getAttribute("productId");
    Map<String, String> attributes = new HashMap();
    IConfigurationElement[] arrayOfIConfigurationElement;
    int j = (arrayOfIConfigurationElement = element.getChildren("repository")).length;
    for (int i = 0; i < j; i++)
    {
      IConfigurationElement attributeElement = arrayOfIConfigurationElement[i];
      String repositoryUrl = attributeElement.getAttribute("url");
      attributes.put("repositoryUrl", repositoryUrl);
      String connectorKind = attributeElement.getAttribute("kind");
      attributes.put("repositoryKind", connectorKind);
    }
    j = (arrayOfIConfigurationElement = element.getChildren("property")).length;
    for (i = 0; i < j; i++)
    {
      IConfigurationElement attributeElement = arrayOfIConfigurationElement[i];
      String name = attributeElement.getAttribute("name");
      String value = attributeElement.getAttribute("value");
      attributes.put(name, value);
    }
    if (!attributes.isEmpty())
    {
      ProductRepositoryMapping mapping = new ProductRepositoryMapping(namespace);
      mapping.addAttributes(attributes);
      SupportProduct product;
      SupportProduct product;
      if (productId == null)
      {
        product = defaultProduct;
      }
      else
      {
        product = getProduct(productId);
        if (product == null)
        {
          StatusHandler.log(new Status(
            2, 
            "org.eclipse.mylyn.tasks.bugs", 
            NLS.bind(
            "Mapping contributed by {0} with namespace ''{1}'' ignored, unkown product id ''{1}'' specified", 
            new String[] { element.getNamespaceIdentifier(), namespace, productId })));
          return null;
        }
      }
      product.addRepositoryMapping(mapping);
      return mapping;
    }
    StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.bugs", NLS.bind(
      "Mapping contributed by {0} with namespace ''{1}'' ignored, no attributes specified", 
      new String[] { element.getNamespaceIdentifier(), namespace })));
    return null;
  }
  
  private SupportProduct readProduct(IConfigurationElement element)
  {
    String id = element.getAttribute("id");
    String providerId = element.getAttribute("providerId");
    IProvider provider = getProvider(providerId);
    if (provider == null)
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.bugs", NLS.bind(
        "Product contributed by {0} with id ''{1}'' ignored, unknown provider id ''{2}'' specified", 
        new String[] { element.getNamespaceIdentifier(), id, providerId })));
      return null;
    }
    boolean enabled = true;
    String pluginId = element.getAttribute("pluginId");
    if (pluginId != null) {
      enabled &= Platform.getBundle(pluginId) != null;
    }
    SupportProduct product = new SupportProduct();
    enabled &= readAttributes(element, product);
    
    product.setInstalled(enabled);
    product.setProvider(provider);
    if (!addProduct(product))
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.bugs", NLS.bind(
        "Product contributed by {0} ignored, id ''{1}'' already present", 
        element.getNamespaceIdentifier(), id)));
      return null;
    }
    ((SupportProvider)provider).add(product);
    productById.put(id, product);
    return product;
  }
  
  private SupportProvider readProvider(IConfigurationElement element)
  {
    String id = element.getAttribute("id");
    SupportProvider provider = new SupportProvider();
    readAttributes(element, provider);
    if (!addProvider(provider))
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.bugs", NLS.bind(
        "Provider contributed by {0} ignored, id ''{1}'' already present", 
        element.getNamespaceIdentifier(), id)));
      return null;
    }
    String categoryId = element.getAttribute("categoryId");
    SupportCategory category = getCategory(categoryId);
    if (category == null)
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.bugs", NLS.bind(
        "Provider contributed by {0} ignored with id ''{1}'' ignored, category id ''{2}'' is invalid", 
        new String[] { element.getNamespaceIdentifier(), id, categoryId })));
      return null;
    }
    providerById.put(id, provider);
    category.add(provider);
    provider.setCategory(category);
    return provider;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.SupportProviderManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.tasks.bugs.AbstractSupportHandler;

class SupportHandlerManager$3
  implements ISafeRunnable
{
  SupportHandlerManager$3(SupportHandlerManager paramSupportHandlerManager, AbstractSupportHandler paramAbstractSupportHandler, SupportRequest paramSupportRequest) {}
  
  public void handleException(Throwable e)
  {
    StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.bugs", "Task contributor failed", e));
  }
  
  public void run()
    throws Exception
  {
    val$contributor.preProcess(val$request);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.SupportHandlerManager.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.mylyn.tasks.bugs.IProduct;
import org.eclipse.mylyn.tasks.bugs.IProvider;

public class SupportProduct
  extends AbstractSupportElement
  implements IProduct
{
  private IBundleGroup bundleGroup;
  private boolean installed;
  TreeMap<String, ProductRepositoryMapping> mappingByNamespace;
  private String pluginId;
  private IProvider provider;
  
  public SupportProduct()
  {
    mappingByNamespace = new TreeMap();
  }
  
  public void addRepositoryMapping(ProductRepositoryMapping mapping)
  {
    ProductRepositoryMapping existingMapping = (ProductRepositoryMapping)mappingByNamespace.get(mapping.getNamespace());
    if (existingMapping != null) {
      existingMapping.getAttributes().putAll(mapping.getAttributes());
    } else {
      mappingByNamespace.put(mapping.getNamespace(), mapping);
    }
  }
  
  public Map<String, String> getAllAttributes(String prefix)
  {
    Map<String, String> attributes = null;
    for (int i = 0; i <= prefix.length(); i++)
    {
      ProductRepositoryMapping mapping = getMapping(prefix.substring(0, i));
      if (mapping != null)
      {
        if (attributes == null) {
          attributes = new HashMap();
        }
        attributes.putAll(mapping.getAttributes());
      }
    }
    if (attributes != null) {
      return attributes;
    }
    return new HashMap();
  }
  
  public String getAttribute(String prefix, String key)
  {
    for (int i = prefix.length() - 1; i >= 0; i--)
    {
      ProductRepositoryMapping mapping = getMapping(prefix.substring(0, i));
      if (mapping != null)
      {
        String value = (String)mapping.getAttributes().get(key);
        if (value != null) {
          return value;
        }
      }
    }
    return null;
  }
  
  public IBundleGroup getBundleGroup()
  {
    return bundleGroup;
  }
  
  public ProductRepositoryMapping getMapping(String prefix)
  {
    return (ProductRepositoryMapping)mappingByNamespace.get(prefix);
  }
  
  public String getPluginId()
  {
    return pluginId;
  }
  
  public IProvider getProvider()
  {
    return provider;
  }
  
  public boolean hasMappings()
  {
    return !mappingByNamespace.isEmpty();
  }
  
  @Deprecated
  public boolean isEnabled()
  {
    return isInstalled();
  }
  
  public boolean isInstalled()
  {
    return installed;
  }
  
  public void setBundleGroup(IBundleGroup bundleGroup)
  {
    this.bundleGroup = bundleGroup;
  }
  
  @Deprecated
  public void setEnabled(boolean enabled)
  {
    setInstalled(enabled);
  }
  
  public void setInstalled(boolean enabled)
  {
    installed = enabled;
  }
  
  public void setPluginId(String pluginId)
  {
    this.pluginId = pluginId;
  }
  
  public void setProvider(IProvider provider)
  {
    this.provider = provider;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.SupportProduct
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.mylyn.tasks.core.TaskMapping;

class DefaultSupportHandler$2
  extends TaskMapping
{
  DefaultSupportHandler$2(DefaultSupportHandler paramDefaultSupportHandler, String paramString) {}
  
  public String getVersion()
  {
    return val$version;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.DefaultSupportHandler.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import java.util.HashMap;
import java.util.Map;

public class ProductRepositoryMapping
{
  private final Map<String, String> attributes;
  private final String namespace;
  
  public ProductRepositoryMapping(String namespace)
  {
    this.namespace = namespace;
    attributes = new HashMap();
  }
  
  public void addAttributes(Map<String, String> attributes)
  {
    this.attributes.putAll(attributes);
  }
  
  public Map<String, String> getAttributes()
  {
    return attributes;
  }
  
  public String getNamespace()
  {
    return namespace;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.ProductRepositoryMapping
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.TaskMapping;

public class KeyValueMapping
  extends TaskMapping
{
  private final Map<String, String> attributes;
  
  public KeyValueMapping(Map<String, String> attributes)
  {
    Assert.isNotNull(attributes);
    this.attributes = attributes;
  }
  
  public String getComponent()
  {
    return (String)attributes.get("component");
  }
  
  public String getDescription()
  {
    return (String)attributes.get("description");
  }
  
  public List<String> getKeywords()
  {
    return null;
  }
  
  public String getOwner()
  {
    return null;
  }
  
  public String getPriority()
  {
    return (String)attributes.get("priority");
  }
  
  public String getProduct()
  {
    return (String)attributes.get("product");
  }
  
  public String getSeverity()
  {
    return (String)attributes.get("severity");
  }
  
  public String getSummary()
  {
    return (String)attributes.get("summary");
  }
  
  public String getTaskKind()
  {
    return null;
  }
  
  public String getVersion()
  {
    return (String)attributes.get("version");
  }
  
  public void merge(ITaskMapping source) {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.KeyValueMapping
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.commons.core.AbstractErrorReporter;
import org.eclipse.mylyn.internal.tasks.bugs.wizards.ErrorLogStatus;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class TasksBugsPlugin
  extends AbstractUIPlugin
{
  public static final String ID_PLUGIN = "org.eclipse.mylyn.tasks.bugs";
  private static TasksBugsPlugin INSTANCE;
  private static TaskErrorReporter taskErrorReporter;
  
  public static class BugReporter
    extends AbstractErrorReporter
  {
    public int getPriority(IStatus status)
    {
      if ((status instanceof ErrorLogStatus)) {
        return PRIORITY_DEFAULT;
      }
      return PRIORITY_NONE;
    }
    
    public void handle(final IStatus status)
    {
      IWorkbench workbench = PlatformUI.getWorkbench();
      if (workbench != null)
      {
        Display display = workbench.getDisplay();
        if ((display != null) && (!display.isDisposed())) {
          display.asyncExec(new Runnable()
          {
            public void run()
            {
              TasksBugsPlugin.getTaskErrorReporter().handle(status);
            }
          });
        }
      }
    }
  }
  
  public static TasksBugsPlugin getDefault()
  {
    return INSTANCE;
  }
  
  public static synchronized TaskErrorReporter getTaskErrorReporter()
  {
    if (taskErrorReporter == null) {
      taskErrorReporter = new TaskErrorReporter();
    }
    return taskErrorReporter;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    INSTANCE = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    INSTANCE = null;
    super.stop(context);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.TasksBugsPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.bugs.IProduct;
import org.eclipse.mylyn.tasks.bugs.ISupportResponse;
import org.eclipse.mylyn.tasks.bugs.ITaskContribution;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.TasksUi;

public class AttributeTaskMapper
  implements ITaskContribution, ISupportResponse
{
  private final Map<String, String> attributes;
  private final IProduct product;
  private final IStatus status;
  private TaskData taskData;
  private boolean handled;
  
  public AttributeTaskMapper(IStatus status, IProduct product)
  {
    Assert.isNotNull(status);
    Assert.isNotNull(product);
    this.status = status;
    this.product = product;
    attributes = new HashMap();
  }
  
  public void appendToDescription(String text)
  {
    String description = getAttribute("description");
    setAttribute("description", description != null ? description + text : text);
  }
  
  public TaskData createTaskData(IProgressMonitor monitor)
    throws CoreException
  {
    ITaskMapping taskMapping = getTaskMapping();
    return TasksUiInternal.createTaskData(getTaskRepository(), taskMapping, taskMapping, monitor);
  }
  
  public String getAttribute(String name)
  {
    return (String)attributes.get(name);
  }
  
  public Map<String, String> getAttributes()
  {
    return attributes;
  }
  
  public IProduct getProduct()
  {
    return product;
  }
  
  public IStatus getStatus()
  {
    return status;
  }
  
  public TaskData getTaskData()
  {
    return taskData;
  }
  
  public ITaskMapping getTaskMapping()
  {
    return new KeyValueMapping(attributes);
  }
  
  public TaskRepository getTaskRepository()
  {
    TaskRepository taskRepository = null;
    String repositoryUrl = (String)attributes.get("repositoryUrl");
    if (repositoryUrl != null)
    {
      String connectorKind = (String)attributes.get("repositoryKind");
      if (connectorKind != null) {
        taskRepository = TasksUi.getRepositoryManager().getRepository(connectorKind, repositoryUrl);
      }
    }
    return taskRepository;
  }
  
  public boolean isMappingComplete()
  {
    return (getAttribute("org.eclipse.mylyn.tasks.bugs.mappingComplete") != null) || (getTaskRepository() != null);
  }
  
  public void setAttribute(String name, String value)
  {
    attributes.put(name, value);
  }
  
  void setTaskData(TaskData taskData)
  {
    this.taskData = taskData;
  }
  
  public boolean isHandled()
  {
    return handled;
  }
  
  public void setHandled(boolean handled)
  {
    this.handled = handled;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.AttributeTaskMapper
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import org.eclipse.core.runtime.IStatus;

class TasksBugsPlugin$BugReporter$1
  implements Runnable
{
  TasksBugsPlugin$BugReporter$1(TasksBugsPlugin.BugReporter paramBugReporter, IStatus paramIStatus) {}
  
  public void run()
  {
    TasksBugsPlugin.getTaskErrorReporter().handle(val$status);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.TasksBugsPlugin.BugReporter.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.mylyn.tasks.bugs.IProvider;

public class SupportCategory
  extends AbstractSupportElement
{
  private static final int DEFAULT_WEIGHT = 1000;
  private List<IProvider> providers;
  private int weight;
  
  public SupportCategory()
  {
    setWeight(1000);
  }
  
  public void add(IProvider provider)
  {
    if (providers == null) {
      providers = new ArrayList();
    }
    providers.add(provider);
  }
  
  public void remove(IProvider provider)
  {
    if (providers != null) {
      providers.remove(provider);
    }
  }
  
  public List<IProvider> getProviders()
  {
    if (providers == null) {
      return Collections.emptyList();
    }
    return new ArrayList(providers);
  }
  
  public int getWeight()
  {
    return weight;
  }
  
  public void setWeight(int weight)
  {
    this.weight = weight;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.bugs.SupportCategory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.bugs;

public class IRepositoryConstants
{
  @Deprecated
  public static final String BRANDING = "branding";
  public static final String COMPONENT = "component";
  public static final String CONNECTOR_KIND = "repositoryKind";
  public static final String DESCRIPTION = "description";
  public static final String PRODUCT = "product";
  @Deprecated
  public static final String PRODUCT_CATEGORY = "productCategory";
  @Deprecated
  public static final String PRODUCT_DESCRIPTION = "productDescription";
  @Deprecated
  public static final String PRODUCT_NAME = "productName";
  @Deprecated
  public static final String PRODUCT_TITLE = "productTitle";
  @Deprecated
  public static final String REPOSITORY_KIND = "repositoryKind";
  public static final String REPOSITORY_URL = "repositoryUrl";
  public static final String SEVERITY = "severity";
  public static final String VERSION = "version";
  p
1 2 3 4

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-2017. Infinite Loop Ltd