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

mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:page	Lorg/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage;
      //   11: invokevirtual 125	org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage:isImageDirty	()Z
      //   14: ifeq +114 -> 128
      //   17: aload_0
      //   18: getfield 114	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:page	Lorg/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage;
      //   21: invokevirtual 127	org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage:createImage	()Lorg/eclipse/swt/graphics/Image;
      //   24: astore_2
      //   25: aload_0
      //   26: getfield 114	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:page	Lorg/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage;
      //   29: iconst_0
      //   30: invokevirtual 126	org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage:setImageDirty	(Z)V
      //   33: aload_0
      //   34: ldc 4
      //   36: ldc 1
      //   38: invokestatic 118	java/io/File:createTempFile	(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File;
      //   41: putfield 113	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:file	Ljava/io/File;
      //   44: aload_0
      //   45: getfield 113	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:file	Ljava/io/File;
      //   48: invokevirtual 117	java/io/File:deleteOnExit	()V
      //   51: new 72	org/eclipse/swt/graphics/ImageLoader
      //   54: dup
      //   55: invokespecial 131	org/eclipse/swt/graphics/ImageLoader:<init>	()V
      //   58: astore_3
      //   59: aload_3
      //   60: iconst_1
      //   61: anewarray 71	org/eclipse/swt/graphics/ImageData
      //   64: dup
      //   65: iconst_0
      //   66: aload_2
      //   67: invokevirtual 130	org/eclipse/swt/graphics/Image:getImageData	()Lorg/eclipse/swt/graphics/ImageData;
      //   70: aastore
      //   71: putfield 115	org/eclipse/swt/graphics/ImageLoader:data	[Lorg/eclipse/swt/graphics/ImageData;
      //   74: new 61	java/io/FileOutputStream
      //   77: dup
      //   78: aload_0
      //   79: getfield 113	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:file	Ljava/io/File;
      //   82: invokespecial 121	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
      //   85: astore 4
      //   87: aload_3
      //   88: aload 4
      //   90: iconst_5
      //   91: invokevirtual 132	org/eclipse/swt/graphics/ImageLoader:save	(Ljava/io/OutputStream;I)V
      //   94: goto +13 -> 107
      //   97: astore 5
      //   99: aload 4
      //   101: invokevirtual 120	java/io/FileOutputStream:close	()V
      //   104: aload 5
      //   106: athrow
      //   107: aload 4
      //   109: invokevirtual 120	java/io/FileOutputStream:close	()V
      //   112: goto +12 -> 124
      //   115: astore 6
      //   117: aload_2
      //   118: invokevirtual 129	org/eclipse/swt/graphics/Image:dispose	()V
      //   121: aload 6
      //   123: athrow
      //   124: aload_2
      //   125: invokevirtual 129	org/eclipse/swt/graphics/Image:dispose	()V
      //   128: new 60	java/io/FileInputStream
      //   131: dup
      //   132: aload_0
      //   133: getfield 113	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:file	Ljava/io/File;
      //   136: invokespecial 119	java/io/FileInputStream:<init>	(Ljava/io/File;)V
      //   139: areturn
      //   140: astore_2
      //   141: new 63	org/eclipse/core/runtime/CoreException
      //   144: dup
      //   145: new 64	org/eclipse/core/runtime/Status
      //   148: dup
      //   149: iconst_4
      //   150: ldc 3
      //   152: aload_2
      //   153: invokevirtual 122	java/io/IOException:getMessage	()Ljava/lang/String;
      //   156: aload_2
      //   157: invokespecial 124	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
      //   160: invokespecial 123	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
      //   163: athrow
      // Line number table:
      //   Java source line #209	-> byte code offset #0
      //   Java source line #210	-> byte code offset #17
      //   Java source line #211	-> byte code offset #25
      //   Java source line #213	-> byte code offset #33
      //   Java source line #214	-> byte code offset #44
      //   Java source line #215	-> byte code offset #51
      //   Java source line #216	-> byte code offset #59
      //   Java source line #218	-> byte code offset #74
      //   Java source line #220	-> byte code offset #87
      //   Java source line #221	-> byte code offset #97
      //   Java source line #222	-> byte code offset #99
      //   Java source line #223	-> byte code offset #104
      //   Java source line #222	-> byte code offset #107
      //   Java source line #224	-> byte code offset #115
      //   Java source line #225	-> byte code offset #117
      //   Java source line #226	-> byte code offset #121
      //   Java source line #225	-> byte code offset #124
      //   Java source line #228	-> byte code offset #128
      //   Java source line #229	-> byte code offset #140
      //   Java source line #230	-> byte code offset #141
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	164	0	this	ImageSource
      //   0	164	1	monitor	IProgressMonitor
      //   24	101	2	image	org.eclipse.swt.graphics.Image
      //   140	17	2	e	java.io.IOException
      //   58	30	3	loader	ImageLoader
      //   85	23	4	out	java.io.FileOutputStream
      //   97	8	5	localObject1	Object
      //   115	7	6	localObject2	Object
      // Exception table:
      //   from	to	target	type
      //   87	97	97	finally
      //   33	115	115	finally
      //   0	139	140	java/io/IOException
    }
    
    public String getContentType()
    {
      return "image/png";
    }
    
    public String getDescription()
    {
      return Messages.TaskAttachmentWizard_Screenshot;
    }
    
    public long getLength()
    {
      return file != null ? file.length() : -1L;
    }
    
    public String getName()
    {
      return "screenshot.png";
    }
    
    public boolean isLocal()
    {
      return true;
    }
  }
  
  public static enum Mode
  {
    DEFAULT,  SCREENSHOT;
  }
  
  private Mode mode = Mode.DEFAULT;
  private final TaskAttachmentModel model;
  private AttachmentPreviewPage previewPage;
  
  public TaskAttachmentWizard(TaskRepository taskRepository, ITask task, TaskAttribute taskAttachment)
  {
    Assert.isNotNull(taskRepository);
    Assert.isNotNull(taskAttachment);
    model = new TaskAttachmentModel(taskRepository, task, taskAttachment);
    connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(taskRepository.getConnectorKind());
    setMode(Mode.DEFAULT);
    setNeedsProgressMonitor(true);
    setDialogSettings(TasksUiPlugin.getDefault().getDialogSettings().getSection("AttachmentWizard"));
  }
  
  public void addPages()
  {
    if (model.getSource() == null) {
      if (mode == Mode.SCREENSHOT)
      {
        ScreenshotCreationPage page = new ScreenshotCreationPage()
        {
          protected IDialogSettings getDialogSettings()
          {
            TasksUiPlugin plugin = TasksUiPlugin.getDefault();
            IDialogSettings settings = plugin.getDialogSettings();
            String DIALOG_SETTINGS = ScreenshotCreationPage.class.getCanonicalName();
            IDialogSettings section = settings.getSection(DIALOG_SETTINGS);
            if (section == null) {
              section = settings.addNewSection(DIALOG_SETTINGS);
            }
            return section;
          }
        };
        ImageSource source = new ImageSource(page);
        model.setSource(source);
        model.setContentType(source.getContentType());
        addPage(page);
      }
      else
      {
        addPage(new AttachmentSourcePage(model));
      }
    }
    previewPage = new AttachmentPreviewPage(model);
    addPage(previewPage);
    
    AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(model.getTaskRepository()
      .getConnectorKind());
    editPage = connectorUi.getTaskAttachmentPage(model);
    addPage(editPage);
  }
  
  public Mode getMode()
  {
    return mode;
  }
  
  public TaskAttachmentModel getModel()
  {
    return model;
  }
  
  public AbstractTaskAttachmentSource getSource()
  {
    return model.getSource();
  }
  
  private void handleDone(SubmitJob job)
  {
    IStatus status = job.getStatus();
    if ((status != null) && (status.getSeverity() != 8)) {
      TasksUiInternal.displayStatus(Messages.TaskAttachmentWizard_Attachment_Failed, job.getStatus());
    }
  }
  
  public boolean canFinish()
  {
    if ((getContainer() != null) && ((getContainer().getCurrentPage() instanceof AttachmentSourcePage))) {
      return false;
    }
    return super.canFinish();
  }
  
  public boolean performFinish()
  {
    SubmitJob job = TasksUiInternal.getJobFactory()
      .createSubmitTaskAttachmentJob(connector, model.getTaskRepository(), model.getTask(), 
      model.getSource(), model.getComment(), model.getAttribute());
    final boolean attachContext = model.getAttachContext();
    job.addSubmitJobListener(new SubmitJobListener()
    {
      public void done(SubmitJobEvent event) {}
      
      public void taskSubmitted(SubmitJobEvent event, IProgressMonitor monitor)
        throws CoreException
      {
        if (attachContext)
        {
          monitor.subTask(Messages.TaskAttachmentWizard_Attaching_context);
          AttachmentUtil.postContext(connector, model.getTaskRepository(), model.getTask(), null, null, 
            monitor);
        }
      }
      
      public void taskSynchronized(SubmitJobEvent event, IProgressMonitor monitor)
        throws CoreException
      {}
    });
    if (previewPage.runInBackground())
    {
      runInBackground(job);
      return false;
    }
    return runInWizard(job);
  }
  
  private void runInBackground(final SubmitJob job)
  {
    getContainer().getShell().setVisible(false);
    job.addJobChangeListener(new JobChangeAdapter()
    {
      public void done(IJobChangeEvent event)
      {
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            if (val$job.getStatus() != null) {
              getContainer().getShell().setVisible(true);
            }
            TaskAttachmentWizard.this.handleDone(val$job);
            if (val$job.getStatus() == null) {
              getContainer().getShell().close();
            }
          }
        });
      }
    });
    job.schedule();
  }
  
  private boolean runInWizard(final SubmitJob job)
  {
    try
    {
      getContainer().run(true, true, new IRunnableWithProgress()
      {
        public void run(IProgressMonitor monitor)
          throws InvocationTargetException, InterruptedException
        {
          if (((SubmitTaskAttachmentJob)job).run(monitor) == Status.CANCEL_STATUS) {
            throw new InterruptedException();
          }
        }
      });
      handleDone(job);
      return job.getStatus() == null;
    }
    catch (InvocationTargetException e)
    {
      StatusManager.getManager().handle(new Status(4, "org.eclipse.mylyn.tasks.ui", "Unexpected error", e), 3);
      return false;
    }
    catch (InterruptedException localInterruptedException) {}
    return false;
  }
  
  public void setMode(Mode mode)
  {
    this.mode = mode;
    if (mode == Mode.SCREENSHOT)
    {
      setWindowTitle(Messages.TaskAttachmentWizard_Attach_Screenshot);
      setDefaultPageImageDescriptor(CommonImages.BANNER_SCREENSHOT);
    }
    else
    {
      setWindowTitle(Messages.TaskAttachmentWizard_Add_Attachment);
      setDefaultPageImageDescriptor(TasksUiImages.BANNER_REPOSITORY);
    }
  }
  
  public void setSource(AbstractTaskAttachmentSource source)
  {
    model.setSource(source);
  }
}

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

import java.util.List;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

class TaskAttachmentWizard$ClipboardTaskAttachmentSource$1
  implements Runnable
{
  TaskAttachmentWizard$ClipboardTaskAttachmentSource$1(TaskAttachmentWizard.ClipboardTaskAttachmentSource paramClipboardTaskAttachmentSource) {}
  
  public void run()
  {
    Clipboard clipboard = new Clipboard(PlatformUI.getWorkbench().getDisplay());
    List<Transfer> transfers = TaskAttachmentWizard.ClipboardTaskAttachmentSource.access$0();
    for (Transfer transfer : transfers)
    {
      TaskAttachmentWizard.ClipboardTaskAttachmentSource.access$1(this$1, clipboard.getContents(transfer));
      if (TaskAttachmentWizard.ClipboardTaskAttachmentSource.access$2(this$1) != null) {
        break;
      }
    }
    clipboard.dispose();
  }
}

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

import com.ibm.icu.text.SimpleDateFormat;
import java.io.File;
import java.util.Date;
import java.util.Locale;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.mylyn.commons.core.CoreUtil;
import org.eclipse.mylyn.commons.core.ICoreRunnable;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

class TaskDataImportWizard$FileCopyJob
  implements ICoreRunnable
{
  private static final String PREFIX_BACKUP = ".backup-";
  private final String JOB_LABEL = Messages.TaskDataImportWizard_Importing_Data;
  private final File sourceZipFile;
  
  public TaskDataImportWizard$FileCopyJob(File sourceZipFile)
  {
    this.sourceZipFile = sourceZipFile;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws CoreException
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore_2
    //   2: iconst_0
    //   3: istore_3
    //   4: new 102	java/util/zip/ZipFile
    //   7: dup
    //   8: aload_0
    //   9: getfield 209	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard$FileCopyJob:sourceZipFile	Ljava/io/File;
    //   12: iconst_1
    //   13: invokespecial 229	java/util/zip/ZipFile:<init>	(Ljava/io/File;I)V
    //   16: astore 4
    //   18: aload 4
    //   20: invokevirtual 230	java/util/zip/ZipFile:entries	()Ljava/util/Enumeration;
    //   23: astore 5
    //   25: goto +33 -> 58
    //   28: aload 5
    //   30: invokeinterface 244 1 0
    //   35: checkcast 101	java/util/zip/ZipEntry
    //   38: astore 6
    //   40: aload 6
    //   42: invokevirtual 227	java/util/zip/ZipEntry:getName	()Ljava/lang/String;
    //   45: ldc 4
    //   47: invokevirtual 221	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   50: ifeq +5 -> 55
    //   53: iconst_1
    //   54: istore_2
    //   55: iinc 3 1
    //   58: aload 5
    //   60: invokeinterface 243 1 0
    //   65: ifne -37 -> 28
    //   68: goto +13 -> 81
    //   71: astore 7
    //   73: aload 4
    //   75: invokevirtual 228	java/util/zip/ZipFile:close	()V
    //   78: aload 7
    //   80: athrow
    //   81: aload 4
    //   83: invokevirtual 228	java/util/zip/ZipFile:close	()V
    //   86: iload_3
    //   87: ifle +131 -> 218
    //   90: aload_1
    //   91: aload_0
    //   92: getfield 210	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard$FileCopyJob:JOB_LABEL	Ljava/lang/String;
    //   95: iload_3
    //   96: invokeinterface 247 3 0
    //   101: invokestatic 233	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   104: getstatic 207	org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants:ROOT_SCHEDULING_RULE	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   107: aload_1
    //   108: invokeinterface 249 3 0
    //   113: aload_1
    //   114: invokeinterface 246 1 0
    //   119: ifeq +21 -> 140
    //   122: invokestatic 233	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   125: getstatic 207	org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants:ROOT_SCHEDULING_RULE	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   128: invokeinterface 248 2 0
    //   133: aload_1
    //   134: invokeinterface 245 1 0
    //   139: return
    //   140: aload_0
    //   141: getfield 209	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard$FileCopyJob:sourceZipFile	Ljava/io/File;
    //   144: invokestatic 237	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getDefault	()Lorg/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin;
    //   147: invokevirtual 236	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getDataDirectory	()Ljava/lang/String;
    //   150: aload_1
    //   151: invokestatic 234	org/eclipse/mylyn/internal/commons/core/ZipFileUtil:unzipFiles	(Ljava/io/File;Ljava/lang/String;Lorg/eclipse/core/runtime/IProgressMonitor;)Ljava/util/List;
    //   154: pop
    //   155: iload_2
    //   156: ifne +7 -> 163
    //   159: aload_0
    //   160: invokespecial 239	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard$FileCopyJob:renameTaskList	()V
    //   163: aload_0
    //   164: invokespecial 238	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard$FileCopyJob:readTaskListData	()V
    //   167: goto +51 -> 218
    //   170: astore_2
    //   171: new 105	org/eclipse/core/runtime/Status
    //   174: dup
    //   175: iconst_4
    //   176: ldc 3
    //   178: aload_2
    //   179: invokevirtual 219	java/io/IOException:getMessage	()Ljava/lang/String;
    //   182: aload_2
    //   183: invokespecial 232	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   186: astore_3
    //   187: new 103	org/eclipse/core/runtime/CoreException
    //   190: dup
    //   191: aload_3
    //   192: invokespecial 231	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   195: athrow
    //   196: astore 8
    //   198: invokestatic 233	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   201: getstatic 207	org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants:ROOT_SCHEDULING_RULE	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   204: invokeinterface 248 2 0
    //   209: aload_1
    //   210: invokeinterface 245 1 0
    //   215: aload 8
    //   217: athrow
    //   218: invokestatic 233	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   221: getstatic 207	org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants:ROOT_SCHEDULING_RULE	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   224: invokeinterface 248 2 0
    //   229: aload_1
    //   230: invokeinterface 245 1 0
    //   235: return
    // Line number table:
    //   Java source line #153	-> byte code offset #0
    //   Java source line #154	-> byte code offset #2
    //   Java source line #157	-> byte code offset #4
    //   Java source line #159	-> byte code offset #18
    //   Java source line #160	-> byte code offset #25
    //   Java source line #161	-> byte code offset #28
    //   Java source line #162	-> byte code offset #40
    //   Java source line #163	-> byte code offset #53
    //   Java source line #165	-> byte code offset #55
    //   Java source line #160	-> byte code offset #58
    //   Java source line #167	-> byte code offset #71
    //   Java source line #168	-> byte code offset #73
    //   Java source line #169	-> byte code offset #78
    //   Java source line #168	-> byte code offset #81
    //   Java source line #171	-> byte code offset #86
    //   Java source line #172	-> byte code offset #90
    //   Java source line #173	-> byte code offset #101
    //   Java source line #175	-> byte code offset #113
    //   Java source line #191	-> byte code offset #122
    //   Java source line #192	-> byte code offset #133
    //   Java source line #176	-> byte code offset #139
    //   Java source line #179	-> byte code offset #140
    //   Java source line #181	-> byte code offset #155
    //   Java source line #182	-> byte code offset #159
    //   Java source line #185	-> byte code offset #163
    //   Java source line #187	-> byte code offset #170
    //   Java source line #188	-> byte code offset #171
    //   Java source line #189	-> byte code offset #187
    //   Java source line #190	-> byte code offset #196
    //   Java source line #191	-> byte code offset #198
    //   Java source line #192	-> byte code offset #209
    //   Java source line #193	-> byte code offset #215
    //   Java source line #191	-> byte code offset #218
    //   Java source line #192	-> byte code offset #229
    //   Java source line #194	-> byte code offset #235
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	236	0	this	FileCopyJob
    //   0	236	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   1	155	2	hasDefaultTaskList	boolean
    //   170	13	2	e	java.io.IOException
    //   3	93	3	numEntries	int
    //   186	6	3	status	org.eclipse.core.runtime.Status
    //   16	66	4	zipFile	java.util.zip.ZipFile
    //   23	36	5	entries	java.util.Enumeration<? extends java.util.zip.ZipEntry>
    //   38	3	6	entry	java.util.zip.ZipEntry
    //   71	8	7	localObject1	Object
    //   196	20	8	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   18	71	71	finally
    //   0	122	170	java/io/IOException
    //   140	167	170	java/io/IOException
    //   0	122	196	finally
    //   140	196	196	finally
  }
  
  private void readTaskListData()
  {
    if (!CoreUtil.TEST_MODE) {
      PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable()
      {
        public void run()
        {
          try
          {
            TasksUiPlugin.getDefault().reloadDataDirectory();
          }
          catch (CoreException e)
          {
            TasksUiInternal.displayStatus(Messages.TaskDataImportWizard_Import_Error, e.getStatus());
          }
        }
      });
    } else {
      TasksUiPlugin.getDefault().initializeDataSources();
    }
  }
  
  private void renameTaskList()
  {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HHmmss", 
      Locale.ENGLISH);
    String date = format.format(new Date());
    
    File taskListFile = new File(TasksUiPlugin.getDefault().getDataDirectory(), 
      "tasks.xml.zip");
    if (taskListFile.exists()) {
      taskListFile.renameTo(new File(taskListFile.getParentFile(), taskListFile.getName() + ".backup-" + 
        date));
    }
    File taskListFileSnapshot = new File(TasksUiPlugin.getDefault().getDataDirectory(), 
      ".tasks.xml.zip");
    if (taskListFileSnapshot.exists()) {
      taskListFileSnapshot.renameTo(new File(taskListFile.getParentFile(), taskListFileSnapshot.getName() + 
        ".backup-" + date));
    }
  }
}

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

import java.util.HashMap;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.mylyn.commons.ui.dialogs.EnhancedWizardDialog;
import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositoryQueryPage2;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

public class QueryWizardDialog
  extends EnhancedWizardDialog
{
  private static final String REFRESH_BUTTON_KEY = "refresh";
  private static final String CLEAR_BUTTON_KEY = "clear";
  public static final int REFRESH_BUTTON_ID = 2001;
  public static final int CLEAR_BUTTON_ID = 2002;
  private Button refreshButton;
  private Button clearButton;
  private AbstractRepositoryQueryPage2 abstractRepositoryQueryPage;
  
  public QueryWizardDialog(Shell parentShell, IWizard newWizard)
  {
    super(parentShell, newWizard);
    setHelpAvailable(false);
    IWizardPage[] arrayOfIWizardPage;
    int j = (arrayOfIWizardPage = newWizard.getPages()).length;
    for (int i = 0; i < j; i++)
    {
      IWizardPage page = arrayOfIWizardPage[i];
      if ((page instanceof AbstractRepositoryQueryPage2)) {
        abstractRepositoryQueryPage = ((AbstractRepositoryQueryPage2)page);
      }
    }
  }
  
  protected void createExtraButtons(Composite composite)
  {
    if (abstractRepositoryQueryPage != null)
    {
      if (abstractRepositoryQueryPage.needsRefresh())
      {
        refreshButton = createButton(composite, 2001, 
          Messages.QueryWizardDialog_Update_Attributes_from_Repository, false);
        refreshButton.setVisible(false);
        setButtonLayoutData(refreshButton);
      }
      if (abstractRepositoryQueryPage.needsClear())
      {
        clearButton = createButton(composite, 2002, Messages.QueryWizardDialog_Clear_Fields, false);
        clearButton.setVisible(false);
        setButtonLayoutData(clearButton);
      }
    }
  }
  
  protected void updateExtraButtons()
  {
    if (abstractRepositoryQueryPage != null)
    {
      if (refreshButton != null) {
        abstractRepositoryQueryPage.setExtraButtonState(refreshButton);
      }
      if (clearButton != null) {
        abstractRepositoryQueryPage.setExtraButtonState(clearButton);
      }
    }
  }
  
  protected boolean handleExtraButtonPressed(int buttonId)
  {
    if (abstractRepositoryQueryPage != null) {
      abstractRepositoryQueryPage.handleExtraButtonPressed(buttonId);
    }
    return false;
  }
  
  protected HashMap<String, Boolean> saveAndSetEnabledStateMylyn()
  {
    HashMap<String, Boolean> savedEnabledState = null;
    if (getShell() != null)
    {
      savedEnabledState = new HashMap();
      if ((refreshButton != null) && (refreshButton.getShell() == getShell()))
      {
        savedEnabledState.put("refresh", Boolean.valueOf(refreshButton.getEnabled()));
        refreshButton.setEnabled(false);
      }
      if ((clearButton != null) && (clearButton.getShell() == getShell()))
      {
        savedEnabledState.put("clear", Boolean.valueOf(clearButton.getEnabled()));
        clearButton.setEnabled(false);
      }
    }
    return savedEnabledState;
  }
  
  protected void restoreEnabledStateMylyn(HashMap<String, Boolean> savedEnabledState)
  {
    if (savedEnabledState != null)
    {
      Boolean savedValidateEnabledState = (Boolean)savedEnabledState.get("clear");
      if ((clearButton != null) && (savedValidateEnabledState != null)) {
        clearButton.setEnabled(savedValidateEnabledState.booleanValue());
      }
      savedValidateEnabledState = (Boolean)savedEnabledState.get("refresh");
      if ((refreshButton != null) && (savedValidateEnabledState != null)) {
        refreshButton.setEnabled(savedValidateEnabledState.booleanValue());
      }
    }
  }
}

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

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AttachmentSourcePage$4
  implements ModifyListener
{
  AttachmentSourcePage$4(AttachmentSourcePage paramAttachmentSourcePage) {}
  
  public void modifyText(ModifyEvent e)
  {
    AttachmentSourcePage.access$1(this$0);
    AttachmentSourcePage.access$2(this$0, true);
    AttachmentSourcePage.access$4(this$0);
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.internal.tasks.core.sync.SubmitTaskAttachmentJob;
import org.eclipse.mylyn.tasks.core.sync.SubmitJob;

class TaskAttachmentWizard$4
  implements IRunnableWithProgress
{
  TaskAttachmentWizard$4(TaskAttachmentWizard paramTaskAttachmentWizard, SubmitJob paramSubmitJob) {}
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    if (((SubmitTaskAttachmentJob)val$job).run(monitor) == Status.CANCEL_STATUS) {
      throw new InterruptedException();
    }
  }
}

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

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.mylyn.tasks.core.TaskRepository;

class SelectRepositoryPage$3
  implements ISelectionChangedListener
{
  SelectRepositoryPage$3(SelectRepositoryPage paramSelectRepositoryPage) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    IStructuredSelection selection = (IStructuredSelection)event.getSelection();
    if ((selection.getFirstElement() instanceof TaskRepository))
    {
      SelectRepositoryPage.access$4(this$0, new SelectRepositoryPage.CustomWizardNode(this$0, (TaskRepository)selection.getFirstElement()));
      this$0.setPageComplete(true);
    }
    else
    {
      SelectRepositoryPage.access$4(this$0, null);
      this$0.setPageComplete(false);
    }
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Text;

class TaskDataImportWizardPage$3
  extends SelectionAdapter
{
  TaskDataImportWizardPage$3(TaskDataImportWizardPage paramTaskDataImportWizardPage) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    FileDialog dialog = new FileDialog(this$0.getShell());
    dialog.setText(Messages.TaskDataImportWizardPage_Zip_File_Selection);
    String dir = TaskDataImportWizardPage.access$4(this$0).getText();
    dialog.setFilterPath(dir);
    dir = dialog.open();
    if ((dir == null) || (dir.equals(""))) {
      return;
    }
    TaskDataImportWizardPage.access$4(this$0).setText(dir);
  }
}

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

import org.eclipse.mylyn.internal.tasks.core.ITaskRepositoryFilter;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.ui.INewWizard;

public class NewTaskWizardInternal
  extends MultiRepositoryAwareWizard
  implements INewWizard
{
  public NewTaskWizardInternal(ITaskMapping taskSelection)
  {
    super(new NewTaskPage(ITaskRepositoryFilter.CAN_CREATE_NEW_TASK, taskSelection), Messages.NewTaskWizard_New_Task);
    setNeedsProgressMonitor(true);
  }
  
  public NewTaskWizardInternal()
  {
    this(null);
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Text;

class TaskDataExportWizardPage$2
  extends SelectionAdapter
{
  TaskDataExportWizardPage$2(TaskDataExportWizardPage paramTaskDataExportWizardPage) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    DirectoryDialog dialog = new DirectoryDialog(this$0.getShell());
    dialog.setText(Messages.TaskDataExportWizardPage_Folder_Selection);
    dialog.setMessage(Messages.TaskDataExportWizardPage_Specify_the_destination_folder_for_task_data);
    String dir = TaskDataExportWizardPage.access$0(this$0).getText();
    dialog.setFilterPath(dir);
    dir = dialog.open();
    if ((dir == null) || (dir.equals(""))) {
      return;
    }
    TaskDataExportWizardPage.access$0(this$0).setText(dir);
    this$0.controlChanged();
  }
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.widgets.ExpandableComposite;

public class LocalRepositorySettingsPage
  extends AbstractTaskRepositoryPage
{
  public LocalRepositorySettingsPage(TaskRepository taskRepository)
  {
    super(Messages.LocalRepositorySettingsPage_Local_Repository_Settings, Messages.LocalRepositorySettingsPage_Configure_the_local_repository, taskRepository);
  }
  
  public String getConnectorKind()
  {
    return "local";
  }
  
  public String getRepositoryUrl()
  {
    return "local";
  }
  
  protected void createSettingControls(Composite parent) {}
  
  protected IStatus validate()
  {
    return null;
  }
  
  protected void createContributionControls(Composite parentControl)
  {
    super.createContributionControls(parentControl);
    
    Control[] children = parentControl.getChildren();
    if ((children.length > 0) && 
      ((children[0] instanceof ExpandableComposite))) {
      ((ExpandableComposite)children[0]).setExpanded(true);
    }
  }
}

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

public enum TaskAttachmentWizard$Mode
{
  DEFAULT,  SCREENSHOT;
}

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

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

public class NewWebTaskPage
  extends WizardPage
{
  public NewWebTaskPage(ITaskMapping taskSelection)
  {
    super(Messages.NewWebTaskPage_New_Task);
    
    setTitle(Messages.NewWebTaskPage_Create_via_Web_Browser);
    setDescription(Messages.NewWebTaskPage_This_will_open_a_web_browser_that_can_be_used_to_create_a_new_task);
  }
  
  public void createControl(Composite parent)
  {
    Text text = new Text(parent, 64);
    text.setEditable(false);
    text.setText(Messages.NewWebTaskPage_Once_submitted_synchronize_queries_or_add_the_task_to_a_category);
    setControl(text);
    Dialog.applyDialogFont(text);
  }
}

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

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;

class SelectRepositoryConnectorPage$1
  implements ISelectionChangedListener
{
  SelectRepositoryConnectorPage$1(SelectRepositoryConnectorPage paramSelectRepositoryConnectorPage) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    IStructuredSelection selection = (IStructuredSelection)event.getSelection();
    if ((selection.getFirstElement() instanceof AbstractRepositoryConnector))
    {
      SelectRepositoryConnectorPage.access$0(this$0, (AbstractRepositoryConnector)selection.getFirstElement());
      this$0.setPageComplete(true);
    }
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;

class AttachmentSourcePage$5
  extends SelectionAdapter
{
  AttachmentSourcePage$5(AttachmentSourcePage paramAttachmentSourcePage, Composite paramComposite) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    AttachmentSourcePage.access$1(this$0);
    AttachmentSourcePage.access$2(this$0, true);
    
    FileDialog fileChooser = new FileDialog(val$composite.getShell(), 4096);
    fileChooser.setText(Messages.AttachmentSourcePage_Select_File_Dialog_Title);
    if (AttachmentSourcePage.access$6(this$0).getText().trim().length() > 0) {
      AttachmentSourcePage.access$7(this$0, AttachmentSourcePage.access$6(this$0).getText().trim());
    }
    fileChooser.setFileName(AttachmentSourcePage.access$8(this$0));
    String file = fileChooser.open();
    if (file == null) {
      return;
    }
    AttachmentSourcePage.access$7(this$0, file);
    AttachmentSourcePage.access$6(this$0).setText(file);
    AttachmentSourcePage.access$4(this$0);
  }
}

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

import java.io.File;
import org.eclipse.mylyn.commons.ui.wizard.ScreenshotCreationPage;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource;

class TaskAttachmentWizard$ImageSource
  extends AbstractTaskAttachmentSource
{
  private File file;
  private final ScreenshotCreationPage page;
  
  public TaskAttachmentWizard$ImageSource(ScreenshotCreationPage page)
  {
    this.page = page;
  }
  
  /* Error */
  public java.io.InputStream createInputStream(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 113	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:file	Ljava/io/File;
    //   4: ifnull +13 -> 17
    //   7: aload_0
    //   8: getfield 114	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:page	Lorg/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage;
    //   11: invokevirtual 125	org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage:isImageDirty	()Z
    //   14: ifeq +114 -> 128
    //   17: aload_0
    //   18: getfield 114	org/eclipse/mylyn/internal/tasks/ui/wizards/TaskAttachmentWizard$ImageSource:page	Lorg/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage;
    //   21: invokevirtual 127	org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage:createImage	()Lorg/eclipse/swt/graphics/Image;
    //   24: astore_2
    //   25: aload_0
    //   26: getfield 114	or
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