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

  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryMigrator;
import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;

class TasksUiExtensionReader$ConnectorDescriptor
{
  IConfigurationElement element;
  IConfigurationElement taskListMigratorElement;
  IConfigurationElement repositoryMigratorElement;
  AbstractRepositoryConnector repositoryConnector;
  AbstractTaskListMigrator taskListMigrator;
  AbstractRepositoryMigrator repositoryMigrator;
  private final String id;
  
  public TasksUiExtensionReader$ConnectorDescriptor(IConfigurationElement element)
  {
    this.element = element;
    id = element.getAttribute("id");
  }
  
  public String getId()
  {
    return id;
  }
  
  public String getConnectorKind()
  {
    return repositoryConnector != null ? repositoryConnector.getConnectorKind() : null;
  }
  
  public IStatus createConnector()
  {
    Assert.isTrue(repositoryConnector == null);
    try
    {
      Object connectorCore = element.createExecutableExtension("class");
      if ((connectorCore instanceof AbstractRepositoryConnector))
      {
        repositoryConnector = ((AbstractRepositoryConnector)connectorCore);
        return Status.OK_STATUS;
      }
      return new Status(4, "org.eclipse.mylyn.tasks.ui", "Could not load connector core " + 
        connectorCore.getClass().getCanonicalName());
    }
    catch (Throwable e)
    {
      return new Status(4, "org.eclipse.mylyn.tasks.ui", "Could not load connector core", e);
    }
  }
  
  public IStatus createTaskListMigrator()
  {
    Assert.isTrue(taskListMigrator == null);
    try
    {
      Object migratorObject = taskListMigratorElement.createExecutableExtension("class");
      if ((migratorObject instanceof AbstractTaskListMigrator))
      {
        taskListMigrator = ((AbstractTaskListMigrator)migratorObject);
        return Status.OK_STATUS;
      }
      return new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not load task list migrator: " + migratorObject.getClass().getCanonicalName() + 
        " must implement " + AbstractTaskListMigrator.class.getCanonicalName());
    }
    catch (Throwable e)
    {
      return new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not load task list migrator extension", e);
    }
  }
  
  public IStatus createRepositoryMigrator()
  {
    Assert.isTrue(repositoryMigrator == null);
    try
    {
      Object migratorObject = repositoryMigratorElement.createExecutableExtension("class");
      if ((migratorObject instanceof AbstractRepositoryMigrator))
      {
        repositoryMigrator = ((AbstractRepositoryMigrator)migratorObject);
        return Status.OK_STATUS;
      }
      return new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not load repository migrator: " + migratorObject.getClass().getCanonicalName() + 
        " must implement " + AbstractRepositoryMigrator.class.getCanonicalName());
    }
    catch (Throwable e)
    {
      return new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not load repository migrator extension", e);
    }
  }
  
  public String getPluginId()
  {
    return element.getContributor().getName();
  }
}

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

import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;

class TasksUiInternal$5
  extends JobChangeAdapter
{
  TasksUiInternal$5(RepositoryQuery paramRepositoryQuery) {}
  
  public void done(IJobChangeEvent event)
  {
    if (val$query.getStatus() != null) {
      TasksUiInternal.asyncLogAndDisplayStatus(Messages.TasksUiInternal_Query_Synchronization_Failed, 
        val$query.getStatus());
    }
  }
}

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

public abstract class TaskOpenListener
{
  public void taskOpened(TaskOpenEvent event) {}
}

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

import java.util.Comparator;
import java.util.Date;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskKeyComparator;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.ui.IMemento;

public class TaskComparator
  implements Comparator<ITask>
{
  private final SortCriterion[] sortCriteria;
  public static final int DEFAULT_SORT_DIRECTION = 1;
  private static final SortCriterion.SortKey DEFAULT_SORT_INDEX = SortCriterion.SortKey.PRIORITY;
  private static final SortCriterion.SortKey DEFAULT_SORT_INDEX2 = SortCriterion.SortKey.RANK;
  private static final SortCriterion.SortKey DEFAULT_SORT_INDEX3 = SortCriterion.SortKey.DATE_CREATED;
  private static final String MEMENTO_KEY_SORT = "sort";
  
  public static String[] getSortableFromElement(IRepositoryElement element)
  {
    String[] a = { "", 0, element.getSummary() };
    if ((element instanceof ITask))
    {
      ITask task1 = (ITask)element;
      if (task1.getTaskKey() != null) {
        a[1] = task1.getTaskKey();
      }
    }
    return a;
  }
  
  private final TaskKeyComparator taskKeyComparator = new TaskKeyComparator();
  public static final int CRITERIA_COUNT = SortCriterion.SortKey.values().length - 1;
  
  public TaskComparator()
  {
    sortCriteria = new SortCriterion[CRITERIA_COUNT];
    for (int index = 0; index < CRITERIA_COUNT; index++) {
      sortCriteria[index] = new SortCriterion();
    }
    sortCriteria[0].setKey(DEFAULT_SORT_INDEX);
    sortCriteria[1].setKey(DEFAULT_SORT_INDEX2);
    sortCriteria[2].setKey(DEFAULT_SORT_INDEX3);
  }
  
  public int compare(ITask element1, ITask element2)
  {
    SortCriterion[] arrayOfSortCriterion;
    int j = (arrayOfSortCriterion = sortCriteria).length;
    for (int i = 0; i < j; i++)
    {
      SortCriterion key = arrayOfSortCriterion[i];
      int result;
      int result;
      int result;
      int result;
      int result;
      int result;
      int result;
      int result;
      switch (key.getKey())
      {
      case DUE_DATE: 
        result = sortByDate(element1, element2, key.getDirection());
        break;
      case NONE: 
        result = sortByRank(element1, element2, key.getDirection());
        break;
      case MODIFICATION_DATE: 
        result = sortByPriority(element1, element2, key.getDirection());
        break;
      case PRIORITY: 
        result = sortBySummary(element1, element2, key.getDirection());
        break;
      case RANK: 
        result = sortByID(element1, element2, key.getDirection());
        break;
      case SUMMARY: 
        result = compare(element1.getTaskKind(), element2.getTaskKind(), key.getDirection());
        break;
      case TASK_ID: 
        result = sortByDueDate(element1, element2, key.getDirection());
        break;
      case TASK_TYPE: 
        result = sortByModificationDate(element1, element2, key.getDirection());
        break;
      default: 
        return 0;
      }
      int result;
      if (result != 0) {
        return result;
      }
    }
    return 0;
  }
  
  public SortCriterion getSortCriterion(int index)
  {
    return sortCriteria[index];
  }
  
  public void restoreState(IMemento memento)
  {
    if (memento != null) {
      for (int index = 0; index < CRITERIA_COUNT; index++)
      {
        IMemento child = memento.getChild("sort" + index);
        if ((child != null) && (sortCriteria[index] != null)) {
          sortCriteria[index].restoreState(child);
        }
      }
    }
  }
  
  public void saveState(IMemento memento)
  {
    if (memento != null) {
      for (int index = 0; index < CRITERIA_COUNT; index++)
      {
        IMemento child = memento.createChild("sort" + index);
        if ((child != null) && (sortCriteria[index] != null)) {
          sortCriteria[index].saveState(child);
        }
      }
    }
  }
  
  private int sortByDate(ITask element1, ITask element2, int sortDirection)
  {
    Date date1 = element1.getCreationDate();
    Date date2 = element2.getCreationDate();
    if (date1 == null) {
      return date2 != null ? sortDirection : 0;
    }
    if (date2 == null) {
      return -sortDirection;
    }
    return sortDirection * date1.compareTo(date2);
  }
  
  private int sortByDueDate(ITask element1, ITask element2, int sortDirection)
  {
    Date date1 = element1.getDueDate();
    Date date2 = element2.getDueDate();
    return compare(date1, date2, sortDirection);
  }
  
  private int sortByModificationDate(ITask element1, ITask element2, int sortDirection)
  {
    Date date1 = element1.getModificationDate();
    Date date2 = element2.getModificationDate();
    return compare(date1, date2, sortDirection);
  }
  
  private <T> int compare(Comparable<T> key1, T key2, int sortDirection)
  {
    if (key1 == null) {
      return key2 != null ? sortDirection : 0;
    }
    if (key2 == null) {
      return -sortDirection;
    }
    return sortDirection * key1.compareTo(key2);
  }
  
  private int sortByID(ITask element1, ITask element2, int sortDirection)
  {
    String key1 = element1.getTaskKey();
    String key2 = element2.getTaskKey();
    if (key1 == null) {
      return key2 != null ? sortDirection : 0;
    }
    if (key2 == null) {
      return -sortDirection;
    }
    return sortDirection * taskKeyComparator.compare2(key1, key2);
  }
  
  private int sortByRank(ITask element1, ITask element2, int sortDirection)
  {
    if ((element1.getConnectorKind() != null) && (element2.getConnectorKind() != null) && 
      (element1.getConnectorKind().equals(element2.getConnectorKind()))) {
      if ((element1.getRepositoryUrl() != null) && (element2.getRepositoryUrl() != null) && 
        (element1.getRepositoryUrl().equals(element2.getRepositoryUrl())))
      {
        String rankString1 = element1.getAttribute("task.common.rank");
        String rankString2 = element2.getAttribute("task.common.rank");
        try
        {
          Double rank1 = (rankString1 == null) || (rankString1.length() == 0) ? 
            Double.valueOf(0.0D) : 
            Double.valueOf(rankString1);
          Double rank2 = (rankString2 == null) || (rankString2.length() == 0) ? 
            Double.valueOf(0.0D) : 
            Double.valueOf(rankString2);
          return compare(rank1, rank2, sortDirection);
        }
        catch (NumberFormatException localNumberFormatException) {}
      }
    }
    return 0;
  }
  
  private int sortByPriority(ITask element1, ITask element2, int sortDirection)
  {
    return sortDirection * element1.getPriority().compareToIgnoreCase(element2.getPriority());
  }
  
  private int sortBySummary(ITask element1, ITask element2, int sortDirection)
  {
    String key1 = element1.getSummary();
    String key2 = element2.getSummary();
    if (key1 == null) {
      return key2 != null ? sortDirection : 0;
    }
    if (key2 == null) {
      return -sortDirection;
    }
    return sortDirection * key1.compareToIgnoreCase(key2);
  }
}

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

public class TreeWalker
{
  public static enum Direction
  {
    UP,  DOWN;
  }
  
  private Direction direction = Direction.DOWN;
  private final TreeViewer treeViewer;
  private final Tree tree;
  private boolean expandNodes;
  
  public TreeWalker(TreeViewer treeViewer)
  {
    this.treeViewer = treeViewer;
    tree = treeViewer.getTree();
  }
  
  public Direction getDirection()
  {
    return direction;
  }
  
  public boolean getExpandNodes()
  {
    return expandNodes;
  }
  
  private TreePath getTreePath(TreeItem item)
  {
    List<Object> path = new ArrayList();
    do
    {
      if (item.getData() == null) {
        return null;
      }
      path.add(0, item.getData());
      item = item.getParentItem();
    } while (item != null);
    return new TreePath(path.toArray());
  }
  
  public void setDirection(Direction direction)
  {
    this.direction = direction;
  }
  
  public void setExpandNodes(boolean expandNodes)
  {
    this.expandNodes = expandNodes;
  }
  
  private TreePath visitChildren(TreeViewer viewer, TreePath itemPath, TreeItem item, TreeVisitor visitor)
  {
    boolean restoreCollapsedState = false;
    try
    {
      if (getExpandNodes())
      {
        boolean expandedState = item.getExpanded();
        if (!expandedState)
        {
          restoreCollapsedState = true;
          viewer.setExpandedState(itemPath, true);
        }
      }
      TreeItem[] children = item.getItems();
      if ((children.length > 0) && (children[0].getData() != null))
      {
        TreePath childPath = visitItems(viewer, itemPath, children, null, visitor);
        if (childPath != null) {
          return childPath;
        }
      }
    }
    finally
    {
      if (restoreCollapsedState) {
        viewer.setExpandedState(itemPath, false);
      }
    }
    if (restoreCollapsedState) {
      viewer.setExpandedState(itemPath, false);
    }
    return null;
  }
  
  private TreePath visitItems(TreeViewer viewer, TreePath parentPath, TreeItem[] items, TreeItem visitedItem, TreeVisitor visitor)
  {
    if (direction == Direction.UP) {
      Collections.reverse(Arrays.asList(items));
    }
    boolean found = visitedItem == null;
    TreeItem[] arrayOfTreeItem;
    int j = (arrayOfTreeItem = items).length;
    for (int i = 0; i < j; i++)
    {
      TreeItem item = arrayOfTreeItem[i];
      if (!found)
      {
        if (item == visitedItem) {
          found = true;
        }
      }
      else
      {
        TreePath itemPath = parentPath.createChildPath(item.getData());
        if ((direction == Direction.DOWN) && 
          (visitor.visit(item.getData()))) {
          return itemPath;
        }
        TreePath childPath = visitChildren(viewer, itemPath, item, visitor);
        if (childPath != null) {
          return childPath;
        }
        if ((direction == Direction.UP) && 
          (visitor.visit(item.getData()))) {
          return itemPath;
        }
      }
    }
    if (visitedItem != null)
    {
      TreeItem parent = visitedItem.getParentItem();
      if (parent != null)
      {
        if ((direction == Direction.UP) && 
          (visitor.visit(parent.getData()))) {
          return parentPath;
        }
        return visitSiblings(viewer, parent, visitor);
      }
    }
    return null;
  }
  
  private TreePath visitSiblings(TreeViewer viewer, TreeItem item, TreeVisitor visitor)
  {
    TreeItem parent = item.getParentItem();
    TreeItem[] siblings;
    TreePath path;
    TreeItem[] siblings;
    if (parent != null)
    {
      TreePath path = getTreePath(parent);
      if (path == null) {
        return null;
      }
      siblings = parent.getItems();
    }
    else
    {
      path = TreePath.EMPTY;
      siblings = viewer.getTree().getItems();
    }
    return visitItems(viewer, path, siblings, item, visitor);
  }
  
  public TreePath walk(TreeVisitor visitor, TreeItem startItem)
  {
    TreePath path = null;
    if (startItem != null)
    {
      if (direction == Direction.DOWN)
      {
        path = getTreePath(startItem);
        if (path != null) {
          path = visitChildren(treeViewer, path, startItem, visitor);
        }
      }
      if (path == null) {
        path = visitSiblings(treeViewer, startItem, visitor);
      }
    }
    else
    {
      path = visitItems(treeViewer, TreePath.EMPTY, tree.getItems(), null, visitor);
    }
    return path;
  }
  
  public static abstract class TreeVisitor
  {
    public abstract boolean visit(Object paramObject);
  }
}

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

import java.io.File;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;

public class DownloadAttachmentJob
  extends Job
{
  private final ITaskAttachment attachment;
  private final File targetFile;
  
  public DownloadAttachmentJob(ITaskAttachment attachment, File targetFile)
  {
    super(Messages.DownloadAttachmentJob_Downloading_Attachment);
    this.attachment = attachment;
    this.targetFile = targetFile;
  }
  
  /* Error */
  protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
  {
    // Byte code:
    //   0: iconst_1
    //   1: istore_2
    //   2: new 44	java/io/BufferedOutputStream
    //   5: dup
    //   6: new 46	java/io/FileOutputStream
    //   9: dup
    //   10: aload_0
    //   11: getfield 101	org/eclipse/mylyn/internal/tasks/ui/util/DownloadAttachmentJob:targetFile	Ljava/io/File;
    //   14: invokespecial 107	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   17: invokespecial 105	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   20: astore_3
    //   21: aload_0
    //   22: getfield 102	org/eclipse/mylyn/internal/tasks/ui/util/DownloadAttachmentJob:attachment	Lorg/eclipse/mylyn/tasks/core/ITaskAttachment;
    //   25: aload_3
    //   26: aload_1
    //   27: invokestatic 116	org/eclipse/mylyn/internal/tasks/ui/util/AttachmentUtil:downloadAttachment	(Lorg/eclipse/mylyn/tasks/core/ITaskAttachment;Ljava/io/OutputStream;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   30: iconst_0
    //   31: istore_2
    //   32: goto +24 -> 56
    //   35: astore 4
    //   37: aload_3
    //   38: invokevirtual 109	java/io/OutputStream:close	()V
    //   41: iload_2
    //   42: ifeq +11 -> 53
    //   45: aload_0
    //   46: getfield 101	org/eclipse/mylyn/internal/tasks/ui/util/DownloadAttachmentJob:targetFile	Ljava/io/File;
    //   49: invokevirtual 106	java/io/File:delete	()Z
    //   52: pop
    //   53: aload 4
    //   55: athrow
    //   56: aload_3
    //   57: invokevirtual 109	java/io/OutputStream:close	()V
    //   60: iload_2
    //   61: ifeq +78 -> 139
    //   64: aload_0
    //   65: getfield 101	org/eclipse/mylyn/internal/tasks/ui/util/DownloadAttachmentJob:targetFile	Ljava/io/File;
    //   68: invokevirtual 106	java/io/File:delete	()Z
    //   71: pop
    //   72: goto +67 -> 139
    //   75: astore_2
    //   76: new 50	org/eclipse/core/runtime/CoreException
    //   79: dup
    //   80: new 58	org/eclipse/mylyn/tasks/core/RepositoryStatus
    //   83: dup
    //   84: aload_0
    //   85: getfield 102	org/eclipse/mylyn/internal/tasks/ui/util/DownloadAttachmentJob:attachment	Lorg/eclipse/mylyn/tasks/core/ITaskAttachment;
    //   88: invokeinterface 119 1 0
    //   93: iconst_4
    //   94: ldc 2
    //   96: iconst_5
    //   97: new 49	java/lang/StringBuilder
    //   100: dup
    //   101: ldc 1
    //   103: invokespecial 111	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   106: aload_2
    //   107: invokevirtual 108	java/io/IOException:getMessage	()Ljava/lang/String;
    //   110: invokevirtual 112	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   113: invokevirtual 110	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   116: aload_2
    //   117: invokespecial 118	org/eclipse/mylyn/tasks/core/RepositoryStatus:<init>	(Lorg/eclipse/mylyn/tasks/core/TaskRepository;ILjava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
    //   120: invokespecial 114	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   123: athrow
    //   124: astore_2
    //   125: getstatic 103	org/eclipse/mylyn/internal/tasks/ui/util/Messages:DownloadAttachmentJob_Copy_Attachment_to_Clipboard	Ljava/lang/String;
    //   128: aload_2
    //   129: invokevirtual 113	org/eclipse/core/runtime/CoreException:getStatus	()Lorg/eclipse/core/runtime/IStatus;
    //   132: invokestatic 117	org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal:asyncDisplayStatus	(Ljava/lang/String;Lorg/eclipse/core/runtime/IStatus;)V
    //   135: getstatic 100	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   138: areturn
    //   139: getstatic 100	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   142: areturn
    // Line number table:
    //   Java source line #48	-> byte code offset #0
    //   Java source line #49	-> byte code offset #2
    //   Java source line #51	-> byte code offset #21
    //   Java source line #52	-> byte code offset #30
    //   Java source line #53	-> byte code offset #35
    //   Java source line #54	-> byte code offset #37
    //   Java source line #55	-> byte code offset #41
    //   Java source line #56	-> byte code offset #45
    //   Java source line #58	-> byte code offset #53
    //   Java source line #54	-> byte code offset #56
    //   Java source line #55	-> byte code offset #60
    //   Java source line #56	-> byte code offset #64
    //   Java source line #59	-> byte code offset #75
    //   Java source line #60	-> byte code offset #76
    //   Java source line #61	-> byte code offset #94
    //   Java source line #62	-> byte code offset #106
    //   Java source line #60	-> byte code offset #120
    //   Java source line #64	-> byte code offset #124
    //   Java source line #65	-> byte code offset #125
    //   Java source line #66	-> byte code offset #128
    //   Java source line #65	-> byte code offset #132
    //   Java source line #67	-> byte code offset #135
    //   Java source line #70	-> byte code offset #139
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	143	0	this	DownloadAttachmentJob
    //   0	143	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   1	60	2	exceptionThrown	boolean
    //   75	42	2	e	java.io.IOException
    //   124	5	2	e	org.eclipse.core.runtime.CoreException
    //   20	37	3	out	java.io.OutputStream
    //   35	19	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   21	35	35	finally
    //   0	72	75	java/io/IOException
    //   0	124	124	org/eclipse/core/runtime/CoreException
  }
}

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

import java.io.File;
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.commons.ui.PlatformUiUtil;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.TransferList;
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.FileDialog;

public class ImportExportUtil
{
  public static void configureFilter(FileDialog dialog)
  {
    dialog.setFilterExtensions(PlatformUiUtil.getFilterExtensions(new String[] { "*.xml.zip" }));
    dialog.setFilterNames(new String[] { NLS.bind(Messages.ImportExportUtil_Tasks_and_queries_Filter0, 
      ".xml.zip") });
  }
  
  public static void export(File file, IStructuredSelection selection)
    throws CoreException
  {
    TransferList list = new TransferList();
    for (Iterator<?> it = selection.iterator(); it.hasNext();)
    {
      Object element = it.next();
      if ((element instanceof AbstractTaskCategory)) {
        list.addCategory((TaskCategory)element);
      } else if ((element instanceof RepositoryQuery)) {
        list.addQuery((RepositoryQuery)element);
      } else if ((element instanceof ITask)) {
        list.addTask((AbstractTask)element);
      }
    }
    TaskListExternalizer externalizer = TasksUiPlugin.getDefault().createTaskListExternalizer();
    externalizer.writeTaskList(list, file);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.tasks.ui.TaskDropListener;
import org.eclipse.mylyn.tasks.ui.TaskDropListener.TaskDropEvent;

class TaskDropHandler$1
  implements ISafeRunnable
{
  TaskDropHandler$1(TaskDropHandler paramTaskDropHandler, TaskDropListener paramTaskDropListener, TaskDropListener.TaskDropEvent paramTaskDropEvent) {}
  
  public void run()
    throws Exception
  {
    val$listener.tasksDropped(val$event);
  }
  
  public void handleException(Throwable exception)
  {
    StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", exception.getMessage(), 
      exception));
  }
}

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

import java.io.IOException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.commons.net.WebUtil;
import org.eclipse.mylyn.internal.tasks.ui.Messages;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public abstract class AbstractRetrieveTitleFromUrlJob
  extends Job
{
  private volatile String pageTitle;
  private final String url;
  
  public AbstractRetrieveTitleFromUrlJob(String url)
  {
    super(Messages.AbstractRetrieveTitleFromUrlJob_Retrieving_summary_from_URL);
    this.url = url;
  }
  
  public String getPageTitle()
  {
    return pageTitle;
  }
  
  public String getUrl()
  {
    return url;
  }
  
  public IStatus run(IProgressMonitor monitor)
  {
    try
    {
      pageTitle = WebUtil.getTitleFromUrl(new WebLocation(getUrl()), monitor);
      if (pageTitle != null) {
        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
        {
          public void run()
          {
            titleRetrieved(pageTitle);
          }
        });
      }
    }
    catch (IOException e)
    {
      return new Status(4, "org.eclipse.mylyn.tasks.ui", "Retrieving summary from URL failed", e);
    }
    return Status.OK_STATUS;
  }
  
  protected void titleRetrieved(String pageTitle) {}
}

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

import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizationScheduler.Synchronizer;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.sync.SynchronizationJob;

class TasksUiInternal$6
  extends SynchronizationScheduler.Synchronizer<SynchronizationJob>
{
  TasksUiInternal$6(TaskRepository paramTaskRepository) {}
  
  public SynchronizationJob createJob()
  {
    return TasksUiInternal.access$0(val$repository, false);
  }
}

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

import java.io.ByteArrayOutputStream;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public class CopyAttachmentToClipboardJob
  extends Job
{
  private final ITaskAttachment attachment;
  
  public CopyAttachmentToClipboardJob(ITaskAttachment attachment)
  {
    super(Messages.CopyAttachmentToClipboardJob_Copying_Attachment_to_Clipboard);
    this.attachment = attachment;
  }
  
  protected IStatus run(IProgressMonitor monitor)
  {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    try
    {
      AttachmentUtil.downloadAttachment(attachment, out, monitor);
    }
    catch (CoreException e)
    {
      TasksUiInternal.asyncDisplayStatus(Messages.CopyAttachmentToClipboardJob_Copy_Attachment_to_Clipboard, 
        e.getStatus());
      return Status.OK_STATUS;
    }
    String contents = new String(out.toByteArray());
    contents = contents.replaceAll("\r\n|\n", System.getProperty("line.separator"));
    copyToClipboard(contents);
    
    return Status.OK_STATUS;
  }
  
  private void copyToClipboard(final String contents)
  {
    PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable()
    {
      public void run()
      {
        Clipboard clipboard = new Clipboard(PlatformUI.getWorkbench().getDisplay());
        clipboard.setContents(new Object[] { contents }, new Transfer[] { TextTransfer.getInstance() });
        clipboard.dispose();
      }
    });
  }
}

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

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;

public class TaskRepositoryPropertyTester
  extends PropertyTester
{
  private static final String PROPERTY_CONNECTOR_KIND = "connectorKind";
  private static final String PROPERTY_USER_MANAGED = "userManaged";
  
  private boolean equals(boolean value, Object expectedValue)
  {
    return new Boolean(value).equals(expectedValue);
  }
  
  public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
  {
    if ((receiver instanceof TaskRepository))
    {
      TaskRepository repository = (TaskRepository)receiver;
      if ("connectorKind".equals(property)) {
        return repository.getConnectorKind().equals(expectedValue);
      }
      if ("userManaged".equals(property))
      {
        AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
          repository.getConnectorKind());
        return equals((connector != null) && (connector.isUserManaged()), expectedValue);
      }
    }
    return false;
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.ui.util.messages";
  public static String AttachmentUtil_The_context_is_empty;
  public static String AttachmentUtil_Downloading_attachment;
  public static String AttachmentUtil_Mylyn_Information;
  public static String CopyAttachmentToClipboardJob_Copy_Attachment_to_Clipboard;
  public static String CopyAttachmentToClipboardJob_Copying_Attachment_to_Clipboard;
  public static String DownloadAttachmentJob_Copy_Attachment_to_Clipboard;
  public static String DownloadAttachmentJob_Downloading_Attachment;
  public static String ImportExportUtil_Tasks_and_queries_Filter0;
  public static String SortCriterion_Modification_Date;
  public static String SortCriterion_Type;
  public static String SortKindEntry_Date_Created;
  public static String SortKindEntry_None;
  public static String SortKindEntry_Priority;
  public static String SortKindEntry_Rank;
  public static String SortKindEntry_Summary;
  public static String SortKindEntry_Task_ID;
  public static String SortKindEntry_Due_Date;
  public static String SaveAttachmentsAction_directoryDoesntExist;
  public static String SaveAttachmentsAction_directoryDoesntExist0;
  public static String SaveAttachmentsAction_fileExists_doYouWantToOverwrite0;
  public static String SaveAttachmentsAction_overwriteFile0;
  public static String SaveAttachmentsAction_selectDirectory;
  public static String SaveAttachmentsAction_selectDirectoryHint;
  public static String TaskDataExportOperation_exporting_task_data;
  public static String TasksUiInternal_Configuration_Refresh_Failed;
  public static String TasksUiInternal_Create_Task;
  public static String TasksUiInternal_The_new_task_will_be_added_to_the_X_container;
  public static String TasksUiInternal_Query_Synchronization_Failed;
  public static String TasksUiInternal_Task_Synchronization_Failed;
  public static String TasksUiInternal__hour_;
  public static String TasksUiInternal__hours_;
  public static String TasksUiInternal__minute_;
  public static String TasksUiInternal__minutes_;
  public static String TasksUiInternal__second;
  public static String TasksUiInternal__seconds;
  public static String TasksUiInternal_Activate_Task;
  public static String TasksUiInternal_Failed_to_open_task;
  public static String TasksUiInternal_No_repository_found;
  public static String TasksUiInternal_Rename_Category_Message;
  public static String TasksUiInternal_Rename_Category_Name_already_exists_Error;
  public static String TasksUiInternal_Rename_Category_Title;
  public static String TasksUiInternal_See_error_log_for_details;
  public static String TasksUiMenus_Copy_Contents;
  public static String TasksUiMenus_Copy_URL;
  public static String TasksUiMenus_File_exists_;
  public static String TasksUiMenus_Overwrite_existing_file_;
  public static String TasksUiMenus_Save_;
  
  static {}
  
  public static void reloadMessages()
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.tasks.ui.util.messages", Messages.class);
  }
}

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

import java.io.File;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;

public class TaskDataExportOperation
  implements IRunnableWithProgress
{
  private static final String EXPORT_JOB_LABEL = Messages.TaskDataExportOperation_exporting_task_data;
  private static final Pattern excludePattern = Pattern.compile("(?:^\\.|^monitor-log.xml\\z|^tasklist.xml.zip\\z|attachments\\z|backup\\z)");
  private final String destinationDirectory;
  private final String destinationFilename;
  
  public TaskDataExportOperation(String destinationDirectory, String destinationFilename)
  {
    this.destinationFilename = destinationFilename;
    this.destinationDirectory = destinationDirectory;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws java.lang.reflect.InvocationTargetException
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 197	org/eclipse/mylyn/commons/net/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   4: astore_1
    //   5: new 84	java/util/HashSet
    //   8: dup
    //   9: invokespecial 190	java/util/HashSet:<init>	()V
    //   12: astore_2
    //   13: aload_0
    //   14: aload_2
    //   15: invokevirtual 202	org/eclipse/mylyn/internal/tasks/ui/util/TaskDataExportOperation:selectFiles	(Ljava/util/Set;)V
    //   18: aload_2
    //   19: invokeinterface 205 1 0
    //   24: ifle +120 -> 144
    //   27: invokestatic 194	org/eclipse/core/runtime/Platform:isRunning	()Z
    //   30: ifeq +114 -> 144
    //   33: aload_1
    //   34: getstatic 176	org/eclipse/mylyn/internal/tasks/ui/util/TaskDataExportOperation:EXPORT_JOB_LABEL	Ljava/lang/String;
    //   37: aload_2
    //   38: invokeinterface 205 1 0
    //   43: iconst_1
    //   44: iadd
    //   45: invokeinterface 209 3 0
    //   50: invokestatic 196	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   53: getstatic 174	org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants:ROOT_SCHEDULING_RULE	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   56: new 91	org/eclipse/core/runtime/SubProgressMonitor
    //   59: dup
    //   60: aload_1
    //   61: iconst_1
    //   62: invokespecial 195	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   65: invokeinterface 211 3 0
    //   70: aload_0
    //   71: invokevirtual 201	org/eclipse/mylyn/internal/tasks/ui/util/TaskDataExportOperation:getDestinationFile	()Ljava/io/File;
    //   74: new 83	java/util/ArrayList
    //   77: dup
    //   78: aload_2
    //   79: invokespecial 189	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   82: invokestatic 200	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getDefault	()Lorg/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin;
    //   85: invokevirtual 199	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getDataDirectory	()Ljava/lang/String;
    //   88: aload_1
    //   89: invokestatic 198	org/eclipse/mylyn/internal/commons/core/ZipFileUtil:createZipFile	(Ljava/io/File;Ljava/util/List;Ljava/lang/String;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   92: goto +35 -> 127
    //   95: astore_3
    //   96: new 82	java/lang/reflect/InvocationTargetException
    //   99: dup
    //   100: aload_3
    //   101: invokespecial 188	java/lang/reflect/InvocationTargetException:<init>	(Ljava/lang/Throwable;)V
    //   104: athrow
    //   105: astore 4
    //   107: invokestatic 196	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   110: getstatic 174	org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants:ROOT_SCHEDULING_RULE	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   113: invokeinterface 210 2 0
    //   118: aload_1
    //   119: invokeinterface 208 1 0
    //   124: aload 4
    //   126: athrow
    //   127: invokestatic 196	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   130:
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 70 71 72 73 74 75 76 77 78 79

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