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

ivate TaskEditor editor;
  private boolean migrateDueDate = true;
  
  public TaskMigrator(ITask oldTask)
  {
    this.oldTask = oldTask;
    openEditors = true;
  }
  
  public void setMigrateDueDate(boolean migrateDueDate)
  {
    this.migrateDueDate = migrateDueDate;
  }
  
  public boolean openEditors()
  {
    return openEditors;
  }
  
  public void setOpenEditors(boolean openEditors)
  {
    this.openEditors = openEditors;
  }
  
  public boolean delete()
  {
    return delete;
  }
  
  public void setDelete(boolean delete)
  {
    this.delete = delete;
  }
  
  /* Error */
  public void execute(ITask newTask)
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: invokespecial 225	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:copyProperties	(Lorg/eclipse/mylyn/tasks/core/ITask;)V
    //   5: aload_1
    //   6: invokeinterface 239 1 0
    //   11: invokestatic 233	org/eclipse/mylyn/tasks/ui/TasksUi:getRepositoryConnector	(Ljava/lang/String;)Lorg/eclipse/mylyn/tasks/core/AbstractRepositoryConnector;
    //   14: astore_2
    //   15: aload_2
    //   16: ifnull +29 -> 45
    //   19: new 107	org/eclipse/mylyn/tasks/core/TaskMigrationEvent
    //   22: dup
    //   23: aload_0
    //   24: getfield 203	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:oldTask	Lorg/eclipse/mylyn/tasks/core/ITask;
    //   27: aload_1
    //   28: invokespecial 229	org/eclipse/mylyn/tasks/core/TaskMigrationEvent:<init>	(Lorg/eclipse/mylyn/tasks/core/ITask;Lorg/eclipse/mylyn/tasks/core/ITask;)V
    //   31: astore_3
    //   32: new 103	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator$1
    //   35: dup
    //   36: aload_0
    //   37: aload_2
    //   38: aload_3
    //   39: invokespecial 226	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator$1:<init>	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator;Lorg/eclipse/mylyn/tasks/core/AbstractRepositoryConnector;Lorg/eclipse/mylyn/tasks/core/TaskMigrationEvent;)V
    //   42: invokestatic 206	org/eclipse/core/runtime/SafeRunner:run	(Lorg/eclipse/core/runtime/ISafeRunnable;)V
    //   45: iconst_1
    //   46: putstatic 199	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:active	Z
    //   49: aload_0
    //   50: getfield 203	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:oldTask	Lorg/eclipse/mylyn/tasks/core/ITask;
    //   53: invokeinterface 238 1 0
    //   58: istore_3
    //   59: iload_3
    //   60: ifeq +15 -> 75
    //   63: invokestatic 232	org/eclipse/mylyn/tasks/ui/TasksUi:getTaskActivityManager	()Lorg/eclipse/mylyn/tasks/core/ITaskActivityManager;
    //   66: aload_0
    //   67: getfield 203	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:oldTask	Lorg/eclipse/mylyn/tasks/core/ITask;
    //   70: invokeinterface 241 2 0
    //   75: aload_0
    //   76: invokespecial 222	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:closeEditor	()Z
    //   79: istore 4
    //   81: aload_0
    //   82: invokespecial 221	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:deleteOldTask	()V
    //   85: iload_3
    //   86: ifeq +12 -> 98
    //   89: invokestatic 232	org/eclipse/mylyn/tasks/ui/TasksUi:getTaskActivityManager	()Lorg/eclipse/mylyn/tasks/core/ITaskActivityManager;
    //   92: aload_1
    //   93: invokeinterface 240 2 0
    //   98: aload_0
    //   99: invokevirtual 224	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:openEditors	()Z
    //   102: ifeq +34 -> 136
    //   105: iload 4
    //   107: ifeq +11 -> 118
    //   110: aload_1
    //   111: invokestatic 234	org/eclipse/mylyn/tasks/ui/TasksUiUtil:openTask	(Lorg/eclipse/mylyn/tasks/core/ITask;)Z
    //   114: pop
    //   115: goto +21 -> 136
    //   118: aload_1
    //   119: iconst_0
    //   120: invokestatic 228	org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal:openTaskInBackground	(Lorg/eclipse/mylyn/tasks/core/ITask;Z)Z
    //   123: pop
    //   124: goto +12 -> 136
    //   127: astore 5
    //   129: iconst_0
    //   130: putstatic 199	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:active	Z
    //   133: aload 5
    //   135: athrow
    //   136: iconst_0
    //   137: putstatic 199	org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator:active	Z
    //   140: return
    // Line number table:
    //   Java source line #91	-> byte code offset #0
    //   Java source line #94	-> byte code offset #5
    //   Java source line #95	-> byte code offset #15
    //   Java source line #96	-> byte code offset #19
    //   Java source line #97	-> byte code offset #32
    //   Java source line #112	-> byte code offset #45
    //   Java source line #114	-> byte code offset #49
    //   Java source line #115	-> byte code offset #59
    //   Java source line #116	-> byte code offset #63
    //   Java source line #119	-> byte code offset #75
    //   Java source line #121	-> byte code offset #81
    //   Java source line #123	-> byte code offset #85
    //   Java source line #124	-> byte code offset #89
    //   Java source line #127	-> byte code offset #98
    //   Java source line #128	-> byte code offset #105
    //   Java source line #129	-> byte code offset #110
    //   Java source line #131	-> byte code offset #118
    //   Java source line #134	-> byte code offset #127
    //   Java source line #135	-> byte code offset #129
    //   Java source line #136	-> byte code offset #133
    //   Java source line #135	-> byte code offset #136
    //   Java source line #137	-> byte code offset #140
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	141	0	this	TaskMigrator
    //   0	141	1	newTask	ITask
    //   14	24	2	connector	AbstractRepositoryConnector
    //   31	8	3	event	TaskMigrationEvent
    //   58	28	3	reactivate	boolean
    //   79	27	4	editorIsActive	boolean
    //   127	7	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   45	127	127	finally
  }
  
  public void setEditor(TaskEditor editor)
  {
    this.editor = editor;
  }
  
  public TaskEditor getEditor()
  {
    return editor;
  }
  
  private boolean closeEditor()
  {
    boolean editorIsActive = false;
    if (editor != null)
    {
      IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      if (window != null)
      {
        IWorkbenchPage activePage = window.getActivePage();
        if ((activePage != null) && 
          (activePage.getActiveEditor() == editor)) {
          editorIsActive = true;
        }
      }
      editor.close(false);
    }
    return editorIsActive;
  }
  
  private void deleteOldTask()
  {
    if (delete())
    {
      TasksUiInternal.getTaskList().deleteTask(oldTask);
      TasksUiPlugin.getContextStore().deleteContext(oldTask);
      try
      {
        TasksUiPlugin.getTaskDataManager().deleteTaskData(oldTask);
      }
      catch (CoreException e)
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", "Failed to delete task data", e));
      }
    }
  }
  
  private void copyProperties(ITask newTask)
  {
    if (((oldTask instanceof AbstractTask)) && ((newTask instanceof AbstractTask)))
    {
      ((AbstractTask)newTask).setNotes(((AbstractTask)oldTask).getNotes());
      DateRange scheduledDate = ((AbstractTask)oldTask).getScheduledForDate();
      TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask)newTask, scheduledDate);
      Date dueDate = ((AbstractTask)oldTask).getDueDate();
      if (migrateDueDate) {
        TasksUiPlugin.getTaskActivityManager().setDueDate(newTask, dueDate);
      }
      ((AbstractTask)newTask).setEstimatedTimeHours(((AbstractTask)oldTask).getEstimatedTimeHours());
    }
    TasksUiPlugin.getContextStore().moveContext(oldTask, newTask);
  }
  
  public static boolean isActive()
  {
    return active;
  }
}

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

import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.OpenEvent;

class TaskEditorAttachmentPart$1
  implements IOpenListener
{
  TaskEditorAttachmentPart$1(TaskEditorAttachmentPart paramTaskEditorAttachmentPart) {}
  
  public void open(OpenEvent event)
  {
    this$0.openAttachments(event);
  }
}

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

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;

class RepositoryCompletionProcessor$ProposalComputer
{
  public static final String LABEL_SEPARATOR = " -------------------------------------------- ";
  private final Set<ITask> addedTasks = new HashSet();
  private boolean addSeparator;
  private final int offset;
  private final String prefix;
  private final List<ICompletionProposal> resultList = new ArrayList();
  
  public RepositoryCompletionProcessor$ProposalComputer(RepositoryCompletionProcessor paramRepositoryCompletionProcessor, ITextViewer viewer, int offset)
  {
    this.offset = offset;
    prefix = extractPrefix(viewer, offset).toLowerCase();
  }
  
  private void addProposal(ITask task, String replacement, boolean includeTaskPrefix)
  {
    if (addSeparator)
    {
      if (!addedTasks.isEmpty()) {
        resultList.add(createSeparator());
      }
      addSeparator = false;
    }
    resultList.add(new RepositoryCompletionProcessor.TaskCompletionProposal(RepositoryCompletionProcessor.access$0(this$0), task, RepositoryCompletionProcessor.access$1(this$0), replacement, includeTaskPrefix, 
      offset - prefix.length(), prefix.length()));
    
    addedTasks.add(task);
  }
  
  public void addSeparator()
  {
    addSeparator = true;
  }
  
  public void addTasks(List<AbstractTask> tasks)
  {
    for (AbstractTask task : tasks) {
      addTask(task);
    }
  }
  
  public void addTask(ITask task)
  {
    if (addedTasks.contains(task)) {
      return;
    }
    if ((this$0.getNeverIncludePrefix()) && (!task.getRepositoryUrl().equals(RepositoryCompletionProcessor.access$0(this$0).getRepositoryUrl()))) {
      return;
    }
    String taskKey = task.getTaskKey();
    if (prefix.length() == 0) {
      addProposal(task, taskKey, !this$0.getNeverIncludePrefix());
    } else if ((taskKey != null) && (taskKey.startsWith(prefix))) {
      addProposal(task, taskKey, false);
    } else if (containsPrefix(task)) {
      addProposal(task, taskKey, !this$0.getNeverIncludePrefix());
    }
  }
  
  private boolean containsPrefix(ITask task)
  {
    String haystack = TasksUiInternal.getTaskPrefix(task.getConnectorKind()) + 
      " " + RepositoryCompletionProcessor.access$1(this$0).getText(task);
    String[] haystackTokens = haystack.split("\\s");
    String[] needles = prefix.trim().split("\\*");
    if ((haystackTokens.length == 0) || (needles.length == 0)) {
      return false;
    }
    String[] arrayOfString1;
    int j = (arrayOfString1 = needles).length;
    for (int i = 0; i < j; i++)
    {
      String needle = arrayOfString1[i];
      boolean matched = false;
      String[] arrayOfString2;
      int m = (arrayOfString2 = haystackTokens).length;
      for (int k = 0; k < m; k++)
      {
        String haystackToken = arrayOfString2[k];
        if (haystackToken.toLowerCase().startsWith(needle))
        {
          matched = true;
          break;
        }
      }
      if (!matched) {
        return false;
      }
    }
    return true;
  }
  
  private CompletionProposal createSeparator()
  {
    return new CompletionProposal("", offset, 0, 0, CommonImages.getImage(CommonImages.SEPARATOR_LIST), 
      " -------------------------------------------- ", null, null);
  }
  
  private String extractPrefix(ITextViewer viewer, int offset)
  {
    int i = offset;
    IDocument document = viewer.getDocument();
    if (i > document.getLength()) {
      return "";
    }
    try
    {
      do
      {
        char c = document.getChar(i - 1);
        if ((Character.isWhitespace(c)) || (c == '(') || (c == ':')) {
          break;
        }
        i--;
      } while (i > 0);
      if ((i == offset) && (RepositoryCompletionProcessor.access$0(this$0) != null))
      {
        String taskPrefix = TasksUiInternal.getTaskPrefix(RepositoryCompletionProcessor.access$0(this$0).getConnectorKind());
        if (taskPrefix.length() > 1) {
          try
          {
            if (taskPrefix.equals(document.get(offset - taskPrefix.length(), taskPrefix.length()))) {
              return taskPrefix;
            }
          }
          catch (BadLocationException localBadLocationException1) {}
        }
      }
      return document.get(i, offset - i);
    }
    catch (BadLocationException localBadLocationException2) {}
    return "";
  }
  
  public void filterTasks(List<AbstractTask> tasks)
  {
    for (Iterator<AbstractTask> it = tasks.iterator(); it.hasNext();)
    {
      ITask task = (ITask)it.next();
      if (!select(task)) {
        it.remove();
      }
    }
  }
  
  private boolean select(ITask task)
  {
    return (!(task instanceof LocalTask)) && ((RepositoryCompletionProcessor.access$0(this$0) == null) || (task.getRepositoryUrl().equals(RepositoryCompletionProcessor.access$0(this$0).getRepositoryUrl())));
  }
  
  public ICompletionProposal[] getResult()
  {
    return (ICompletionProposal[])resultList.toArray(new ICompletionProposal[resultList.size()]);
  }
}

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

import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.ui.forms.widgets.ILayoutExtension;
import org.eclipse.ui.forms.widgets.Section;

class FillWidthLayout
  extends Layout
  implements ILayoutExtension
{
  private final int marginLeft;
  private final int marginRight;
  private final int marginTop;
  private final int marginBottom;
  private final int widthHintMargin;
  private Composite layoutAdvisor;
  private int lastWidthHint;
  private Point lastComputedSize;
  
  public FillWidthLayout()
  {
    this(0, 0, 0, 0);
  }
  
  public FillWidthLayout(int marginLeft, int marginRight, int marginTop, int marginBottom)
  {
    this(null, marginLeft, marginRight, marginTop, marginBottom);
  }
  
  public FillWidthLayout(Composite layoutAdvisor, int marginLeft, int marginRight, int marginTop, int marginBottom)
  {
    this.layoutAdvisor = layoutAdvisor;
    this.marginLeft = marginLeft;
    this.marginRight = marginRight;
    this.marginTop = marginTop;
    this.marginBottom = marginBottom;
    if ("macosx".equals(Platform.getOS())) {
      widthHintMargin = 15;
    } else {
      widthHintMargin = 18;
    }
  }
  
  private int calculateWidthHint(Composite container)
  {
    return calculateWidthHint(container, layoutAdvisor == null);
  }
  
  private int calculateWidthHint(Composite container, boolean layoutAdvisorHit)
  {
    if (container == layoutAdvisor) {
      layoutAdvisorHit = true;
    }
    Rectangle clientArea = container.getClientArea();
    int horizontalMargin = 0;
    if ((width <= 1) || (!layoutAdvisorHit)) {
      width = calculateWidthHint(container.getParent(), layoutAdvisorHit);
    }
    Layout bodyLayout = container.getLayout();
    if ((bodyLayout instanceof GridLayout))
    {
      GridLayout gridLayout = (GridLayout)bodyLayout;
      horizontalMargin = marginWidth * 2 + marginLeft + marginRight;
    }
    else if ((bodyLayout instanceof FillLayout))
    {
      FillLayout fillLayout = (FillLayout)bodyLayout;
      horizontalMargin = marginWidth * 2;
    }
    else if ((container instanceof Section))
    {
      horizontalMargin = marginWidth * 2;
    }
    else if ((container instanceof CTabFolder))
    {
      CTabFolder folder = (CTabFolder)container;
      horizontalMargin = marginWidth * 2;
    }
    if ((container instanceof ScrolledComposite))
    {
      ScrolledComposite composite = (ScrolledComposite)container;
      ScrollBar verticalBar = composite.getVerticalBar();
      if (verticalBar != null)
      {
        int verticalBarWidth = getSizex;
        horizontalMargin += Math.max(15, verticalBarWidth);
      }
    }
    return width - horizontalMargin;
  }
  
  protected Point computeSize(Composite composite, int widthHint, int heightHint, boolean flushCache)
  {
    Control[] children = composite.getChildren();
    if (children.length == 0) {
      return new Point(0, 0);
    }
    if (widthHint <= 0)
    {
      widthHint = calculateWidthHint(composite);
      widthHint -= widthHintMargin;
    }
    int horizontalMargin = marginLeft + marginRight;
    if (widthHint < horizontalMargin) {
      widthHint = horizontalMargin;
    }
    if ((lastComputedSize == null) || (widthHint != lastWidthHint))
    {
      int resultX = 1;
      int resultY = 1;
      int controlWidthHint = Math.max(horizontalMargin, widthHint - horizontalMargin - 2);
      Control[] arrayOfControl1;
      int j = (arrayOfControl1 = children).length;
      for (int i = 0; i < j; i++)
      {
        Control control = arrayOfControl1[i];
        Point sz = control.computeSize(controlWidthHint, -1, true);
        resultX = Math.max(resultX, x);
        resultY = Math.max(resultY, y);
      }
      lastWidthHint = widthHint;
      lastComputedSize = new Point(resultX + horizontalMargin, resultY + marginTop + marginBottom);
    }
    return new Point(lastComputedSize.x, lastComputedSize.y + 1);
  }
  
  protected void layout(Composite composite, boolean flushCache)
  {
    Rectangle area = composite.getClientArea();
    if (width == 0) {
      width = calculateWidthHint(composite);
    }
    x += marginLeft;
    y += marginTop;
    width -= marginRight + marginLeft;
    height -= marginBottom + marginTop;
    
    Control[] children = composite.getChildren();
    Control[] arrayOfControl1;
    int j = (arrayOfControl1 = children).length;
    for (int i = 0; i < j; i++)
    {
      Control control = arrayOfControl1[i];
      control.setBounds(area);
    }
  }
  
  public Composite getLayoutAdvisor()
  {
    return layoutAdvisor;
  }
  
  public void setLayoutAdvisor(Composite layoutAdvisor)
  {
    this.layoutAdvisor = layoutAdvisor;
  }
  
  public void flush()
  {
    lastComputedSize = null;
  }
  
  public int computeMaximumWidth(Composite parent, boolean changed)
  {
    int width = marginLeft + marginRight;
    Control[] children = parent.getChildren();
    Control[] arrayOfControl1;
    int j = (arrayOfControl1 = children).length;
    for (int i = 0; i < j; i++)
    {
      Control control = arrayOfControl1[i];
      width = Math.max(computeSize-10x + marginLeft + marginRight, width);
    }
    return width;
  }
  
  public int computeMinimumWidth(Composite parent, boolean changed)
  {
    int width = marginLeft + marginRight;
    
    return width;
  }
}

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

import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;

class TaskEditorCommentPart$2$1
  extends AbstractReplyToCommentAction
{
  TaskEditorCommentPart$2$1(TaskEditorCommentPart.2 param2, AbstractTaskEditorPage $anonymous0, ITaskComment $anonymous1, ITaskComment paramITaskComment1)
  {
    super($anonymous0, $anonymous1);
  }
  
  protected String getReplyText()
  {
    return val$comment.getText();
  }
}

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

import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.mylyn.commons.core.CoreUtil;
import org.eclipse.mylyn.commons.ui.TableSorter;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskKeyComparator;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;

class TaskEditorAttachmentPart$AttachmentTableSorter
  extends TableSorter
{
  TaskKeyComparator keyComparator = new TaskKeyComparator();
  
  private TaskEditorAttachmentPart$AttachmentTableSorter(TaskEditorAttachmentPart paramTaskEditorAttachmentPart) {}
  
  public int compare(TableViewer viewer, Object e1, Object e2, int columnIndex)
  {
    ITaskAttachment attachment1 = (ITaskAttachment)e1;
    ITaskAttachment attachment2 = (ITaskAttachment)e2;
    switch (columnIndex)
    {
    case 0: 
      return CoreUtil.compare(attachment1.getFileName(), attachment2.getFileName());
    case 1: 
      String description1 = attachment1.getDescription();
      String description2 = attachment2.getDescription();
      return CoreUtil.compare(description1, description2);
    case 2: 
      return CoreUtil.compare(Long.valueOf(attachment1.getLength()), Long.valueOf(attachment2.getLength()));
    case 3: 
      return CoreUtil.compare(attachment1.getAuthor().toString(), attachment2.getAuthor().toString());
    case 4: 
      return CoreUtil.compare(attachment1.getCreationDate(), attachment2.getCreationDate());
    case 5: 
      String key1 = AttachmentTableLabelProvider.getAttachmentId(attachment1);
      String key2 = AttachmentTableLabelProvider.getAttachmentId(attachment2);
      return keyComparator.compare2(key1, key2);
    }
    return super.compare(viewer, e1, e2, columnIndex);
  }
}

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

import org.eclipse.mylyn.commons.identity.core.spi.ProfileImage;
import org.eclipse.swt.widgets.Label;

class UserAttributeEditor$1$1
  implements Runnable
{
  UserAttributeEditor$1$1(UserAttributeEditor.1 param1, ProfileImage paramProfileImage) {}
  
  public void run()
  {
    if (!UserAttributeEditor.access$0(UserAttributeEditor.1.access$0(this$1)).isDisposed()) {
      UserAttributeEditor.1.access$0(this$1).updateImage(val$profileImage);
    }
  }
}

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

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.commons.ui.SelectionProviderAdapter;
import org.eclipse.mylyn.commons.workbench.forms.CommonFormUtil;
import org.eclipse.mylyn.internal.tasks.core.TaskComment;
import org.eclipse.mylyn.internal.tasks.ui.actions.CommentActionGroup;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorToolkit;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ImageHyperlink;
import org.eclipse.ui.forms.widgets.Section;

public class TaskEditorCommentPart
  extends AbstractTaskEditorPart
{
  private static final String ID_POPUP_MENU = "org.eclipse.mylyn.tasks.ui.editor.menu.comments";
  private static final int INDENT = -6;
  private static final String KEY_EDITOR = "viewer";
  private List<TaskAttribute> commentAttributes;
  private CommentGroupStrategy commentGroupStrategy;
  private List<CommentGroupViewer> commentGroupViewers;
  private boolean expandAllInProgress;
  private boolean hasIncoming;
  protected Section section;
  private SelectionProviderAdapter selectionProvider;
  private CommentViewer currentViewer;
  private Menu commentMenu;
  private CommentActionGroup actionGroup;
  private boolean suppressExpandViewers;
  
  private class CommentGroupViewer
  {
    private final CommentGroupStrategy.CommentGroup commentGroup;
    private ArrayList<TaskEditorCommentPart.CommentViewer> commentViewers;
    private Section groupSection;
    private boolean renderedInSubSection;
    
    public CommentGroupViewer(CommentGroupStrategy.CommentGroup commentGroup)
    {
      this.commentGroup = commentGroup;
    }
    
    private Composite createCommentViewers(Composite parent, FormToolkit toolkit)
    {
      List<TaskEditorCommentPart.CommentViewer> viewers = getCommentViewers();
      Composite composite = toolkit.createComposite(parent);
      
      GridLayout contentLayout = new GridLayout();
      marginHeight = 0;
      marginWidth = 0;
      composite.setLayout(contentLayout);
      for (TaskEditorCommentPart.CommentViewer commentViewer : viewers)
      {
        Control control = commentViewer.createControl(composite, toolkit);
        GridDataFactory.fillDefaults().grab(true, false).applyTo(control);
      }
      return composite;
    }
    
    private Control createControl(Composite parent, FormToolkit toolkit)
    {
      if (renderedInSubSection) {
        return createSection(parent, toolkit);
      }
      if (commentAttributes.size() >= 12)
      {
        final Canvas separator = new Canvas(parent, 0)
        {
          public Point computeSize(int wHint, int hHint, boolean changed)
          {
            return new Point(wHint == -1 ? 1 : wHint, 1);
          }
        };
        separator.addPaintListener(new PaintListener()
        {
          public void paintControl(PaintEvent e)
          {
            gc.setForeground(separator.getForeground());
            gc.drawLine(0, 0, separatorgetSizex, 0);
          }
        });
        separator.setForeground(toolkit.getColors().getColor("org.eclipse.ui.forms.TB_BORDER"));
        GridDataFactory.fillDefaults().grab(true, false).indent(-12, 0).applyTo(separator);
      }
      return createCommentViewers(parent, toolkit);
    }
    
    private Section createSection(Composite parent, final FormToolkit toolkit)
    {
      int style = 514;
      
      groupSection = toolkit.createSection(parent, style);
      groupSection.clientVerticalSpacing = 0;
      if (commentGroup.hasIncoming()) {
        groupSection.setBackground(getTaskEditorPage().getAttributeEditorToolkit().getColorIncoming());
      }
      groupSection.setForeground(toolkit.getColors().getColor("org.eclipse.ui.forms.TITLE"));
      groupSection.setText(commentGroup.getGroupName() + Messages.TaskEditorCommentPart_0 + 
        commentGroup.getCommentAttributes().size() + Messages.TaskEditorCommentPart_1);
      if (groupSection.isExpanded())
      {
        Composite composite = createCommentViewers(groupSection, toolkit);
        groupSection.setClient(composite);
      }
      else
      {
        groupSection.addExpansionListener(new ExpansionAdapter()
        {
          /* Error */
          public void expansionStateChanged(ExpansionEvent e)
          {
            // Byte code:
            //   0: aload_0
            //   1: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   4: invokestatic 86	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CommentGroupStrategy$CommentGroup;
            //   7: invokevirtual 84	org/eclipse/mylyn/internal/tasks/ui/editors/CommentGroupStrategy$CommentGroup:hasIncoming	()Z
            //   10: ifeq +50 -> 60
            //   13: aload_1
            //   14: invokevirtual 95	org/eclipse/ui/forms/events/ExpansionEvent:getState	()Z
            //   17: ifeq +17 -> 34
            //   20: aload_0
            //   21: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   24: invokestatic 88	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/ui/forms/widgets/Section;
            //   27: aconst_null
            //   28: invokevirtual 96	org/eclipse/ui/forms/widgets/Section:setBackground	(Lorg/eclipse/swt/graphics/Color;)V
            //   31: goto +29 -> 60
            //   34: aload_0
            //   35: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   38: invokestatic 88	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/ui/forms/widgets/Section;
            //   41: aload_0
            //   42: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   45: invokestatic 87	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$4	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart;
            //   48: invokevirtual 85	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart:getTaskEditorPage	()Lorg/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage;
            //   51: invokevirtual 92	org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage:getAttributeEditorToolkit	()Lorg/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkit;
            //   54: invokevirtual 93	org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkit:getColorIncoming	()Lorg/eclipse/swt/graphics/Color;
            //   57: invokevirtual 96	org/eclipse/ui/forms/widgets/Section:setBackground	(Lorg/eclipse/swt/graphics/Color;)V
            //   60: aload_0
            //   61: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   64: invokestatic 88	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/ui/forms/widgets/Section;
            //   67: invokevirtual 97	org/eclipse/ui/forms/widgets/Section:getClient	()Lorg/eclipse/swt/widgets/Control;
            //   70: ifnonnull +94 -> 164
            //   73: aload_0
            //   74: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   77: invokestatic 87	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$4	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart;
            //   80: invokevirtual 85	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart:getTaskEditorPage	()Lorg/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage;
            //   83: iconst_0
            //   84: invokevirtual 91	org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage:setReflow	(Z)V
            //   87: aload_0
            //   88: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   91: aload_0
            //   92: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   95: invokestatic 88	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/ui/forms/widgets/Section;
            //   98: aload_0
            //   99: getfield 83	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:val$toolkit	Lorg/eclipse/ui/forms/widgets/FormToolkit;
            //   102: invokestatic 89	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;Lorg/eclipse/swt/widgets/Composite;Lorg/eclipse/ui/forms/widgets/FormToolkit;)Lorg/eclipse/swt/widgets/Composite;
            //   105: astore_2
            //   106: aload_0
            //   107: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   110: invokestatic 88	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/ui/forms/widgets/Section;
            //   113: aload_2
            //   114: invokevirtual 98	org/eclipse/ui/forms/widgets/Section:setClient	(Lorg/eclipse/swt/widgets/Control;)V
            //   117: goto +20 -> 137
            //   120: astore_3
            //   121: aload_0
            //   122: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   125: invokestatic 87	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$4	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart;
            //   128: invokevirtual 85	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart:getTaskEditorPage	()Lorg/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage;
            //   131: iconst_1
            //   132: invokevirtual 91	org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage:setReflow	(Z)V
            //   135: aload_3
            //   136: athrow
            //   137: aload_0
            //   138: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   141: invokestatic 87	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$4	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart;
            //   144: invokevirtual 85	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart:getTaskEditorPage	()Lorg/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage;
            //   147: iconst_1
            //   148: invokevirtual 91	org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage:setReflow	(Z)V
            //   151: aload_0
            //   152: getfield 82	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer$3:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;
            //   155: invokestatic 87	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer:access$4	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart$CommentGroupViewer;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart;
            //   158: invokevirtual 85	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart:getTaskEditorPage	()Lorg/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage;
            //   161: invokevirtual 90	org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage:reflow	()V
            //   164: return
            // Line number table:
            //   Java source line #152	-> byte code offset #0
            //   Java source line #153	-> byte code offset #13
            //   Java source line #154	-> byte code offset #20
            //   Java source line #158	-> byte code offset #34
            //   Java source line #159	-> byte
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