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

e
{
  TaskListView$4$1(TaskListView.4 param4, Set paramSet) {}
  
  public void run()
  {
    for (TaskContainerDelta taskContainerDelta : val$deltas) {
      if (TaskListView.4.access$0(this$1).isScheduledPresentation()) {
        TaskListView.access$1(TaskListView.4.access$0(this$1)).refresh();
      } else {
        switch (taskContainerDelta.getKind())
        {
        case ROOT: 
          TaskListView.access$1(TaskListView.4.access$0(this$1)).refresh();
          break;
        case ADDED: 
        case CONTENT: 
          if (isFilteredContainer(taskContainerDelta))
          {
            TaskListView.access$1(TaskListView.4.access$0(this$1)).refresh();
          }
          else
          {
            if (taskContainerDelta.getElement() != null) {
              TaskListView.access$1(TaskListView.4.access$0(this$1)).refreshElement(taskContainerDelta.getElement());
            }
            if (taskContainerDelta.getParent() != null) {
              TaskListView.access$1(TaskListView.4.access$0(this$1)).refreshElement(taskContainerDelta.getParent());
            } else {
              TaskListView.access$1(TaskListView.4.access$0(this$1)).refresh();
            }
          }
          break;
        case DELETED: 
          TaskListView.access$1(TaskListView.4.access$0(this$1)).refreshElement(taskContainerDelta.getElement());
        }
      }
    }
  }
  
  private boolean isFilteredContainer(TaskContainerDelta taskContainerDelta)
  {
    ITaskContainer parent = taskContainerDelta.getParent();
    
    return ((parent instanceof UnsubmittedTaskContainer)) || ((parent instanceof UnmatchedTaskContainer)) || ((parent instanceof UncategorizedTaskContainer));
  }
}

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

import org.eclipse.mylyn.internal.tasks.core.DateRange;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;

public class TaskScheduleContentProvider$Incoming
  extends TaskScheduleContentProvider.StateTaskContainer
{
  public TaskScheduleContentProvider$Incoming(TaskScheduleContentProvider paramTaskScheduleContentProvider)
  {
    super(paramTaskScheduleContentProvider, new DateRange(TaskScheduleContentProvider.access$3(paramTaskScheduleContentProvider)), Messages.TaskScheduleContentProvider_Incoming);
  }
  
  protected boolean select(ITask task)
  {
    ITask.SynchronizationState state = task.getSynchronizationState();
    
    return (state == ITask.SynchronizationState.INCOMING_NEW) || ((state == ITask.SynchronizationState.INCOMING) && (!Boolean.parseBoolean(task.getAttribute("task.common.suppress.incoming"))));
  }
}

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

import org.eclipse.mylyn.internal.tasks.core.AbstractTask;

class TaskListFilteredTree$11$1
  implements Runnable
{
  TaskListFilteredTree$11$1(TaskListFilteredTree.11 param11, AbstractTask paramAbstractTask) {}
  
  public void run()
  {
    TaskListFilteredTree.11.access$0(this$1).indicateActiveTask(val$changedTask);
  }
}

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

import java.text.Collator;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.DateRange;
import org.eclipse.mylyn.internal.tasks.core.ITaskRepositoryElement;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.TaskGroup;
import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnsubmittedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.util.TaskComparator;
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.ui.IMemento;

public class TaskListSorter
  extends ViewerSorter
{
  private static final String MEMENTO_KEY_SORTER = "sorter";
  private static final String MEMENTO_KEY_GROUP_BY = "groupBy";
  private static final GroupBy DEFAULT_GROUP_BY = GroupBy.NONE;
  private final TaskComparator taskComparator;
  private GroupBy groupBy;
  private final SortElement key1;
  private final SortElement key2;
  
  public static enum GroupBy
  {
    NONE,  CATEGORY_QUERY,  CATEGORY_REPOSITORY;
    
    public String getLabel()
    {
      switch (this)
      {
      case CATEGORY_QUERY: 
        return Messages.TaskListSorter_No_Grouping;
      case CATEGORY_REPOSITORY: 
        return Messages.TaskListSorter_Catagory_and_Query;
      case NONE: 
        return Messages.TaskListSorter_Catagory_and_Repository;
      }
      return null;
    }
    
    public static GroupBy valueOfLabel(String label)
    {
      GroupBy[] arrayOfGroupBy;
      int j = (arrayOfGroupBy = values()).length;
      for (int i = 0; i < j; i++)
      {
        GroupBy value = arrayOfGroupBy[i];
        if (value.getLabel().equals(label)) {
          return value;
        }
      }
      return null;
    }
  }
  
  private class SortElement
  {
    private int weight;
    private final String[] values = new String[3];
    
    private SortElement() {}
  }
  
  public TaskListSorter()
  {
    taskComparator = new TaskComparator();
    groupBy = GroupBy.CATEGORY_QUERY;
    key1 = new SortElement(null);
    key2 = new SortElement(null);
  }
  
  public int compare(Viewer compareViewer, Object o1, Object o2)
  {
    if (((o1 instanceof AbstractTask)) && ((o2 instanceof AbstractTask)))
    {
      ITask element1 = (ITask)o1;
      ITask element2 = (ITask)o2;
      return compareElements(element1, element2);
    }
    if (((o1 instanceof ScheduledTaskContainer)) && ((o2 instanceof ScheduledTaskContainer)))
    {
      ScheduledTaskContainer dateRangeTaskContainer1 = (ScheduledTaskContainer)o1;
      ScheduledTaskContainer dateRangeTaskContainer2 = (ScheduledTaskContainer)o2;
      return dateRangeTaskContainer1.getDateRange().compareTo(dateRangeTaskContainer2.getDateRange());
    }
    updateKey(key1, o1);
    updateKey(key2, o2);
    if (key1.weight != key2.weight) {
      return key1.weight - key2.weight < 0 ? -1 : 1;
    }
    int result = compare(key1.values[0], key2.values[0]);
    if (result != 0) {
      return result;
    }
    result = compare(key1.values[1], key2.values[1]);
    return result != 0 ? result : compare(key1.values[2], key2.values[2]);
  }
  
  private int compare(String key1, String key2)
  {
    if (key1 == null) {
      return key2 != null ? 1 : 0;
    }
    if (key2 == null) {
      return -1;
    }
    return Collator.getInstance().compare(key1, key2);
  }
  
  private void updateKey(SortElement key, Object object)
  {
    int weight;
    int weight;
    if ((object instanceof AbstractTask))
    {
      weight = 0;
    }
    else
    {
      int weight;
      if ((object instanceof UncategorizedTaskContainer))
      {
        weight = 1;
      }
      else
      {
        int weight;
        if ((object instanceof UnsubmittedTaskContainer))
        {
          weight = 2;
        }
        else
        {
          int weight;
          if ((object instanceof TaskCategory))
          {
            weight = 3;
          }
          else
          {
            int weight;
            if ((object instanceof RepositoryQuery))
            {
              weight = 4;
            }
            else
            {
              int weight;
              if ((object instanceof TaskGroup))
              {
                weight = 5;
              }
              else
              {
                int weight;
                if ((object instanceof UnmatchedTaskContainer)) {
                  weight = 6;
                } else {
                  weight = 99;
                }
              }
            }
          }
        }
      }
    }
    values[0] = ((AbstractTaskContainer)object).getSummary();
    values[1] = null;
    values[2] = null;
    switch (groupBy)
    {
    case CATEGORY_QUERY: 
      weight = 1;
      break;
    case CATEGORY_REPOSITORY: 
      break;
    case NONE: 
      if (weight != 1) {
        if (weight == 3)
        {
          weight = 2;
        }
        else
        {
          values[0] = getRepositoryUrl(object);
          values[1] = weight;
          values[2] = ((AbstractTaskContainer)object).getSummary();
          weight = 3;
        }
      }
      break;
    }
    weight = weight;
  }
  
  private String getRepositoryUrl(Object object)
  {
    if ((object instanceof ITaskRepositoryElement))
    {
      ITaskRepositoryElement repositoryElement = (ITaskRepositoryElement)object;
      String repositoryUrl = repositoryElement.getRepositoryUrl();
      TaskRepository taskRepository = TasksUi.getRepositoryManager().getRepository(
        repositoryElement.getConnectorKind(), repositoryUrl);
      return taskRepository != null ? taskRepository.getRepositoryLabel() : null;
    }
    return null;
  }
  
  private int compareElements(ITask element1, ITask element2)
  {
    return taskComparator.compare(element1, element2);
  }
  
  public TaskComparator getComparator()
  {
    return taskComparator;
  }
  
  public GroupBy getGroupBy()
  {
    return groupBy;
  }
  
  public void setGroupBy(GroupBy sortByIndex)
  {
    Assert.isNotNull(sortByIndex);
    groupBy = sortByIndex;
  }
  
  public void restoreState(IMemento memento)
  {
    IMemento child = memento.getChild("sorter");
    if (child != null) {
      getComparator().restoreState(child);
    }
    setGroupBy(getGroupBy(memento, "groupBy", DEFAULT_GROUP_BY));
  }
  
  public void saveState(IMemento memento)
  {
    IMemento child = memento.createChild("sorter");
    if (child != null) {
      getComparator().saveState(child);
    }
    memento.putString("groupBy", getGroupBy().name());
  }
  
  private GroupBy getGroupBy(IMemento memento, String key, GroupBy defaultValue)
  {
    String value = memento.getString(key);
    if (value != null) {
      try
      {
        return GroupBy.valueOf(value);
      }
      catch (IllegalArgumentException localIllegalArgumentException) {}
    }
    return defaultValue;
  }
}

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

import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TaskKeyComparator
  implements Comparator<String[]>
{
  private static final String MODULE_TASK_PATTERN = "(?:([A-Za-z]*[:_\\-]?)(\\d+))?";
  private static final Pattern ID_PATTERN = Pattern.compile("(?:([A-Za-z]*[:_\\-]?)(\\d+))?");
  public static final Pattern PATTERN = Pattern.compile("(?:([A-Za-z]*[:_\\-]?)(\\d+))?(.*)");
  
  public int compare2(String o1, String o2)
  {
    String[] a1 = split(o1);
    String[] a2 = split(o2);
    return compare(a1, a2);
  }
  
  public int compare(String[] a1, String[] a2)
  {
    if ((a1[0] == null) && (a1[1] == null))
    {
      a1 = split(a1[2]);
    }
    else if (((a1[0] == null) || (a1[0].length() == 0)) && (a1[1] != null) && (a1[1].length() > 0))
    {
      String[] b1 = splitTask(a1[1]);
      a1[0] = b1[0];
      a1[1] = b1[1];
    }
    if ((a2[0] == null) && (a2[1] == null))
    {
      a2 = split(a2[2]);
    }
    else if (((a2[0] == null) || (a2[0].length() == 0)) && (a2[1] != null) && (a2[1].length() > 0))
    {
      String[] b2 = splitTask(a2[1]);
      a2[0] = b2[0];
      a2[1] = b2[1];
    }
    return compare(a1[0], a1[1], a1[2], a2[0], a2[1], a2[2]);
  }
  
  private static int compare(String component1, String key1, String value1, String component2, String key2, String value2)
  {
    if ((component1 == null) && (component2 != null)) {
      return -1;
    }
    if ((component1 != null) && (component2 == null)) {
      return 1;
    }
    if ((component1 != null) && (component2 != null))
    {
      int n = component1.compareToIgnoreCase(component2);
      if (n != 0) {
        return n;
      }
      if ((key1 == null) && (key2 != null)) {
        return -1;
      }
      if ((key1 != null) && (key2 == null)) {
        return 1;
      }
      if ((key1 != null) && (key2 != null))
      {
        if ((key1.length() == key2.length()) || (key1.length() == 0) || (key2.length() == 0)) {
          n = key1.compareTo(key2);
        } else {
          try
          {
            n = Long.valueOf(key1).compareTo(Long.valueOf(key2));
          }
          catch (NumberFormatException localNumberFormatException)
          {
            n = key1.compareTo(key2);
          }
        }
        if (n != 0) {
          return n;
        }
      }
    }
    return value1.compareToIgnoreCase(value2);
  }
  
  public String[] split(String s)
  {
    Matcher matcher = PATTERN.matcher(s);
    if (!matcher.find()) {
      return new String[] { 0, 0, s };
    }
    int n = matcher.groupCount();
    String[] res = new String[n];
    for (int i = 1; i < n + 1; i++) {
      res[(i - 1)] = matcher.group(i);
    }
    return res;
  }
  
  private static String[] splitTask(String s)
  {
    Matcher matcher = ID_PATTERN.matcher(s);
    if (!matcher.find()) {
      return new String[] { 0, s };
    }
    int n = matcher.groupCount();
    String[] res = new String[n];
    for (int i = 1; i < n + 1; i++) {
      res[(i - 1)] = matcher.group(i);
    }
    return res;
  }
}

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

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class TaskListView$10
  implements Listener
{
  TaskListView$10(TaskListView paramTaskListView) {}
  
  public void handleEvent(Event event)
  {
    TaskListView.access$14(this$0, System.currentTimeMillis());
  }
}

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

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.internal.tasks.core.Category;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;

public class TaskRepositoriesViewSorter
  extends TaskRepositoriesSorter
{
  public int compare(Viewer viewer, Object e1, Object e2)
  {
    if (((e1 instanceof Category)) && ((e2 instanceof Category))) {
      return ((Category)e1).compareTo(e2);
    }
    if (((e1 instanceof Category)) && ((e2 instanceof TaskRepository)))
    {
      Category cat1 = (Category)e1;
      
      String categoryId = ((TaskRepository)e2).getProperty("category");
      Category cat2 = ((TaskRepositoryManager)TasksUi.getRepositoryManager()).getCategory(categoryId);
      
      return cat1.compareTo(cat2);
    }
    if (((e1 instanceof TaskRepository)) && ((e2 instanceof Category)))
    {
      Category cat1 = (Category)e2;
      
      String categoryId = ((TaskRepository)e1).getProperty("category");
      Category cat2 = ((TaskRepositoryManager)TasksUi.getRepositoryManager()).getCategory(categoryId);
      int result = cat2.compareTo(cat1);
      if (result == 0) {
        result = 1;
      }
      return result;
    }
    if (((e1 instanceof TaskRepository)) && ((e2 instanceof TaskRepository)))
    {
      String categoryId = ((TaskRepository)e1).getProperty("category");
      Category cat1 = ((TaskRepositoryManager)TasksUi.getRepositoryManager()).getCategory(categoryId);
      
      String categoryId2 = ((TaskRepository)e2).getProperty("category");
      Category cat2 = ((TaskRepositoryManager)TasksUi.getRepositoryManager()).getCategory(categoryId2);
      
      int result = cat1.compareTo(cat2);
      if (result == 0) {
        return super.compare(viewer, e1, e2);
      }
      return result;
    }
    return super.compare(viewer, e1, e2);
  }
}

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

import org.eclipse.mylyn.internal.tasks.core.DateRange;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;

public class TaskScheduleContentProvider$Outgoing
  extends TaskScheduleContentProvider.StateTaskContainer
{
  public TaskScheduleContentProvider$Outgoing(TaskScheduleContentProvider paramTaskScheduleContentProvider)
  {
    super(paramTaskScheduleContentProvider, new DateRange(TaskScheduleContentProvider.access$4(paramTaskScheduleContentProvider)), Messages.TaskScheduleContentProvider_Outgoing);
  }
  
  public boolean select(ITask task)
  {
    ITask.SynchronizationState state = task.getSynchronizationState();
    
    return (state == ITask.SynchronizationState.OUTGOING) || (state == ITask.SynchronizationState.OUTGOING_NEW) || (state == ITask.SynchronizationState.CONFLICT);
  }
}

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

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion;
import org.eclipse.mylyn.internal.tasks.ui.util.TaskComparator;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskListView$17
  extends SelectionAdapter
{
  TaskListView$17(TaskListView paramTaskListView) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    SortCriterion criterion = TaskListView.access$18(this$0).getComparator().getSortCriterion(0);
    criterion.setDirection(criterion.getDirection() * -1);
    this$0.getViewer().refresh(false);
  }
}

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

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;

class TaskListView$23
  implements IDoubleClickListener
{
  TaskListView$23(TaskListView paramTaskListView) {}
  
  public void doubleClick(DoubleClickEvent event)
  {
    if (TasksUiPlugin.getDefault().getPreferenceStore().getBoolean("org.eclipse.mylyn.tasks.ui.activate.when.opened"))
    {
      AbstractTask selectedTask = this$0.getSelectedTask();
      if ((selectedTask != null) && (!selectedTask.isActive())) {
        TasksUiInternal.activateTaskThroughCommand(selectedTask);
      }
    }
  }
}

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

import java.util.Set;
import org.eclipse.mylyn.commons.workbench.DelayedRefreshJob;
import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta;
import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnsubmittedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskListChangeAdapter;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

class TaskListView$4
  extends TaskListChangeAdapter
{
  TaskListView$4(TaskListView paramTaskListView) {}
  
  public void containersChanged(final Set<TaskContainerDelta> deltas)
  {
    PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
    {
      public void run()
      {
        for (TaskContainerDelta taskContainerDelta : deltas) {
          if (this$0.isScheduledPresentation()) {
            TaskListView.access$1(this$0).refresh();
          } else {
            switch (taskContainerDelta.getKind())
            {
            case ROOT: 
              TaskListView.access$1(this$0).refresh();
              break;
            case ADDED: 
            case CONTENT: 
              if (isFilteredContainer(taskContainerDelta))
              {
                TaskListView.access$1(this$0).refresh();
              }
              else
              {
                if (taskContainerDelta.getElement() != null) {
                  TaskListView.access$1(this$0).refreshElement(taskContainerDelta.getElement());
                }
                if (taskContainerDelta.getParent() != null) {
                  TaskListView.access$1(this$0).refreshElement(taskContainerDelta.getParent());
                } else {
                  TaskListView.access$1(this$0).refresh();
                }
              }
              break;
            case DELETED: 
              TaskListView.access$1(this$0).refreshElement(taskContainerDelta.getElement());
            }
          }
        }
      }
      
      private boolean isFilteredContainer(TaskContainerDelta taskContainerDelta)
      {
        ITaskContainer parent = taskContainerDelta.getParent();
        
        return ((parent instanceof UnsubmittedTaskContainer)) || ((parent instanceof UnmatchedTaskContainer)) || ((parent instanceof UncategorizedTaskContainer));
      }
    });
  }
}

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

import org.eclipse.mylyn.commons.workbench.AdaptiveRefreshPolicy;
import org.eclipse.mylyn.internal.tasks.ui.search.AbstractSearchHandler.IFilterChangeListener;

class TaskListFilteredTree$6
  implements AbstractSearchHandler.IFilterChangeListener
{
  TaskListFilteredTree$6(TaskListFilteredTree paramTaskListFilteredTree) {}
  
  public void filterChanged()
  {
    this$0.getRefreshPolicy().filterChanged();
  }
}

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

class TaskRepositoriesView$1$1
  implements Runnable
{
  TaskRepositoriesView$1$1(TaskRepositoriesView.1 param1) {}
  
  public void run()
  {
    TaskRepositoriesView.1.access$0(this$1).refresh();
  }
}

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

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.commons.repositories.core.RepositoryCategory;
import org.eclipse.mylyn.internal.tasks.core.IRepositoryChangeListener;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryAdapter;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryChangeEvent;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta.Type;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;

public class TaskRepositoriesNavigatorContentProvider
  implements ITreeContentProvider
{
  private static final Object[] EMPTY_ARRAY = new Object[0];
  private final TaskRepositoryManager manager;
  private Viewer viewer;
  private Listener listener;
  
  private class Listener
    extends TaskRepositoryAdapter
    implements IRepositoryChangeListener
  {
    private Listener() {}
    
    public void repositoryAdded(TaskRepository repository)
    {
      refresh(repository);
    }
    
    protected void refresh(TaskRepository repository)
    {
      if (viewer != null) {
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            if ((viewer != null) && (viewer.getControl() != null) && (!viewer.getControl().isDisposed())) {
              viewer.refresh();
            }
          }
        });
      }
    }
    
    public void repositoryRemoved(TaskRepository repository)
    {
      refresh(repository);
    }
    
    public void repositoryUrlChanged(TaskRepository repository, String oldUrl)
    {
      refresh(repository);
    }
    
    public void repositoryChanged(TaskRepositoryChangeEvent event)
    {
      TaskRepositoryDelta.Type type = event.getDelta().getType();
      if ((type == TaskRepositoryDelta.Type.ALL) || (type == TaskRepositoryDelta.Type.PROPERTY) || 
        (type == TaskRepositoryDelta.Type.OFFLINE)) {
        refresh(event.getRepository());
      }
    }
  }
  
  public TaskRepositoriesNavigatorContentProvider()
  {
    manager = ((TaskRepositoryManager)TasksUi.getRepositoryManager());
  }
  
  public void dispose()
  {
    if (listener != null)
    {
      manager.removeListener(listener);
      listener = null;
    }
  }
  
  public Object[] getChildren(Object parentElement)
  {
    if ((parentElement instanceof RepositoryCategory))
    {
      List<TaskRepository> repositories = TasksUi.getRepositoryManager().getAllRepositories();
      RepositoryCategory category = (RepositoryCategory)parentElement;
      if ("org.eclipse.mylyn.category.all".equals(category.getId())) {
        return repositories.toArray();
      }
      if ("org.eclipse.mylyn.category.other".equals(category.getId()))
      {
        Set<Object> items = new HashSet();
        for (TaskRepository repository : repositories) {
          if (repository.getProperty("category") == null) {
            items.add(repository);
          }
        }
        return items.toArray();
      }
      Set<Object> items = new HashSet();
      for (TaskRepository repository : repositories) {
        if (category.getId().equals(repository.getProperty("category"))) {
          items.add(repository);
        }
      }
      return items.toArray();
    }
    return EMPTY_ARRAY;
  }
  
  public Object[] getElements(Object inputElement)
  {
    return getChildren(inputElement);
  }
  
  public Object getParent(Object element)
  {
    return null;
  }
  
  public boolean hasChildren(Object element)
  {
    return getChildren(element).length > 0;
  }
  
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
  {
    if (listener != null)
    {
      manager.removeListener(listener);
      listener = null;
    }
    this.viewer = viewer;
    if (newInput != null)
    {
      listener = new Listener(null);
      manager.addListener(listener);
    }
  }
}

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

import org.eclipse.mylyn.internal.tasks.ui.actions.TaskWorkingSetAction;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;

class TaskListFilteredTree$10
  extends MouseAdapter
{
  TaskListFilteredTree$10(TaskListFilteredTree paramTaskListFilteredTree, TaskWorkingSetAction paramTaskWorkingSetAction) {}
  
  public void mouseDown(MouseEvent e)
  {
    if (TaskListFilteredTree.access$13(this$0) != null) {
      val$workingSetAction.run(TaskListFilteredTree.access$13(this$0));
    } else {
      val$workingSetAction.run();
    }
  }
}

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

import org.eclipse.jface.viewers.TreeExpansionEvent;
import org.eclipse.jface.viewers.TreeViewer;

class TaskListView$13$2
  implements Runnable
{
  TaskListView$13$2(TaskListView.13 param13, TreeExpansionEvent paramTreeExpansionEvent) {}
  
  public void run()
  {
    TaskListView.13.access$0(this$1).getViewer().refresh(val$event.getElement());
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;

public class TaskListContentProvider
  extends AbstractTaskListContentProvider
{
  protected static Object[] EMPTY_ARRRY = new Object[0];
  
  public TaskListContentProvider(TaskListView taskListView)
  {
    super(taskListView);
  }
  
  public void inputChanged(Viewer v, Object oldInput, Object newInput)
  {
    taskListView.expandToActiveTasks();
  }
  
  public void dispose() {}
  
  public Object[] getElements(Object parent)
  {
    if (parent.equals(taskListView.getViewSite())) {
      return applyFilter(TasksUiPlugin.getTaskList().getRootElements()).toArray();
    }
    return getChildren(parent);
  }
  
  public Object getParent(Object child)
  {
    if ((child instanceof ITask))
    {
      ITask task = (ITask)child;
      AbstractTaskCategory parent = TaskCategory.getParentTaskCategory(task);
      if (parent != null) {
        return parent;
      }
      Set<AbstractTaskContainer> parents = ((AbstractTask)task).getParentContainers();
      Iterator<AbstractTaskContainer> it = parents.iterator();
      if (it.hasNext()) {
        return parents.iterator().next();
      }
    }
    return null;
  }
  
  public Object[] getChildren(Object parent)
  {
    return getFilteredChildrenFor(parent).toArray();
  }
  
  public boolean hasChildren(Object parent)
  {
    Object[] children = getChildren(parent);
    return (children != null) && (children.length > 0);
  }
  
  protected List<AbstractTaskContainer> applyFilter(Set<AbstractTaskContainer> roots)
  {
    List<AbstractTaskContainer> filteredRoots = new ArrayList();
    for (AbstractTaskContainer element : roots) {
      if (selectContainer(element)) {
        filteredRoots.add(element);
      }
    }
    return filteredRoots;
  }
  
  private boolean containsNoFilterText(String filterText)
  {
    return (filterText == null) || (filterText.trim().length() == 0);
  }
  
  private boolean selectContainer(ITaskContainer container)
  {
    if (filter(null, container)) {
      return false;
    }
    return true;
  }
  
  protected List<IRepositoryElement> getFilteredChildrenFor(Object parent)
  {
    if (containsNoFilterText(taskListView.getFilteredTree().getFilterString()))
    {
      List<IRepositoryElement> children = new ArrayList();
      if ((parent instanceof ITask))
      {
        Collection<ITask> subTasks = ((AbstractTask)parent).getChildren();
        for (ITask task : subTasks) {
          if (!filter(parent, task)) {
            children.add(task);
          }
        }
        return children;
      }
      if ((parent instanceof ITaskContainer)) {
        return getFilteredRootChildren((ITaskContainer)parent);
      }
    }
    else
    {
      List<IRepositoryElement> children = new ArrayList();
      if ((parent instanceof ITaskContainer))
      {
        children.addAll(((ITaskContainer)parent).getChildren());
        return children;
      }
    }
    return Collections.emptyList();
  }
  
  private List<IRepositoryElement> getFilteredRootChildren(ITaskContainer parent)
  {
    List<IRepositoryElement> result = new ArrayList();
    Set<IRepositoryElement> parents;
    if (TasksUiPlugin.getDefault().groupSubtasks(parent))
    {
      Collection<ITask> parentTasks = parent.getChildren();
      parents = new HashSet();
      Set<ITask> children = new HashSet();
      for (ITask element : parentTasks) {
        if ((element instanceof ITaskContainer)) {
          for (ITask abstractTask : ((ITaskContainer)element).getChildren()) {
            children.add(abstractTask);
          }
        }
      }
      for (ITask task : parentTasks) {
        if ((!filter(parent, task)) && (!children.contains(task))) {
          parents.add(task);
        }
      }
      result.addAll(parents);
    }
    else
    {
      for (IRepositoryElement element : parent.getChildren()) {
        if (!filter(parent, element)) {
          result.add(element);
        }
      }
    }
    return result;
  }
  
  protected boolean filter(Object parent, Object object)
  {
    boolean notSearching = containsNoFilterText(taskListView.getFilteredTree().getFilterString());
    for (AbstractTaskListFilter filter : taskListView.getFilters()) {
      if (((notSearching) || (filter.applyToFilteredText())) && 
        (!filter.select(parent, object))) {
        return true;
      }
    }
    return false;
  }
  
  protected boolean filter(TreePath path, Object parent, Object object)
  {
    boolean emptyFilterText = containsNoFilterText(taskListView.getFilteredTree().getFilterString());
    for (AbstractTaskListFilter filter : taskListView.getFilters()) {
      if ((emptyFilterText) || (filter.applyToFilteredText())) {
        if ((filter instanceof TaskListInterestFilter))
        {
          if (!((TaskListInterestFilter)filter).select(path.getLastSegment(), object)) {
            return true;
          }
        }
        else if (!filter.select(parent, object)) {
          return true;
        }
      }
    }
    return false;
  }
  
  public boolean isSearching()
  {
    return !containsNoFilterText(taskListView.getFilteredTree().getFilterString());
  }
  
  public Object[] getChildren(TreePath parentPath)
  {
    Object parent = parentPath.getLastSegment();
    if (PresentationFilter.getInstance().isFilterNonMatching())
    {
      ITaskContainer container = (ITaskContainer)parentPath.getFirstSegment();
      if (((container instanceof IRepositoryQuery)) || ((container instanceof UnmatchedTaskContainer)))
      {
        if (((parent instanceof ITask)) && 
          ((container instanceof RepositoryQuery)) && (!TasksUiPlugin.getDefault().groupSubtasks(container))) {
          return EMPTY_ARRRY;
        }
        List<IRepositoryElement> children = getFilteredChildrenFor(parent);
        if ((!isSearching()) && 
          ((parent instanceof ITask))) {
          for (Iterator<IRepositoryElement> it = children.iterator(); it.hasNext();)
          {
            IRepositoryElement element = (IRepositoryElement)it.next();
            if (!container.getChildren().contains(element)) {
              it.remove();
            }
          }
        }
        return children.toArray();
      }
    }
    return getFilteredChildrenFor(parent).toArray();
  }
  
  public boolean hasChildren(TreePath path)
  {
    return getChildren(path).length > 0;
  }
  
  public TreePath[] getParents(Object element)
  {
    return new TreePath[0];
  }
}

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

import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.ITreePathContentProvider;

public abstract class AbstractTaskListContentProvider
  implements ITreeContentProvider, ITreePathContentProvider
{
  protected TaskListView taskListView;
  
  public AbstractTaskListContentProvider(TaskListView view)
  {
    taskListView = view;
  }
}

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

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.DateRange;
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TaskComparator;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;

public class TaskListInterestSorter
  extends ViewerSorter
{
  private final TaskKeyComparator taskKeyComparator = new TaskKeyComparator();
  
  public int compare(Viewer compareViewer, Object o1, Object o2)
  {
    if (((o1 instanceof ITaskContainer)) && ((o2 instanceof UnmatchedTaskContainer))) {
      return -1;
    }
    if (((o2 instanceof ITaskContainer)) && ((o1 instanceof UnmatchedTaskContainer))) {
      return 1;
    }
    if (((o1 instanceof ScheduledTaskContainer)) && ((o2 instanceof ScheduledTaskContainer)))
    {
      ScheduledTaskContainer dateRangeTaskContainer1 = (ScheduledTaskContainer)o1;
      ScheduledTaskContainer dateRangeTaskContainer2 = (ScheduledTaskContainer)o2;
      return dateRangeTaskContainer1.getDateRange().compareTo(dateRangeTaskContainer2.getDateRange());
    }
    if (((o1 instanceof ITaskContainer)) && ((o2 instanceof ScheduledTaskContainer))) {
      return -1;
    }
    if (((o1 instanceof ScheduledTaskContainer)) && ((o2 instanceof ITaskContainer))) {
      return 1;
    }
    if (((o1 instanceof UncategorizedTaskContainer)) && ((o2 instanceof ITaskContainer))) {
      return -1;
    }
    if (((o1 instanceof ITaskContainer)) && ((o2 instance
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