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

 getstatic 174	org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants:ROOT_SCHEDULING_RULE	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   133: invokeinterface 210 2 0
    //   138: aload_1
    //   139: invokeinterface 208 1 0
    //   144: return
    // Line number table:
    //   Java source line #56	-> byte code offset #0
    //   Java source line #58	-> byte code offset #5
    //   Java source line #59	-> byte code offset #13
    //   Java source line #61	-> byte code offset #18
    //   Java source line #63	-> byte code offset #33
    //   Java source line #65	-> byte code offset #50
    //   Java source line #66	-> byte code offset #56
    //   Java source line #65	-> byte code offset #65
    //   Java source line #68	-> byte code offset #70
    //   Java source line #69	-> byte code offset #82
    //   Java source line #68	-> byte code offset #89
    //   Java source line #70	-> byte code offset #95
    //   Java source line #71	-> byte code offset #96
    //   Java source line #72	-> byte code offset #105
    //   Java source line #73	-> byte code offset #107
    //   Java source line #74	-> byte code offset #118
    //   Java source line #75	-> byte code offset #124
    //   Java source line #73	-> byte code offset #127
    //   Java source line #74	-> byte code offset #138
    //   Java source line #77	-> byte code offset #144
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	145	0	this	TaskDataExportOperation
    //   0	145	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   12	67	2	filesToExport	Set<File>
    //   95	6	3	e	java.io.IOException
    //   105	20	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   33	92	95	java/io/IOException
    //   33	105	105	finally
  }
  
  public File getDestinationFile()
  {
    return new File(destinationDirectory + File.separator + destinationFilename);
  }
  
  protected void selectFiles(Set<File> filesToExport)
  {
    Set<Pattern> exclusionPatterns = new HashSet();
    exclusionPatterns.add(excludePattern);
    String dataRoot = TasksUiPlugin.getDefault().getDataDirectory();
    File dataFolder = new File(dataRoot);
    File[] arrayOfFile;
    int j = (arrayOfFile = dataFolder.listFiles()).length;
    for (int i = 0; i < j; i++)
    {
      File file = arrayOfFile[i];
      boolean exclude = false;
      for (Pattern pattern : exclusionPatterns) {
        if (pattern.matcher(file.getName()).find())
        {
          exclude = true;
          break;
        }
      }
      if (!exclude) {
        filesToExport.add(file);
      }
    }
  }
  
  protected File getSourceFolder()
  {
    return new File(TasksUiPlugin.getDefault().getDataDirectory());
  }
}

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

import org.eclipse.mylyn.internal.tasks.ui.views.AbstractTaskListContentProvider;
import org.eclipse.mylyn.internal.tasks.ui.views.AbstractTaskListPresentation;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider;

public class ScheduledPresentation
  extends AbstractTaskListPresentation
{
  public static final String ID = "org.eclipse.mylyn.tasks.ui.scheduled";
  
  public ScheduledPresentation()
  {
    super("org.eclipse.mylyn.tasks.ui.scheduled");
  }
  
  public AbstractTaskListContentProvider createContentProvider(TaskListView taskListView)
  {
    return new TaskScheduleContentProvider(taskListView);
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.commons.ui.CommonUiUtil;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Event;

class TaskHistoryDropDown$ActivateTaskAction
  extends Action
{
  private static final int MAX_LABEL_LENGTH = 40;
  private final AbstractTask targetTask;
  
  public TaskHistoryDropDown$ActivateTaskAction(TaskHistoryDropDown arg1, AbstractTask task)
  {
    targetTask = task;
    String taskDescription = task.getSummary();
    if (taskDescription.length() > 40) {
      taskDescription = taskDescription.subSequence(0, 37) + "...";
    }
    taskDescription = CommonUiUtil.toMenuLabel(taskDescription);
    setText(taskDescription);
    setEnabled(true);
    setToolTipText(task.getSummary());
    Image image = TaskHistoryDropDown.access$0(???).getImage(task);
    setImageDescriptor(ImageDescriptor.createFromImage(image));
  }
  
  public void run()
  {
    if (targetTask.isActive()) {
      return;
    }
    TasksUiInternal.activateTaskThroughCommand(targetTask);
  }
  
  public void runWithEvent(Event event)
  {
    run();
    if ((stateMask & 0x20000) != 0) {
      TasksUiUtil.openTask(targetTask);
    }
  }
}

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

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.mylyn.internal.tasks.core.data.TaskAttributeDiff;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataDiff;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.core.data.ITaskAttributeDiff;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.swt.graphics.Image;

public class TaskDataDiffNode
  extends DiffNode
{
  static class ByteArrayInput
    implements ITypedElement, IStreamContentAccessor
  {
    String content;
    private final String name;
    
    public ByteArrayInput(String content, String name)
    {
      this.content = content;
      this.name = name;
    }
    
    public String getName()
    {
      return name;
    }
    
    public Image getImage()
    {
      return null;
    }
    
    public String getType()
    {
      return "txt";
    }
    
    public InputStream getContents()
      throws CoreException
    {
      return new ByteArrayInputStream(content.getBytes());
    }
  }
  
  public TaskDataDiffNode(int change, TaskData oldData, TaskData newData)
  {
    super(change);
    TaskDataDiff diff = new TaskDataDiff(TasksUiPlugin.getRepositoryModel(), newData, oldData);
    for (ITaskAttributeDiff attribute : diff.getChangedAttributes())
    {
      TaskAttributeDiff attr = (TaskAttributeDiff)attribute;
      String label = attr.getLabel();
      if (label.endsWith(":")) {
        label = label.substring(0, label.length() - 1);
      }
      DiffNode node = new DiffNode(3, this, new ByteArrayInput(attr.getOldValues().toString(), 
        null), new ByteArrayInput(attr.getNewValues().toString(), label));
      add(node);
    }
    for (ITaskComment attribute : diff.getNewComments())
    {
      DiffNode node = new DiffNode(3, this, new ByteArrayInput("", null), new ByteArrayInput(
        attribute.getText(), Messages.TaskDataDiffNode_New_Comment_Label));
      add(node);
    }
  }
}

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

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;

class TaskDataDiffNode$ByteArrayInput
  implements ITypedElement, IStreamContentAccessor
{
  String content;
  private final String name;
  
  public TaskDataDiffNode$ByteArrayInput(String content, String name)
  {
    this.content = content;
    this.name = name;
  }
  
  public String getName()
  {
    return name;
  }
  
  public Image getImage()
  {
    return null;
  }
  
  public String getType()
  {
    return "txt";
  }
  
  public InputStream getContents()
    throws CoreException
  {
    return new ByteArrayInputStream(content.getBytes());
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.ui.compare.messages";
  public static String TaskDataDiffNode_New_Comment_Label;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.tasks.ui.compare.messages", Messages.class);
  }
}

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

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.ui.handlers.HandlerUtil;

public abstract class AbstractTaskAttachmentCommandHandler
  extends AbstractHandler
{
  public Object execute(ExecutionEvent event)
    throws ExecutionException
  {
    ISelection selection = HandlerUtil.getCurrentSelection(event);
    if ((selection instanceof IStructuredSelection))
    {
      Object[] items = ((IStructuredSelection)selection).toArray();
      Object[] arrayOfObject1;
      int j = (arrayOfObject1 = items).length;
      for (int i = 0; i < j; i++)
      {
        Object item = arrayOfObject1[i];
        if ((item instanceof ITaskAttachment)) {
          execute(event, (ITaskAttachment)item);
        }
      }
    }
    return null;
  }
  
  protected void execute(ExecutionEvent event, ITaskAttachment attachment) {}
}

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

import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;

class ContextRetrieveWizardPage$2
  implements MouseListener
{
  ContextRetrieveWizardPage$2(ContextRetrieveWizardPage paramContextRetrieveWizardPage, Table paramTable) {}
  
  public void mouseDoubleClick(MouseEvent e)
  {
    ContextRetrieveWizardPage.access$0(this$0, 
      (ITaskAttachment)val$contextTable.getItem(val$contextTable.getSelectionIndex()).getData());
    this$0.getWizard().getContainer().updateButtons();
    this$0.getWizard().performFinish();
    
    this$0.getWizard().getContainer().getShell().close();
  }
  
  public void mouseDown(MouseEvent e) {}
  
  public void mouseUp(MouseEvent e) {}
}

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

import java.util.Comparator;
import java.util.Date;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;

class TaskAttachmentComparator
  implements Comparator<ITaskAttachment>
{
  public int compare(ITaskAttachment attachment1, ITaskAttachment attachment2)
  {
    Date created1 = null;
    Date created2 = null;
    created1 = attachment1.getCreationDate();
    created2 = attachment2.getCreationDate();
    if ((created1 != null) && (created2 != null)) {
      return -1 * created1.compareTo(created2);
    }
    if ((created1 == null) && (created2 != null)) {
      return 1;
    }
    if ((created1 != null) && (created2 == null)) {
      return -1;
    }
    return 0;
  }
}

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

import org.eclipse.jface.wizard.Wizard;
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;

public class ContextAttachWizard
  extends Wizard
{
  private final TaskRepository repository;
  private final ITask task;
  private ContextAttachWizardPage wizardPage;
  
  public ContextAttachWizard(ITask task)
  {
    repository = TasksUi.getRepositoryManager()
      .getRepository(task.getConnectorKind(), task.getRepositoryUrl());
    this.task = task;
    setWindowTitle(Messages.ContextAttachWizard_Attach_Context);
    setDefaultPageImageDescriptor(TasksUiImages.BANNER_REPOSITORY_CONTEXT);
    setNeedsProgressMonitor(true);
  }
  
  public void addPages()
  {
    wizardPage = new ContextAttachWizardPage(repository, task);
    addPage(wizardPage);
    super.addPages();
  }
  
  public final boolean performFinish()
  {
    return AttachmentUtil.uploadContext(repository, task, wizardPage.getComment(), getContainer());
  }
}

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

import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;

class ContextAttachWizardPage$1
  implements KeyListener
{
  ContextAttachWizardPage$1(ContextAttachWizardPage paramContextAttachWizardPage) {}
  
  public void keyPressed(KeyEvent e)
  {
    this$0.getWizard().getContainer().updateButtons();
  }
  
  public void keyReleased(KeyEvent e)
  {
    this$0.getWizard().getContainer().updateButtons();
  }
}

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

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskSelectionDialog;
import org.eclipse.mylyn.internal.tasks.ui.commands.AbstractTaskHandler;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivityManager;
import org.eclipse.mylyn.tasks.core.context.AbstractTaskContextStore;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

public class CopyContextHandler
  extends AbstractTaskHandler
{
  private static final String TITLE_DIALOG = Messages.CopyContextHandler_Copy_Context;
  
  protected void execute(ExecutionEvent event, ITask sourceTask)
    throws ExecutionException
  {
    run(sourceTask);
  }
  
  public static void run(ITask sourceTask)
  {
    if (sourceTask == null)
    {
      MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), 
        TITLE_DIALOG, Messages.CopyContextHandler_No_source_task_selected);
      return;
    }
    TaskSelectionDialog dialog = new TaskSelectionDialog(WorkbenchUtil.getShell());
    dialog.setNeedsCreateTask(false);
    dialog.setTitle(Messages.CopyContextHandler_Select_Target_Task);
    dialog.setMessage(Messages.CopyContextHandler_Select_the_target_task__);
    if (dialog.open() != 0) {
      return;
    }
    Object result = dialog.getFirstResult();
    if ((result instanceof ITask))
    {
      ITask targetTask = (ITask)result;
      TasksUi.getTaskActivityManager().deactivateActiveTask();
      if (targetTask.equals(sourceTask))
      {
        MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), 
          TITLE_DIALOG, Messages.CopyContextHandler_TARGET_TASK_CON_NOT_BE_THE_SAME_AS_SOURCE_TASK);
      }
      else
      {
        int action = 0;
        if (TasksUiPlugin.getContextStore().hasContext(targetTask))
        {
          MessageDialog dialog2 = new MessageDialog(PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow()
            .getShell(), TITLE_DIALOG, null, 
            Messages.CopyContextHandler_SELECTED_TASK_ALREADY_HAS_CONTEXT, 3, 
            new String[] { Messages.CopyContextHandler_Replace, Messages.CopyContextHandler_Merge, 
            IDialogConstants.CANCEL_LABEL }, 1);
          action = dialog2.open();
        }
        switch (action)
        {
        case 0: 
          IAdaptable context = TasksUiPlugin.getContextStore().copyContext(sourceTask, targetTask);
          if (context == null)
          {
            MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), 
              TITLE_DIALOG, Messages.CopyContextHandler_SOURCE_TASK_DOES_HAVE_A_CONTEXT); return;
          }
          break;
        case 1: 
          TasksUiPlugin.getContextStore().mergeContext(sourceTask, targetTask);
          break;
        case 2: 
          return;
        }
        TasksUiInternal.activateTaskThroughCommand(targetTask);
      }
    }
    else
    {
      MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), 
        TITLE_DIALOG, Messages.CopyContextHandler_No_target_task_selected);
    }
  }
}

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

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public class RetrieveContextAttachmentHandler
  extends AbstractTaskAttachmentCommandHandler
{
  protected void execute(ExecutionEvent event, ITaskAttachment attachment)
  {
    AttachmentUtil.downloadContext(attachment.getTask(), attachment, PlatformUI.getWorkbench().getProgressService());
  }
}

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

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.ui.commands.AbstractTaskHandler;
import org.eclipse.mylyn.tasks.core.ITask;

public class AttachContextHandler
  extends AbstractTaskHandler
{
  protected void execute(ExecutionEvent event, ITask task)
    throws ExecutionException
  {
    run(task);
  }
  
  public static void run(ITask task)
  {
    ContextAttachWizard wizard = new ContextAttachWizard(task);
    WizardDialog dialog = new WizardDialog(WorkbenchUtil.getShell(), wizard);
    dialog.create();
    dialog.setBlockOnOpen(true);
    if (dialog.open() == 1) {}
  }
}

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

import org.eclipse.jface.wizard.Wizard;
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;

public class ContextRetrieveWizard
  extends Wizard
{
  private final TaskRepository repository;
  private final ITask task;
  private ContextRetrieveWizardPage wizardPage;
  
  public ContextRetrieveWizard(ITask task)
  {
    this.task = task;
    repository = TasksUi.getRepositoryManager()
      .getRepository(task.getConnectorKind(), task.getRepositoryUrl());
    setWindowTitle(Messages.ContextRetrieveWizard_Retrieve_Context);
    setDefaultPageImageDescriptor(TasksUiImages.BANNER_REPOSITORY_CONTEXT);
    setNeedsProgressMonitor(true);
  }
  
  public void addPages()
  {
    wizardPage = new ContextRetrieveWizardPage(repository, task);
    addPage(wizardPage);
    super.addPages();
  }
  
  public final boolean performFinish()
  {
    ITaskAttachment attachment = wizardPage.getSelectedContext();
    return AttachmentUtil.downloadContext(task, attachment, getContainer());
  }
}

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

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.ui.commands.AbstractTaskHandler;
import org.eclipse.mylyn.tasks.core.ITask;

public class RetrieveContextHandler
  extends AbstractTaskHandler
{
  protected void execute(ExecutionEvent event, ITask task)
    throws ExecutionException
  {
    run(task);
  }
  
  public static void run(ITask task)
  {
    ContextRetrieveWizard wizard = new ContextRetrieveWizard(task);
    WizardDialog dialog = new WizardDialog(WorkbenchUtil.getShell(), wizard);
    dialog.create();
    dialog.setBlockOnOpen(true);
    dialog.open();
  }
}

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

import com.ibm.icu.text.DateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;

public class ContextRetrieveWizardPage
  extends WizardPage
{
  private final TaskRepository repository;
  private final ITask task;
  private final TaskElementLabelProvider labelProvider = new TaskElementLabelProvider(false);
  private ITaskAttachment selectedContextAttachment;
  
  protected ContextRetrieveWizardPage(TaskRepository repository, ITask task)
  {
    super(Messages.ContextRetrieveWizardPage_Select_context);
    this.repository = repository;
    this.task = task;
    setDescription(Messages.ContextRetrieveWizardPage_SELECT_A_CONTEXT_TO_RETTRIEVE_FROM_TABLE_BELOW);
    setTitle(Messages.ContextRetrieveWizardPage_Select_context);
  }
  
  public void createControl(Composite parent)
  {
    Composite composite = new Composite(parent, 0);
    composite.setLayout(new GridLayout(1, false));
    
    Text summary = new Text(composite, 0);
    summary.setText(NLS.bind(Messages.ContextRetrieveWizardPage_Task, labelProvider.getText(task)));
    summary.setEditable(false);
    
    final Table contextTable = new Table(composite, 67584);
    contextTable.setHeaderVisible(true);
    contextTable.setLinesVisible(true);
    
    contextTable.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent event)
      {
        if (contextTable.getSelectionIndex() > -1)
        {
          selectedContextAttachment = 
            ((ITaskAttachment)contextTable.getItem(contextTable.getSelectionIndex()).getData());
          getWizard().getContainer().updateButtons();
        }
      }
    });
    contextTable.addMouseListener(new MouseListener()
    {
      public void mouseDoubleClick(MouseEvent e)
      {
        selectedContextAttachment = 
          ((ITaskAttachment)contextTable.getItem(contextTable.getSelectionIndex()).getData());
        getWizard().getContainer().updateButtons();
        getWizard().performFinish();
        
        getWizard().getContainer().getShell().close();
      }
      
      public void mouseDown(MouseEvent e) {}
      
      public void mouseUp(MouseEvent e) {}
    });
    List<ITaskAttachment> contextAttachments = AttachmentUtil.getContextAttachments(repository, task);
    
    Collections.sort(contextAttachments, new TaskAttachmentComparator());
    
    TableColumn[] columns = new TableColumn[3];
    columns[0] = new TableColumn(contextTable, 16384);
    columns[0].setText(Messages.ContextRetrieveWizardPage_Date);
    columns[1] = new TableColumn(contextTable, 16384);
    columns[1].setText(Messages.ContextRetrieveWizardPage_Author);
    columns[2] = new TableColumn(contextTable, 16777216);
    columns[2].setText(Messages.ContextRetrieveWizardPage_Description);
    Date creationDate;
    for (ITaskAttachment attachment : contextAttachments)
    {
      item = new TableItem(contextTable, 0);
      creationDate = attachment.getCreationDate();
      if (creationDate != null) {
        item.setText(0, DateFormat.getInstance().format(creationDate));
      }
      IRepositoryPerson author = attachment.getAuthor();
      if (author != null) {
        item.setText(1, author.toString());
      }
      item.setText(2, attachment.getDescription());
      item.setData(attachment);
    }
    TableItem item = (creationDate = columns).length;
    for (TableItem localTableItem1 = 0; localTableItem1 < item; localTableItem1++)
    {
      TableColumn column = creationDate[localTableItem1];
      column.pack();
    }
    contextTable.setLayoutData(new GridData(1808));
    setControl(composite);
    if (contextAttachments.size() > 0)
    {
      contextTable.setSelection(0);
      selectedContextAttachment = ((ITaskAttachment)contextAttachments.get(0));
      getWizard().getContainer().updateButtons();
    }
    contextTable.setFocus();
    Dialog.applyDialogFont(composite);
  }
  
  public ITaskAttachment getSelectedContext()
  {
    return selectedContextAttachment;
  }
  
  public boolean isPageComplete()
  {
    if (selectedContextAttachment == null) {
      return false;
    }
    return super.isPageComplete();
  }
}

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

import java.util.Map;
import org.eclipse.jface.wizard.ProgressMonitorPart;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;

class RetrieveLatestContextDialog$1
  extends ProgressContainer
{
  RetrieveLatestContextDialog$1(RetrieveLatestContextDialog paramRetrieveLatestContextDialog, Shell $anonymous0, ProgressMonitorPart $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  protected void restoreUiState(Map<Object, Object> state)
  {
    RetrieveLatestContextDialog.access$0(this$0).setEnabled(true);
    RetrieveLatestContextDialog.access$1(this$0, 0).setEnabled(true);
    RetrieveLatestContextDialog.access$1(this$0, 1).setEnabled(true);
  }
  
  protected void saveUiState(Map<Object, Object> savedState)
  {
    RetrieveLatestContextDialog.access$0(this$0).setEnabled(false);
    RetrieveLatestContextDialog.access$1(this$0, 0).setEnabled(false);
  }
}

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

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.wizard.ProgressMonitorPart;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

class ProgressContainer
  implements IRunnableContext
{
  private static final String FOCUS_CONTROL = "focusControl";
  private long activeRunningOperations = 0L;
  private Cursor arrowCursor;
  private Button cancelButton;
  private boolean lockedUI = false;
  private final ProgressMonitorPart progressMonitorPart;
  private final Shell shell;
  private Cursor waitCursor;
  
  public ProgressContainer(Shell shell, ProgressMonitorPart progressMonitorPart)
  {
    Assert.isNotNull(shell);
    Assert.isNotNull(progressMonitorPart);
    this.shell = shell;
    this.progressMonitorPart = progressMonitorPart;
  }
  
  private Object aboutToStart(boolean enableCancelButton)
  {
    Map<Object, Object> savedState = null;
    if (getShell() != null)
    {
      Control focusControl = getShell().getDisplay().getFocusControl();
      if ((focusControl != null) && (focusControl.getShell() != getShell())) {
        focusControl = null;
      }
      Display d = getShell().getDisplay();
      waitCursor = new Cursor(d, 1);
      setDisplayCursor(waitCursor);
      
      arrowCursor = new Cursor(d, 0);
      cancelButton.setCursor(arrowCursor);
      
      savedState = new HashMap(10);
      saveUiState(savedState);
      if (focusControl != null) {
        savedState.put("focusControl", focusControl);
      }
      progressMonitorPart.attachToCancelComponent(cancelButton);
      progressMonitorPart.setVisible(true);
    }
    return savedState;
  }
  
  public Button getCancelButton()
  {
    return cancelButton;
  }
  
  private IProgressMonitor getProgressMonitor()
  {
    return progressMonitorPart;
  }
  
  public Shell getShell()
  {
    return shell;
  }
  
  public boolean isActive()
  {
    return activeRunningOperations > 0L;
  }
  
  public boolean isLockedUI()
  {
    return lockedUI;
  }
  
  protected void restoreUiState(Map<Object, Object> state) {}
  
  /* Error */
  public void run(boolean fork, boolean cancelable, org.eclipse.jface.operation.IRunnableWithProgress runnable)
    throws java.lang.reflect.InvocationTargetException, java.lang.InterruptedException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore 4
    //   3: aload_0
    //   4: getfield 147	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:activeRunningOperations	J
    //   7: lconst_0
    //   8: lcmp
    //   9: ifne +22 -> 31
    //   12: aload_0
    //   13: iload_1
    //   14: ifeq +11 -> 25
    //   17: iload_2
    //   18: ifeq +7 -> 25
    //   21: iconst_1
    //   22: goto +4 -> 26
    //   25: iconst_0
    //   26: invokespecial 162	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:aboutToStart	(Z)Ljava/lang/Object;
    //   29: astore 4
    //   31: aload_0
    //   32: dup
    //   33: getfield 147	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:activeRunningOperations	J
    //   36: lconst_1
    //   37: ladd
    //   38: putfield 147	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:activeRunningOperations	J
    //   41: iload_1
    //   42: ifne +8 -> 50
    //   45: aload_0
    //   46: iconst_1
    //   47: putfield 148	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:lockedUI	Z
    //   50: aload_3
    //   51: iload_1
    //   52: aload_0
    //   53: invokespecial 165	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:getProgressMonitor	()Lorg/eclipse/core/runtime/IProgressMonitor;
    //   56: aload_0
    //   57: invokevirtual 167	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:getShell	()Lorg/eclipse/swt/widgets/Shell;
    //   60: invokevirtual 178	org/eclipse/swt/widgets/Shell:getDisplay	()Lorg/eclipse/swt/widgets/Display;
    //   63: invokestatic 157	org/eclipse/jface/operation/ModalContext:run	(Lorg/eclipse/jface/operation/IRunnableWithProgress;ZLorg/eclipse/core/runtime/IProgressMonitor;Lorg/eclipse/swt/widgets/Display;)V
    //   66: aload_0
    //   67: iconst_0
    //   68: putfield 148	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:lockedUI	Z
    //   71: goto +29 -> 100
    //   74: astore 5
    //   76: aload_0
    //   77: dup
    //   78: getfield 147	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:activeRunningOperations	J
    //   81: lconst_1
    //   82: lsub
    //   83: putfield 147	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:activeRunningOperations	J
    //   86: aload 4
    //   88: ifnull +9 -> 97
    //   91: aload_0
    //   92: aload 4
    //   94: invokespecial 161	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:stopped	(Ljava/lang/Object;)V
    //   97: aload 5
    //   99: athrow
    //   100: aload_0
    //   101: dup
    //   102: getfield 147	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:activeRunningOperations	J
    //   105: lconst_1
    //   106: lsub
    //   107: putfield 147	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:activeRunningOperations	J
    //   110: aload 4
    //   112: ifnull +9 -> 121
    //   115: aload_0
    //   116: aload 4
    //   118: invokespecial 161	org/eclipse/mylyn/internal/tasks/ui/context/ProgressContainer:stopped	(Ljava/lang/Object;)V
    //   121: return
    // Line number table:
    //   Java source line #143	-> byte code offset #0
    //   Java source line #144	-> byte code offset #3
    //   Java source line #145	-> byte code offset #12
    //   Java source line #147	-> byte code offset #31
    //   Java source line #149	-> byte code offset #41
    //   Java source line #150	-> byte code offset #45
    //   Java source line #152	-> byte code offset #50
    //   Java source line #153	-> byte code offset #66
    //   Java source line #154	-> byte code offset #74
    //   Java source line #155	-> byte code offset #76
    //   Java source line #157	-> byte code offset #86
    //   Java source line #158	-> byte code offset #91
    //   Java source line #160	-> byte code offset #97
    //   Java source line #155	-> byte code offset #100
    //   Java source line #157	-> byte code offset #110
    //   Java source line #158	-> byte code offset #115
    //   Java source line #161	-> byte code offset #121
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	122	0	this	ProgressContainer
    //   0	122	1	fork	boolean
    //   0	122	2	cancelable	boolean
    //   0	122	3	runnable	org.eclipse.jface.operation.IRunnableWithProgress
    //   1	116	4	state	Object
    //   74	24	5	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   41	74	74	finally
  }
  
  protected void saveUiState(Map<Object, Object> savedState) {}
  
  public void setCancelButton(Button cancelButton)
  {
    this.cancelButton = cancelButton;
  }
  
  private void setDisplayCursor(Cursor c)
  {
    Shell[] shells = getShell().getDisplay().getShells();
    Shell[] arrayOfShell1;
    int j = (arrayOfShell1 = shells).length;
    for (int i = 0; i < j; i++)
    {
      Shell shell2 = arrayOfShell1[i];
      shell2.setCursor(c);
    }
  }
  
  private void stopped(Object savedState)
  {
    if ((getShell() != null) && (!getShell().isDisposed()))
    {
      progressMonitorPart.setVisible(false);
      progressMonitorPart.removeFromCancelComponent(cancelButton);
      
      Map<Object, Object> state = (Map)savedState;
      restoreUiState(state);
      
      setDisplayCursor(null);
      cancelButton.setCursor(null);
      waitCursor.dispose();
      waitCursor = null;
      arrowCursor.dispose();
      arrowCursor = null;
      Control focusControl = (Control)state.get("focusControl");
      if ((focusControl != null) && (!focusControl.isDisposed())) {
        focusControl.setFocus();
      }
    }
  }
}

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

import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class RetrieveLatestContextDialog$2
  extends SelectionAdapter
{
  RetrieveLatestContextDialog$2(RetrieveLatestContextDialog paramRetrieveLatestContextDialog) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.close();
    
    ContextRetrieveWizard wizard = new ContextRetrieveWizard(RetrieveLatestContextDialog.access$2(this$0));
    WizardDialog dialog = new WizardDialog(WorkbenchUtil.getShell(), wizard);
    dialog.create();
    dialog.setBlockOnOpen(true);
    RetrieveLatestContextDialog.access$3(this$0, dialog.open());
  }
}

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

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

public class ContextAttachWizardPage
  extends WizardPage
{
  private final TaskRe
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