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

ository(query.getConnectorKind(), 
        query.getRepositoryUrl());
    }
    if ((taskRepository != null) && (isUserManaged(taskRepository))) {
      return taskRepository;
    }
    return null;
  }
  
  protected boolean isUserManaged(TaskRepository taskRepository)
  {
    AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
      taskRepository.getConnectorKind());
    return (connector != null) && (connector.isUserManaged());
  }
  
  protected boolean isSingleSelect()
  {
    return singleSelect;
  }
  
  protected void setSingleSelect(boolean singleSelect)
  {
    this.singleSelect = singleSelect;
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;

public class FilterCompletedTasksAction
  extends Action
{
  public static final String ID = "org.eclipse.mylyn.tasklist.actions.filter.completed";
  private final TaskListView view;
  
  public FilterCompletedTasksAction(TaskListView view)
  {
    this.view = view;
    setText(Messages.FilterCompletedTasksAction_Filter_Completed_Tasks);
    setToolTipText(Messages.FilterCompletedTasksAction_Filter_Completed_Tasks);
    setId("org.eclipse.mylyn.tasklist.actions.filter.completed");
    setImageDescriptor(CommonImages.FILTER_COMPLETE);
    setChecked(TasksUiPlugin.getDefault()
      .getPreferenceStore()
      .contains("org.eclipse.mylyn.tasks.ui.filters.complete"));
  }
  
  public void run()
  {
    TasksUiPlugin.getDefault().getPreferenceStore().setValue("org.eclipse.mylyn.tasks.ui.filters.complete", isChecked());
    if (isChecked()) {
      view.addFilter(view.getCompleteFilter());
    } else {
      view.removeFilter(view.getCompleteFilter());
    }
    view.refresh();
  }
}

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

import org.eclipse.mylyn.internal.tasks.ui.search.SearchUtil;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

class TaskSelectionDialog$3
  extends HyperlinkAdapter
{
  TaskSelectionDialog$3(TaskSelectionDialog paramTaskSelectionDialog) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    this$0.getShell().close();
    SearchUtil.openSearchDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;

public class SynchronizeAutomaticallyAction
  extends Action
{
  public static final String ID = "org.eclipse.mylyn.tasks.ui.actions.synchronize.background";
  
  public SynchronizeAutomaticallyAction()
  {
    setText(Messages.SynchronizeAutomaticallyAction_Synchronize_Automatically);
    setToolTipText(Messages.SynchronizeAutomaticallyAction_Synchronize_Automatically);
    setId("org.eclipse.mylyn.tasks.ui.actions.synchronize.background");
    setChecked(TasksUiPlugin.getDefault()
      .getPreferenceStore()
      .getBoolean("org.eclipse.mylyn.tasks.ui.repositories.synch.schedule"));
  }
  
  public void run()
  {
    TasksUiPlugin.getDefault().getPreferenceStore().setValue("org.eclipse.mylyn.tasks.ui.repositories.synch.schedule", isChecked());
  }
}

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

import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.commons.core.ICoreRunnable;
import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.ui.TaskRepositoryUtil;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.TaskRepository;

class DeleteTaskRepositoryAction$1
  implements ICoreRunnable
{
  DeleteTaskRepositoryAction$1(List paramList1, List paramList2, TaskRepository paramTaskRepository) {}
  
  /* Error */
  public void run(IProgressMonitor monitor)
    throws CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: getstatic 64	org/eclipse/mylyn/internal/tasks/ui/actions/Messages:DeleteTaskRepositoryAction_Delete_Repository_In_Progress	Ljava/lang/String;
    //   4: iconst_m1
    //   5: invokeinterface 71 3 0
    //   10: aload_0
    //   11: getfield 62	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1:val$tasksToDelete	Ljava/util/List;
    //   14: invokestatic 68	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction:prepareDeletion	(Ljava/util/Collection;)V
    //   17: aload_0
    //   18: getfield 61	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1:val$queriesToDelete	Ljava/util/List;
    //   21: invokestatic 68	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction:prepareDeletion	(Ljava/util/Collection;)V
    //   24: invokestatic 67	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getTaskList	()Lorg/eclipse/mylyn/internal/tasks/core/TaskList;
    //   27: new 34	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1$1
    //   30: dup
    //   31: aload_0
    //   32: aload_0
    //   33: getfield 62	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1:val$tasksToDelete	Ljava/util/List;
    //   36: aload_0
    //   37: getfield 61	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1:val$queriesToDelete	Ljava/util/List;
    //   40: aload_0
    //   41: getfield 63	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1:val$repositoryToDelete	Lorg/eclipse/mylyn/tasks/core/TaskRepository;
    //   44: invokespecial 69	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1$1:<init>	(Lorg/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction$1;Ljava/util/List;Ljava/util/List;Lorg/eclipse/mylyn/tasks/core/TaskRepository;)V
    //   47: aload_1
    //   48: invokevirtual 66	org/eclipse/mylyn/internal/tasks/core/TaskList:run	(Lorg/eclipse/mylyn/internal/tasks/core/ITaskListRunnable;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   51: goto +12 -> 63
    //   54: astore_2
    //   55: aload_1
    //   56: invokeinterface 70 1 0
    //   61: aload_2
    //   62: athrow
    //   63: aload_1
    //   64: invokeinterface 70 1 0
    //   69: return
    // Line number table:
    //   Java source line #129	-> byte code offset #0
    //   Java source line #130	-> byte code offset #4
    //   Java source line #129	-> byte code offset #5
    //   Java source line #131	-> byte code offset #10
    //   Java source line #132	-> byte code offset #17
    //   Java source line #133	-> byte code offset #24
    //   Java source line #144	-> byte code offset #47
    //   Java source line #133	-> byte code offset #48
    //   Java source line #145	-> byte code offset #54
    //   Java source line #146	-> byte code offset #55
    //   Java source line #147	-> byte code offset #61
    //   Java source line #146	-> byte code offset #63
    //   Java source line #148	-> byte code offset #69
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	70	0	this	1
    //   0	70	1	monitor	IProgressMonitor
    //   54	8	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	54	54	finally
  }
}

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

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.internal.tasks.ui.dialogs.AbstractWorkingSetDialogCOPY;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.IWorkingSetEditWizard;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.WorkingSetComparator;
import org.eclipse.ui.internal.dialogs.WorkingSetFilter;
import org.eclipse.ui.internal.dialogs.WorkingSetLabelProvider;

public class TaskWorkingSetAction
  extends Action
  implements IMenuCreator
{
  public static final String LABEL_SETS_NONE = Messages.TaskWorkingSetAction_All;
  private Menu dropDownMenu;
  
  public TaskWorkingSetAction()
  {
    setText(Messages.TaskWorkingSetAction_Sets);
    setToolTipText(Messages.TaskWorkingSetAction_Select_and_Edit_Working_Sets);
    setImageDescriptor(TasksUiImages.TASK_WORKING_SET);
    setEnabled(true);
    setMenuCreator(this);
  }
  
  public void dispose()
  {
    if (dropDownMenu != null)
    {
      dropDownMenu.dispose();
      dropDownMenu = null;
    }
  }
  
  public Menu getMenu(Control parent)
  {
    if (dropDownMenu != null) {
      dropDownMenu.dispose();
    }
    dropDownMenu = new Menu(parent);
    addActionsToMenu();
    return dropDownMenu;
  }
  
  public Menu getMenu(Menu parent)
  {
    if (dropDownMenu != null) {
      dropDownMenu.dispose();
    }
    dropDownMenu = new Menu(parent);
    addActionsToMenu();
    return dropDownMenu;
  }
  
  private void addActionsToMenu()
  {
    IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
    if (doTaskWorkingSetsExist())
    {
      ActionContributionItem itemAll = new ActionContributionItem(new ToggleAllWorkingSetsAction());
      
      List<IWorkingSet> sortedWorkingSets = Arrays.asList(workingSets);
      Collections.sort(sortedWorkingSets, new WorkingSetComparator());
      
      Iterator<IWorkingSet> iter = sortedWorkingSets.iterator();
      while (iter.hasNext())
      {
        IWorkingSet workingSet = (IWorkingSet)iter.next();
        if ((workingSet != null) && 
          (workingSet.getId().equalsIgnoreCase(TaskWorkingSetUpdater.ID_TASK_WORKING_SET)))
        {
          ActionContributionItem itemSet = new ActionContributionItem(new ToggleWorkingSetAction(workingSet));
          itemSet.fill(dropDownMenu, -1);
        }
      }
      Separator separator = new Separator();
      separator.fill(dropDownMenu, -1);
      itemAll.fill(dropDownMenu, -1);
    }
    ActionContributionItem editItem = new ActionContributionItem(new ManageWorkingSetsAction());
    editItem.fill(dropDownMenu, -1);
  }
  
  private boolean doTaskWorkingSetsExist()
  {
    IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
    IWorkingSet[] arrayOfIWorkingSet1;
    int j = (arrayOfIWorkingSet1 = workingSets).length;
    for (int i = 0; i < j; i++)
    {
      IWorkingSet workingSet = arrayOfIWorkingSet1[i];
      if ((workingSet != null) && (workingSet.getId().equalsIgnoreCase(TaskWorkingSetUpdater.ID_TASK_WORKING_SET))) {
        return true;
      }
    }
    return false;
  }
  
  public void run()
  {
    String[] ids = new String[1];
    ids[0] = TaskWorkingSetUpdater.ID_TASK_WORKING_SET;
    ConfigureWindowWorkingSetsDialog dialog = new ConfigureWindowWorkingSetsDialog(PlatformUI.getWorkbench()
      .getActiveWorkbenchWindow(), ids);
    dialog.open();
  }
  
  public void run(IAction action)
  {
    run();
  }
  
  public void run(IWorkingSet editWorkingSet)
  {
    IWorkingSetManager manager = WorkbenchPlugin.getDefault().getWorkingSetManager();
    IWorkingSetEditWizard wizard = manager.createWorkingSetEditWizard(editWorkingSet);
    WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
    
    dialog.open();
  }
  
  private class ManageWorkingSetsAction
    extends Action
  {
    ManageWorkingSetsAction()
    {
      super();
    }
    
    public void run()
    {
      run(this);
    }
  }
  
  protected class ToggleEnableAllSetsAction
    extends Action
  {
    ToggleEnableAllSetsAction()
    {
      super(2);
    }
    
    public void runWithEvent(Event event)
    {
      Set<IWorkingSet> newList = new HashSet(Arrays.asList(TaskWorkingSetUpdater.getEnabledSets()));
      
      Set<IWorkingSet> tempList = new HashSet();
      Iterator<IWorkingSet> iter = newList.iterator();
      while (iter.hasNext())
      {
        IWorkingSet workingSet = (IWorkingSet)iter.next();
        if ((workingSet != null) && 
          (workingSet.getId().equalsIgnoreCase(TaskWorkingSetUpdater.ID_TASK_WORKING_SET))) {
          tempList.add(workingSet);
        }
      }
      newList.removeAll(tempList);
      if (isChecked())
      {
        IWorkingSet[] allWorkingSets = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
        IWorkingSet[] arrayOfIWorkingSet1;
        int j = (arrayOfIWorkingSet1 = allWorkingSets).length;
        for (int i = 0; i < j; i++)
        {
          IWorkingSet workingSet = arrayOfIWorkingSet1[i];
          if ((workingSet != null) && 
            (workingSet.getId().equalsIgnoreCase(TaskWorkingSetUpdater.ID_TASK_WORKING_SET))) {
            newList.add(workingSet);
          }
        }
      }
      TaskWorkingSetUpdater.applyWorkingSetsToAllWindows(newList);
    }
  }
  
  class ConfigureWindowWorkingSetsDialog
    extends AbstractWorkingSetDialogCOPY
  {
    private static final int SIZING_SELECTION_WIDGET_HEIGHT = 200;
    private static final int SIZING_SELECTION_WIDGET_WIDTH = 50;
    private final IWorkbenchWindow window;
    private CheckboxTableViewer viewer;
    private Set<String> taskWorkingSetIds;
    
    protected ConfigureWindowWorkingSetsDialog(IWorkbenchWindow window, String[] workingSetIds)
    {
      super(workingSetIds, true);
      setShellStyle(getShellStyle() | 0x10);
      this.window = window;
      
      setTitle(Messages.TaskWorkingSetAction_Select_and_Edit_Working_Sets);
      setMessage("");
      if ((workingSetIds == null) || (workingSetIds.length == 0))
      {
        taskWorkingSetIds = null;
      }
      else
      {
        taskWorkingSetIds = new HashSet();
        String[] arrayOfString;
        int j = (arrayOfString = workingSetIds).length;
        for (int i = 0; i < j; i++)
        {
          String id = arrayOfString[i];
          taskWorkingSetIds.add(id);
        }
      }
    }
    
    protected Control createDialogArea(Composite parent)
    {
      initializeDialogUnits(parent);
      
      Composite composite = (Composite)super.createDialogArea(parent);
      
      Composite viewerComposite = new Composite(composite, 0);
      GridLayout layout = new GridLayout(2, false);
      marginHeight = (marginWidth = 0);
      horizontalSpacing = convertHorizontalDLUsToPixels(4);
      verticalSpacing = convertVerticalDLUsToPixels(4);
      viewerComposite.setLayout(layout);
      
      GridData data = new GridData(1808);
      heightHint = 200;
      widthHint = 350;
      viewerComposite.setLayoutData(data);
      
      viewer = CheckboxTableViewer.newCheckList(viewerComposite, 2048);
      viewer.getControl().setLayoutData(new GridData(1808));
      viewer.setLabelProvider(new WorkingSetLabelProvider());
      viewer.setContentProvider(new ArrayContentProvider());
      viewer.addFilter(new WorkingSetFilter(taskWorkingSetIds));
      viewer.setInput(window.getWorkbench().getWorkingSetManager().getWorkingSets());
      
      viewer.setCheckedElements(TaskWorkingSetUpdater.getActiveWorkingSets(window).toArray());
      
      viewer.addSelectionChangedListener(new ISelectionChangedListener()
      {
        public void selectionChanged(SelectionChangedEvent event)
        {
          handleSelectionChanged();
        }
      });
      data = new GridData(1808);
      heightHint = 200;
      widthHint = 50;
      
      viewer.getControl().setLayoutData(data);
      addModifyButtons(viewerComposite);
      
      addSelectionButtons(composite);
      
      availableWorkingSetsChanged();
      
      Dialog.applyDialogFont(composite);
      
      return composite;
    }
    
    protected void okPressed()
    {
      Set<IWorkingSet> newList = new HashSet(Arrays.asList(TaskWorkingSetUpdater.getEnabledSets()));
      Set<IWorkingSet> tempList = new HashSet();
      Iterator localIterator2;
      for (Iterator localIterator1 = newList.iterator(); localIterator1.hasNext(); localIterator2.hasNext())
      {
        IWorkingSet workingSet = (IWorkingSet)localIterator1.next();
        localIterator2 = taskWorkingSetIds.iterator(); continue;String id = (String)localIterator2.next();
        if (workingSet.getId().equalsIgnoreCase(id)) {
          tempList.add(workingSet);
        }
      }
      newList.removeAll(tempList);
      
      Object[] selection = viewer.getCheckedElements();
      IWorkingSet[] setsToEnable = new IWorkingSet[selection.length];
      System.arraycopy(selection, 0, setsToEnable, 0, selection.length);
      newList.addAll(new HashSet(Arrays.asList(setsToEnable)));
      
      TaskWorkingSetUpdater.applyWorkingSetsToAllWindows(newList);
      super.okPressed();
    }
    
    protected List<?> getSelectedWorkingSets()
    {
      ISelection selection = viewer.getSelection();
      if ((selection instanceof IStructuredSelection)) {
        return ((IStructuredSelection)selection).toList();
      }
      return null;
    }
    
    protected void availableWorkingSetsChanged()
    {
      viewer.setInput(window.getWorkbench().getWorkingSetManager().getWorkingSets());
      super.availableWorkingSetsChanged();
    }
    
    void handleSelectionChanged()
    {
      updateButtonAvailability();
    }
    
    protected void configureShell(Shell shell)
    {
      super.configureShell(shell);
    }
    
    protected void selectAllSets()
    {
      viewer.setCheckedElements(window.getWorkbench().getWorkingSetManager().getWorkingSets());
      updateButtonAvailability();
    }
    
    protected void deselectAllSets()
    {
      viewer.setCheckedElements(new Object[0]);
      updateButtonAvailability();
    }
  }
}

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

import org.eclipse.jface.action.Action;

class TaskWorkingSetAction$ManageWorkingSetsAction
  extends Action
{
  TaskWorkingSetAction$ManageWorkingSetsAction(TaskWorkingSetAction paramTaskWorkingSetAction)
  {
    super(Messages.TaskWorkingSetAction_Edit_Label);
  }
  
  public void run()
  {
    this$0.run(this);
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;

class HideQueryAction$1
  implements ITaskListRunnable
{
  HideQueryAction$1(HideQueryAction paramHideQueryAction, IRepositoryQuery paramIRepositoryQuery) {}
  
  public void execute(IProgressMonitor monitor)
    throws CoreException
  {
    val$query.setAttribute("task.common.hidden", Boolean.toString(this$0.isChecked()));
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.commons.core.ICoreRunnable;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.ui.CommonUiUtil;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler;
import org.eclipse.mylyn.tasks.core.data.ITaskDataManager;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
import org.eclipse.ui.progress.IProgressService;

public class NewSubTaskAction
  extends BaseSelectionListenerAction
  implements IViewActionDelegate, IExecutableExtension
{
  public static final String ID = "org.eclipse.mylyn.tasks.ui.new.subtask";
  private AbstractTask selectedTask;
  
  public NewSubTaskAction()
  {
    super(Messages.NewSubTaskAction_Subtask);
    setToolTipText(Messages.NewSubTaskAction_Create_a_new_subtask);
    setId("org.eclipse.mylyn.tasks.ui.new.subtask");
    setImageDescriptor(TasksUiImages.TASK_NEW_SUB);
  }
  
  public void run()
  {
    if (selectedTask == null) {
      return;
    }
    if ((selectedTask instanceof LocalTask))
    {
      TaskList taskList = TasksUiPlugin.getTaskList();
      LocalTask newTask = new LocalTask(taskList.getNextLocalTaskId(), 
        LocalRepositoryConnector.DEFAULT_SUMMARY);
      newTask.setPriority(ITask.PriorityLevel.P3.toString());
      TasksUiPlugin.getTaskActivityManager().scheduleNewTask(newTask);
      taskList.addTask(newTask, selectedTask);
      TasksUiUtil.openTask(newTask);
      return;
    }
    AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
      selectedTask.getConnectorKind());
    TaskData taskData = createTaskData(connector);
    if (taskData != null) {
      try
      {
        TasksUiInternal.createAndOpenNewTask(taskData);
      }
      catch (CoreException e)
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", "Failed to open new sub task", e));
        TasksUiInternal.displayStatus(Messages.NewSubTaskAction_Unable_to_create_subtask, new Status(
          4, "org.eclipse.mylyn.tasks.ui", 
          Messages.NewSubTaskAction_Failed_to_create_new_sub_task_ + e.getMessage()));
      }
    }
  }
  
  private TaskData createTaskData(AbstractRepositoryConnector connector)
  {
    final AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
    if (taskDataHandler == null) {
      return null;
    }
    String repositoryUrl = selectedTask.getRepositoryUrl();
    TaskData parentTaskData = null;
    try
    {
      parentTaskData = TasksUi.getTaskDataManager().getTaskData(selectedTask);
    }
    catch (CoreException e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not retrieve task data for task:" + selectedTask.getUrl(), e));
    }
    if (parentTaskData == null)
    {
      TasksUiInternal.displayStatus(Messages.NewSubTaskAction_Unable_to_create_subtask, new Status(
        2, "org.eclipse.mylyn.tasks.ui", 
        Messages.NewSubTaskAction_Could_not_retrieve_task_data_for_task_ + selectedTask.getUrl()));
      return null;
    }
    final TaskRepository taskRepository = TasksUiPlugin.getRepositoryManager().getRepository(repositoryUrl);
    if (!taskDataHandler.canInitializeSubTaskData(taskRepository, selectedTask)) {
      return null;
    }
    final TaskData selectedTaskData = parentTaskData;
    TaskAttributeMapper attributeMapper = taskDataHandler.getAttributeMapper(taskRepository);
    final TaskData taskData = new TaskData(attributeMapper, taskRepository.getConnectorKind(), 
      taskRepository.getRepositoryUrl(), "");
    final boolean[] result = new boolean[1];
    IProgressService service = PlatformUI.getWorkbench().getProgressService();
    try
    {
      CommonUiUtil.run(service, new ICoreRunnable()
      {
        public void run(IProgressMonitor monitor)
          throws CoreException
        {
          result[0] = taskDataHandler.initializeSubTaskData(taskRepository, taskData, selectedTaskData, 
            monitor);
        }
      });
    }
    catch (CoreException e)
    {
      TasksUiInternal.displayStatus(Messages.NewSubTaskAction_Unable_to_create_subtask, e.getStatus());
      return null;
    }
    catch (OperationCanceledException localOperationCanceledException)
    {
      return null;
    }
    if (result[0] != 0) {
      return taskData;
    }
    TasksUiInternal.displayStatus(Messages.NewSubTaskAction_Unable_to_create_subtask, new Status(1, 
      "org.eclipse.mylyn.tasks.ui", 
      Messages.NewSubTaskAction_The_connector_does_not_support_creating_subtasks_for_this_task));
    
    return null;
  }
  
  public void run(IAction action)
  {
    run();
  }
  
  public void init(IViewPart view) {}
  
  protected boolean updateSelection(IStructuredSelection selection)
  {
    selectedTask = null;
    if (selection.size() == 1)
    {
      Object selectedObject = selection.getFirstElement();
      if ((selectedObject instanceof LocalTask))
      {
        selectedTask = ((AbstractTask)selectedObject);
      }
      else if ((selectedObject instanceof ITask))
      {
        selectedTask = ((AbstractTask)selectedObject);
        AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
          selectedTask.getConnectorKind());
        AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
        
        TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
          selectedTask.getRepositoryUrl());
        if ((taskDataHandler == null) || (!taskDataHandler.canInitializeSubTaskData(repository, selectedTask))) {
          selectedTask = null;
        }
      }
    }
    return selectedTask != null;
  }
  
  public void selectionChanged(IAction action, ISelection selection)
  {
    if ((selection instanceof StructuredSelection)) {
      selectionChanged((IStructuredSelection)selection);
    } else {
      setEnabled(false);
    }
    action.setEnabled(isEnabled());
  }
  
  public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
    throws CoreException
  {}
}

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

import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;

public class TaskWorkingSetAction$ToggleEnableAllSetsAction
  extends Action
{
  TaskWorkingSetAction$ToggleEnableAllSetsAction(TaskWorkingSetAction paramTaskWorkingSetAction)
  {
    super(Messages.TaskWorkingSetAction_Deselect_All, 2);
  }
  
  public void runWithEvent(Event event)
  {
    Set<IWorkingSet> newList = new HashSet(Arrays.asList(TaskWorkingSetUpdater.getEnabledSets()));
    
    Set<IWorkingSet> tempList = new HashSet();
    Iterator<IWorkingSet> iter = newList.iterator();
    while (iter.hasNext())
    {
      IWorkingSet workingSet = (IWorkingSet)iter.next();
      if ((workingSet != null) && 
        (workingSet.getId().equalsIgnoreCase(TaskWorkingSetUpdater.ID_TASK_WORKING_SET))) {
        tempList.add(workingSet);
      }
    }
    newList.removeAll(tempList);
    if (isChecked())
    {
      IWorkingSet[] allWorkingSets = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
      IWorkingSet[] arrayOfIWorkingSet1;
      int j = (arrayOfIWorkingSet1 = allWorkingSets).length;
      for (int i = 0; i < j; i++)
      {
        IWorkingSet workingSet = arrayOfIWorkingSet1[i];
        if ((workingSet != null) && 
          (workingSet.getId().equalsIgnoreCase(TaskWorkingSetUpdater.ID_TASK_WORKING_SET))) {
          newList.add(workingSet);
        }
      }
    }
    TaskWorkingSetUpdater.applyWorkingSetsToAllWindows(newList);
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.mylyn.internal.tasks.ui.dialogs.TaskListSortDialog;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.ui.IWorkbenchPartSite;

public class TaskListSortAction
  extends Action
{
  private final TaskListSortDialog dialog;
  private final TaskListView taskListView;
  
  public TaskListSortAction(IWorkbenchPartSite site, TaskListView taskListView)
  {
    super(Messages.TaskListSortAction_Sort_);
    this.taskListView = taskListView;
    setEnabled(true);
    dialog = new TaskListSortDialog(site, taskListView);
  }
  
  public void run()
  {
    if (dialog.open() == 0) {
      taskListView.getViewer().refresh();
    }
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.ui.part.DrillDownAdapter;

public class GoUpAction
  extends Action
{
  public static final String ID = "org.eclipse.mylyn.tasklist.actions.view.go.up";
  
  public GoUpAction(DrillDownAdapter drillDownAdapter)
  {
    setText(Messages.GoUpAction_Go_Up_To_Root);
    setToolTipText(Messages.GoUpAction_Go_Up_To_Root);
    setId("org.eclipse.mylyn.tasklist.actions.view.go.up");
    setImageDescriptor(CommonImages.GO_UP);
  }
  
  public void run()
  {
    if (TaskListView.getFromActivePerspective() != null) {
      TaskListView.getFromActivePerspective().goUpToRoot();
    }
  }
}

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

import java.util.Iterator;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.ui.actions.BaseSelectionListenerAction;

public class OpenWithBrowserAction
  extends BaseSelectionListenerAction
{
  public static final String ID = "org.eclipse.mylyn.tasklist.actions.open.browser";
  
  public OpenWithBrowserAction()
  {
    super(Messages.OpenWithBrowserAction_Open_with_Browser);
    setToolTipText(Messages.OpenWithBrowserAction_Open_with_Browser);
    setId("org.eclipse.mylyn.tasklist.actions.open.browser");
  }
  
  public void run()
  {
    if (super.getStructuredSelection() != null) {
      for (Iterator<?> iter = super.getStructuredSelection().iterator(); iter.hasNext();) {
        runWithSelection(iter.next());
      }
    }
  }
  
  private void runWithSelection(Object selectedObject)
  {
    if ((selectedObject instanceof IRepositoryElement)) {
      TasksUiUtil.openWithBrowser((IRepositoryElement)selectedObject);
    }
  }
  
  protected boolean updateSelection(IStructuredSelection selection)
  {
    if (!selection.isEmpty()) {
      for (Object element : selection.toList()) {
        if ((element instanceof IRepositoryElement))
        {
          TaskRepository repository = TasksUiInternal.getRepository((IRepositoryElement)element);
          if (repository != null)
          {
            String url = TasksUiInternal.getAuthenticatedUrl(repository, (IRepositoryElement)element);
            if (TasksUiInternal.isValidUrl(url)) {
              return true;
            }
          }
        }
      }
    }
    return false;
  }
}

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

import java.util.Iterator;
import java.util.Set;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
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.IViewActionDelegate;
import org.eclipse.ui.IViewPart;

public class RefreshRepositoryTasksAction
  extends AbstractTaskRepositoryAction
  implements IViewActionDelegate
{
  private static final String ID = "org.eclipse.mylyn.tasklist.repositories.refreshAllTasks";
  
  public RefreshRepositoryTasksAction()
  {
    super(Messages.RefreshRepositoryTasksAction_Refresh_All_Tasks);
    setId("org.eclipse.mylyn.tasklist.repositories.refreshAllTasks");
    setEnabled(false);
  }
  
  public void run()
  {
    IStructuredSelection selection = getStructuredSelection();
    for (Iterator<?> iter = selection.iterator(); iter.hasNext();)
    {
      Object selectedObject = iter.next();
      if ((selectedObject instanceof TaskRepository))
      {
        TaskRepository repository = (TaskRepository)selectedObject;
        synchronizeAllTasks(repository);
      }
    }
  }
  
  private void synchronizeAllTasks(TaskRepository repository)
  {
    AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
      repository.getConnectorKind());
    if (connector != null)
    {
      Set<ITask> repositoryTasks = TasksUiPlugin.getTaskList().getTasks(repository.getRepositoryUrl());
      TasksUiInternal.synchronizeTasks(connector, repositoryTasks, true, null);
    }
  }
  
  public void init(IViewPart view) {}
  
  public void run(IAction action)
  {
    run();
  }
  
  public void selectionChanged(IAction action, ISelection selection)
  {
    selectionChanged((IStructuredSelection)selection);
  }
}

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

import java.util.Set;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskListChangeAdapter;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

class TaskEditorScheduleAction$1
  extends TaskListChangeAdapter
{
  TaskEditorScheduleAction$1(TaskEditorScheduleAction paramTaskEditorScheduleAction) {}
  
  public void containersChanged(Set<TaskContainerDelta> containers)
  {
    for (TaskContainerDelta taskContainerDelta : containers) {
      if ((taskContainerDelta.getElement() instanceof ITask))
      {
        AbstractTask updateTask = (AbstractTask)taskContainerDelta.getElement();
        if ((TaskEditorScheduleAction.access$0(this$0).equals(updateTask)) && 
          (PlatformUI.getWorkbench() != null) && (!PlatformUI.getWorkbench().isClosing())) {
          PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
          {
            public void run()
            {
              this$0.updateImageDescriptor();
            }
          });
        }
      }
    }
  }
}

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

import java.util.List;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor;
import org.eclipse.mylyn.tasks.core.ITaskContainer;

class RepositoryElementActionGroup$1
  implements ISafeRunnable
{
  RepositoryElementActionGroup$1(RepositoryElementActionGroup paramRepositoryElementActionGroup, IDynamicSubM
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