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

  }
      }
      TaskCategory category = new TaskCategory(TasksUiPlugin.getTaskList().getUniqueHandleIdentifier(), name);
      TasksUiPlugin.getTaskList().addCategory(category);
      return category;
    }
    return null;
  }
  
  public void selectionChanged(IAction action, ISelection selection) {}
}

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

import org.eclipse.core.commands.Command;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
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.internal.tasks.ui.wizards.NewRepositoryWizard;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.wizards.TaskRepositoryWizardDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public class AddRepositoryAction
  extends Action
{
  @Deprecated
  private static final String PREF_ADD_QUERY = "org.eclipse.mylyn.internal.tasks.add.query";
  private static final String ID = "org.eclipse.mylyn.tasklist.repositories.add";
  public static final String TITLE = Messages.AddRepositoryAction_Add_Task_Repository;
  private boolean promptToAddQuery = true;
  
  public AddRepositoryAction()
  {
    setImageDescriptor(TasksUiImages.REPOSITORY_NEW);
    setText(TITLE);
    setId("org.eclipse.mylyn.tasklist.repositories.add");
    boolean enabled = TasksUiPlugin.getRepositoryManager().hasUserManagedRepositoryConnectors();
    if (!enabled)
    {
      Command command = TasksUiInternal.getConfiguredDiscoveryWizardCommand();
      enabled = (command != null) && (command.isEnabled());
    }
    setEnabled(enabled);
  }
  
  public boolean getPromptToAddQuery()
  {
    return promptToAddQuery;
  }
  
  public void setPromptToAddQuery(boolean promptToAddQuery)
  {
    this.promptToAddQuery = promptToAddQuery;
  }
  
  public void run()
  {
    showWizard();
  }
  
  public TaskRepository showWizard()
  {
    return showWizard(WorkbenchUtil.getShell(), null);
  }
  
  public TaskRepository showWizard(Shell shell, String connectorKind)
  {
    NewRepositoryWizard repositoryWizard = new NewRepositoryWizard(connectorKind);
    repositoryWizard.setShowNewQueryPromptOnFinish(getPromptToAddQuery());
    
    WizardDialog dialog = new TaskRepositoryWizardDialog(shell, repositoryWizard);
    dialog.create();
    dialog.setBlockOnOpen(true);
    dialog.open();
    if (dialog.getReturnCode() == 0) {
      return repositoryWizard.getTaskRepository();
    }
    return null;
  }
  
  @Deprecated
  public void promptToAddQuery(TaskRepository taskRepository)
  {
    IPreferenceStore preferenceStore = TasksUiPlugin.getDefault().getPreferenceStore();
    if (!preferenceStore.getBoolean("org.eclipse.mylyn.internal.tasks.add.query"))
    {
      Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
      MessageDialogWithToggle messageDialog = MessageDialogWithToggle.openYesNoQuestion(shell, 
        Messages.AddRepositoryAction_Add_new_query, 
        Messages.AddRepositoryAction_Add_a_query_to_the_Task_List, 
        Messages.AddRepositoryAction_Do_not_show_again, false, preferenceStore, "org.eclipse.mylyn.internal.tasks.add.query");
      preferenceStore.setValue("org.eclipse.mylyn.internal.tasks.add.query", messageDialog.getToggleState());
      if (messageDialog.getReturnCode() == 2)
      {
        AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(taskRepository.getConnectorKind());
        IWizard queryWizard = connectorUi.getQueryWizard(taskRepository, null);
        ((Wizard)queryWizard).setForcePreviousAndNextButtons(true);
        
        WizardDialog queryDialog = new WizardDialog(shell, queryWizard);
        queryDialog.create();
        queryDialog.setBlockOnOpen(true);
        queryDialog.open();
      }
    }
  }
}

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

import java.util.Collections;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.ui.actions.BaseSelectionListenerAction;

public class AutoUpdateQueryAction
  extends BaseSelectionListenerAction
{
  public AutoUpdateQueryAction()
  {
    super(Messages.AutoUpdateQueryAction_Synchronize_Automatically_Label);
    setChecked(false);
    setEnabled(false);
  }
  
  protected boolean updateSelection(IStructuredSelection selection)
  {
    if (selection.size() == 1)
    {
      Object element = selection.getFirstElement();
      if ((element instanceof RepositoryQuery))
      {
        setChecked(Boolean.valueOf(((RepositoryQuery)element).getAutoUpdate()).booleanValue());
        return true;
      }
    }
    setChecked(false);
    return false;
  }
  
  public void run()
  {
    Object element = getStructuredSelection().getFirstElement();
    if ((element instanceof RepositoryQuery)) {
      try
      {
        final RepositoryQuery query = (RepositoryQuery)element;
        TasksUiPlugin.getTaskList().run(new ITaskListRunnable()
        {
          public void execute(IProgressMonitor monitor)
            throws CoreException
          {
            query.setAutoUpdate(isChecked());
          }
        });
        TasksUiPlugin.getTaskList().notifyElementsChanged(Collections.singleton(query));
      }
      catch (CoreException e)
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
          "Failed to set offline status for query", e));
      }
    }
  }
}

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

import java.text.MessageFormat;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;

public class AbstractChangeCompletionAction
  extends Action
{
  protected boolean shouldEnable(List<IRepositoryElement> selectedElements)
  {
    boolean allLocalTasks = true;
    for (IRepositoryElement abstractTaskContainer : selectedElements)
    {
      if (!(abstractTaskContainer instanceof ITask))
      {
        allLocalTasks = false;
        break;
      }
      if (!((AbstractTask)abstractTaskContainer).isLocal())
      {
        allLocalTasks = false;
        break;
      }
    }
    return allLocalTasks;
  }
  
  protected String generateMessage(List<AbstractTask> toComplete, String status)
  {
    String message = 
      MessageFormat.format(Messages.AbstractChangeCompletionAction_Mark_selected_local_tasks_X, new Object[] {status }) + "\n\n";
    int i = 0;
    for (ITask task : toComplete)
    {
      i++;
      if (i < 20)
      {
        message = message + "    ";
        if (task.getTaskKey() != null) {
          message = message + task.getTaskKey() + ": ";
        }
        message = message + task.getSummary() + "\n";
      }
      else
      {
        message = message + "...";
        break;
      }
    }
    return message;
  }
}

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

import java.util.Comparator;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesSorter;
import org.eclipse.mylyn.tasks.core.TaskRepository;

class NewTaskAction$1
  implements Comparator<TaskRepository>
{
  NewTaskAction$1(NewTaskAction paramNewTaskAction, TaskRepositoriesSorter paramTaskRepositoriesSorter) {}
  
  public int compare(TaskRepository arg0, TaskRepository arg1)
  {
    return val$comparator.compare(null, arg0, arg1);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskAction.1
 * 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.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivityManager;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;

public class TaskDeactivateAction
  extends Action
{
  public static final String ID = "org.eclipse.mylyn.tasklist.actions.context.deactivate";
  
  public TaskDeactivateAction()
  {
    setId("org.eclipse.mylyn.tasklist.actions.context.deactivate");
    setActionDefinitionId("org.eclipse.mylyn.tasks.ui.command.deactivateSelectedTask");
    setText(Messages.TaskDeactivateAction_Deactivate);
    setImageDescriptor(TasksUiImages.CONTEXT_INACTIVE_EMPTY);
  }
  
  @Deprecated
  public void run(ITask task)
  {
    TasksUi.getTaskActivityManager().deactivateTask(task);
  }
  
  public void run()
  {
    TasksUi.getTaskActivityManager().deactivateActiveTask();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.actions.TaskDeactivateAction
 * 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.Assert;
import org.eclipse.mylyn.commons.ui.ClipboardCopier;
import org.eclipse.mylyn.commons.ui.ClipboardCopier.TextProvider;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
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.ui.TasksUi;
import org.eclipse.ui.actions.BaseSelectionListenerAction;

public class CopyTaskDetailsAction
  extends BaseSelectionListenerAction
{
  public static final String ID = "org.eclipse.mylyn.tasklist.actions.copy";
  private Mode mode;
  
  public static enum Mode
  {
    KEY,  URL,  SUMMARY,  SUMMARY_URL;
  }
  
  public CopyTaskDetailsAction(Mode mode)
  {
    super("");
    setMode(mode);
  }
  
  public Mode getMode()
  {
    return mode;
  }
  
  public void setMode(Mode mode)
  {
    Assert.isNotNull(mode);
    this.mode = mode;
    switch (mode)
    {
    case KEY: 
      setText(Messages.CopyTaskDetailsAction_ID_Menu_Label);
      break;
    case SUMMARY: 
      setText(Messages.CopyTaskDetailsAction_Url_Menu_Label);
      break;
    case SUMMARY_URL: 
      setText(Messages.CopyTaskDetailsAction_Summary_Menu_Label);
      break;
    case URL: 
      setText(Messages.CopyTaskDetailsAction_Summary_and_Url_Menu_Label);
    }
  }
  
  public void run()
  {
    ClipboardCopier.getDefault().copy(getStructuredSelection(), new ClipboardCopier.TextProvider()
    {
      public String getTextForElement(Object element)
      {
        return CopyTaskDetailsAction.getTextForTask(element, getMode());
      }
    });
  }
  
  public static String getTextForTask(Object object)
  {
    return getTextForTask(object, Mode.SUMMARY_URL);
  }
  
  public static String getTextForTask(Object object, Mode mode)
  {
    StringBuffer sb = new StringBuffer();
    switch (mode)
    {
    case KEY: 
      if ((object instanceof ITask))
      {
        ITask task = (ITask)object;
        if (task.getTaskKey() != null) {
          sb.append(task.getTaskKey());
        }
      }
      break;
    case SUMMARY: 
      if ((object instanceof IRepositoryElement))
      {
        String taskUrl = getUrl((IRepositoryElement)object);
        if (TasksUiInternal.isValidUrl(taskUrl)) {
          sb.append(taskUrl);
        }
      }
      break;
    case SUMMARY_URL: 
      if ((object instanceof ITask))
      {
        ITask task = (ITask)object;
        if (task.getTaskKey() != null)
        {
          sb.append(TasksUiInternal.getTaskPrefix(task.getConnectorKind()));
          sb.append(task.getTaskKey());
          sb.append(": ");
        }
        sb.append(task.getSummary());
      }
      else if ((object instanceof IRepositoryElement))
      {
        IRepositoryElement element = (IRepositoryElement)object;
        sb.append(element.getSummary());
      }
      break;
    case URL: 
      if ((object instanceof ITask))
      {
        ITask task = (ITask)object;
        if (task.getTaskKey() != null)
        {
          sb.append(task.getTaskKey());
          sb.append(": ");
        }
        sb.append(task.getSummary());
        String taskUrl = getUrl((IRepositoryElement)object);
        if (TasksUiInternal.isValidUrl(taskUrl))
        {
          sb.append(ClipboardCopier.LINE_SEPARATOR);
          sb.append(taskUrl);
        }
      }
      else if ((object instanceof IRepositoryQuery))
      {
        RepositoryQuery query = (RepositoryQuery)object;
        sb.append(query.getSummary());
        if (TasksUiInternal.isValidUrl(query.getUrl()))
        {
          sb.append(ClipboardCopier.LINE_SEPARATOR);
          sb.append(query.getUrl());
        }
      }
      else if ((object instanceof IRepositoryElement))
      {
        IRepositoryElement element = (IRepositoryElement)object;
        sb.append(element.getSummary());
      }
      break;
    }
    return sb.toString();
  }
  
  private static String getUrl(IRepositoryElement element)
  {
    if (element.getUrl() != null) {
      return element.getUrl();
    }
    if ((element instanceof ITask))
    {
      ITask task = (ITask)element;
      return TasksUi.getRepositoryConnector(task.getConnectorKind()).getTaskUrl(task.getRepositoryUrl(), 
        task.getTaskId());
    }
    return null;
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.commons.core.ICoreRunnable;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AutomaticRepositoryTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
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.core.data.TaskDataManager;
import org.eclipse.mylyn.internal.tasks.core.sync.DeleteTasksJob;
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.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivityManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.context.AbstractTaskContextStore;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
import org.eclipse.ui.internal.WorkbenchImages;

public class DeleteAction
  extends BaseSelectionListenerAction
{
  public static final String ID = "org.eclipse.mylyn.tasklist.actions.delete";
  
  public DeleteAction()
  {
    super(Messages.DeleteAction_Delete);
    setId("org.eclipse.mylyn.tasklist.actions.delete");
    setImageDescriptor(WorkbenchImages.getImageDescriptor("IMG_TOOL_DELETE"));
    setActionDefinitionId("org.eclipse.ui.edit.delete");
  }
  
  public void run()
  {
    doDelete(getStructuredSelection().toList());
  }
  
  protected void doDelete(List<?> toDelete)
  {
    boolean allLocalTasks = true;
    boolean allSupportRepositoryDeletion = true;
    boolean allElementsAreTasks = true;
    for (Object object : toDelete) {
      if ((object instanceof ITask))
      {
        ITask task = (ITask)object;
        AbstractRepositoryConnector repositoryConnector = TasksUi.getRepositoryConnector(task.getConnectorKind());
        TaskRepository repository = TasksUi.getRepositoryManager().getRepository(task.getConnectorKind(), 
          task.getRepositoryUrl());
        if ((repository != null) && (repositoryConnector != null)) {
          allSupportRepositoryDeletion &= repositoryConnector.canDeleteTask(repository, task);
        } else {
          allSupportRepositoryDeletion = false;
        }
        allLocalTasks &= task instanceof LocalTask;
      }
      else
      {
        allElementsAreTasks = false;
      }
    }
    String elements = buildElementListString(toDelete);
    String message = buildMessage(toDelete, elements, allElementsAreTasks);
    if (toDelete.isEmpty())
    {
      MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), 
        Messages.DeleteAction_Delete_failed, Messages.DeleteAction_Nothing_selected);
    }
    else
    {
      boolean deleteConfirmed = false;
      boolean deleteOnServer = false;
      
      final boolean allTasksDeletable = allSupportRepositoryDeletion;
      if ((allLocalTasks) || (!allElementsAreTasks))
      {
        deleteConfirmed = MessageDialog.openQuestion(PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow()
          .getShell(), Messages.DeleteAction_Delete_Tasks, message);
      }
      else
      {
        String toggleMessage = Messages.DeleteAction_Also_delete_from_repository_X;
        if (allTasksDeletable) {
          toggleMessage = NLS.bind(toggleMessage, "");
        } else {
          toggleMessage = NLS.bind(toggleMessage, Messages.DeleteAction_Not_supported);
        }
        MessageDialogWithToggle dialog = new MessageDialogWithToggle(WorkbenchUtil.getShell(), 
          Messages.DeleteAction_Delete_Tasks, null, message, 3, new String[] {
          IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0, toggleMessage, false)
          {
            protected Control createContents(Composite parent)
            {
              Control createdControl = super.createContents(parent);
              getToggleButton().setEnabled(allTasksDeletable);
              return createdControl;
            }
          };
          deleteConfirmed = dialog.open() == 2;
          deleteOnServer = (dialog.getToggleState()) && (allTasksDeletable);
        }
        if (deleteConfirmed) {
          deleteElements(toDelete, deleteOnServer);
        }
      }
    }
    
    private void deleteElements(final List<?> toDelete, final boolean deleteOnServer)
    {
      ICoreRunnable op = new ICoreRunnable()
      {
        /* Error */
        public void run(IProgressMonitor monitor)
          throws CoreException
        {
          // Byte code:
          //   0: aload_1
          //   1: getstatic 66	org/eclipse/mylyn/internal/tasks/ui/actions/Messages:DeleteAction_Delete_in_progress	Ljava/lang/String;
          //   4: iconst_m1
          //   5: invokeinterface 73 3 0
          //   10: aload_0
          //   11: getfield 64	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction$2:val$toDelete	Ljava/util/List;
          //   14: invokestatic 70	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction:prepareDeletion	(Ljava/util/Collection;)V
          //   17: invokestatic 69	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getTaskList	()Lorg/eclipse/mylyn/internal/tasks/core/TaskList;
          //   20: new 35	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction$2$1
          //   23: dup
          //   24: aload_0
          //   25: aload_0
          //   26: getfield 64	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction$2:val$toDelete	Ljava/util/List;
          //   29: aload_0
          //   30: getfield 63	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction$2:val$deleteOnServer	Z
          //   33: invokespecial 71	org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction$2$1:<init>	(Lorg/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction$2;Ljava/util/List;Z)V
          //   36: aload_1
          //   37: invokevirtual 68	org/eclipse/mylyn/internal/tasks/core/TaskList:run	(Lorg/eclipse/mylyn/internal/tasks/core/ITaskListRunnable;Lorg/eclipse/core/runtime/IProgressMonitor;)V
          //   40: goto +12 -> 52
          //   43: astore_2
          //   44: aload_1
          //   45: invokeinterface 72 1 0
          //   50: aload_2
          //   51: athrow
          //   52: aload_1
          //   53: invokeinterface 72 1 0
          //   58: return
          // Line number table:
          //   Java source line #151	-> byte code offset #0
          //   Java source line #152	-> byte code offset #10
          //   Java source line #153	-> byte code offset #17
          //   Java source line #161	-> byte code offset #36
          //   Java source line #153	-> byte code offset #37
          //   Java source line #162	-> byte code offset #43
          //   Java source line #163	-> byte code offset #44
          //   Java source line #164	-> byte code offset #50
          //   Java source line #163	-> byte code offset #52
          //   Java source line #165	-> byte code offset #58
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	59	0	this	2
          //   0	59	1	monitor	IProgressMonitor
          //   43	8	2	localObject	Object
          // Exception table:
          //   from	to	target	type
          //   0	43	43	finally
        }
      };
      try
      {
        WorkbenchUtil.runInUi(op, null);
      }
      catch (CoreException e)
      {
        Status status = new Status(4, "org.eclipse.mylyn.tasks.ui", NLS.bind(
          "Problems encountered deleting task list elements: {0}", e.getMessage()), e);
        TasksUiInternal.logAndDisplayStatus(Messages.DeleteTaskRepositoryAction_Delete_Task_Repository_Failed, 
          status);
      }
      catch (OperationCanceledException localOperationCanceledException) {}
    }
    
    private String buildMessage(List<?> toDelete, String elements, boolean allElementsAreTasks)
    {
      String message;
      if (toDelete.size() == 1)
      {
        Object object = toDelete.get(0);
        String message;
        if ((object instanceof ITask))
        {
          String message;
          if (((AbstractTask)object instanceof LocalTask)) {
            message = Messages.DeleteAction_Permanently_delete_from_task_list;
          } else {
            message = Messages.DeleteAction_Delete_task_from_task_list_context_planning_deleted;
          }
        }
        else
        {
          String message;
          if ((object instanceof TaskCategory))
          {
            message = Messages.DeleteAction_Permanently_delete_the_category;
          }
          else
          {
            String message;
            if ((object instanceof IRepositoryQuery))
            {
              message = Messages.DeleteAction_Permanently_delete_the_query;
            }
            else
            {
              String message;
              if ((object instanceof UnmatchedTaskContainer))
              {
                message = Messages.DeleteAction_Delete_the_planning_information_and_context_of_all_unmatched_tasks;
              }
              else
              {
                String message;
                if ((object instanceof UnsubmittedTaskContainer)) {
                  message = Messages.DeleteAction_Delete_all_of_the_unsubmitted_tasks;
                } else {
                  message = Messages.DeleteAction_Permanently_delete_the_element_listed_below;
                }
              }
            }
          }
        }
      }
      else
      {
        String message;
        if (allElementsAreTasks) {
          message = Messages.DeleteAction_Delete_tasks_from_task_list_context_planning_deleted;
        } else {
          message = Messages.DeleteAction_Delete_elements_from_task_list_context_planning_deleted;
        }
      }
      String message = message + "\n\n" + elements;
      return message;
    }
    
    private String buildElementListString(List<?> toDelete)
    {
      String elements = "";
      int i = 0;
      for (Object object : toDelete) {
        if (!(object instanceof UnmatchedTaskContainer))
        {
          i++;
          if (i < 20)
          {
            if ((object instanceof IRepositoryElement)) {
              elements = elements + "    " + ((IRepositoryElement)object).getSummary() + "\n";
            }
          }
          else
          {
            elements = elements + "...";
            break;
          }
        }
      }
      return elements;
    }
    
    public static void prepareDeletion(Collection<?> toDelete)
    {
      for (Object selectedObject : toDelete) {
        if ((selectedObject instanceof AbstractTask))
        {
          AbstractTask task = (AbstractTask)selectedObject;
          TasksUi.getTaskActivityManager().deactivateTask(task);
          TasksUiInternal.closeTaskEditorInAllPages(task, false);
        }
        else if ((selectedObject instanceof AutomaticRepositoryTaskContainer))
        {
          if (toDelete.size() == 1) {
            prepareDeletion(((AutomaticRepositoryTaskContainer)selectedObject).getChildren());
          }
        }
      }
    }
    
    public static void performDeletion(Collection<?> toDelete)
    {
      for (Object selectedObject : toDelete) {
        if ((selectedObject instanceof AbstractTask))
        {
          AbstractTask task = (AbstractTask)selectedObject;
          TasksUiInternal.getTaskList().deleteTask(task);
          try
          {
            TasksUiPlugin.getTaskDataManager().deleteTaskData(task);
          }
          catch (CoreException e)
          {
            StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", "Failed to delete task data", 
              e));
          }
          TasksUiPlugin.getContextStore().deleteContext(task);
        }
        else if ((selectedObject instanceof IRepositoryQuery))
        {
          TasksUiInternal.getTaskList().deleteQuery((RepositoryQuery)selectedObject);
        }
        else if ((selectedObject instanceof TaskCategory))
        {
          TasksUiInternal.getTaskList().deleteCategory((TaskCategory)selectedObject);
        }
        else if ((selectedObject instanceof AutomaticRepositoryTaskContainer))
        {
          if (toDelete.size() == 1) {
            for (int i = 0; i < 5; i++)
            {
              Collection<ITask> children = ((AutomaticRepositoryTaskContainer)selectedObject).getChildren();
              if (children.isEmpty()) {
                break;
              }
              performDeletion(children);
            }
          }
        }
      }
    }
    
    private void performDeletionFromServer(List<?> toDelete)
    {
      List<ITask> tasksToDelete = new ArrayList();
      for (Object element : toDelete) {
        if ((element instanceof ITask)) {
          tasksToDelete.add((ITask)element);
        }
      }
      final DeleteTasksJob deleteTaskJob = new DeleteTasksJob(Messages.DeleteAction_Deleting_tasks_from_repositories, 
        tasksToDelete, TasksUi.getRepositoryManager());
      deleteTaskJob.setPriority(10);
      deleteTaskJob.addJobChangeListener(new JobChangeAdapter()
      {
        public void done(IJobChangeEvent event)
        {
          if ((deleteTaskJob.getStatus() != null) && (!deleteTaskJob.getStatus().isOK())) {
            StatusHandler.log(deleteTaskJob.getStatus());
          }
        }
      });
      deleteTaskJob.setUser(true);
      deleteTaskJob.schedule();
    }
    
    protected boolean updateSelection(IStructuredSelection selection)
    {
      List<?> elements = selection.toList();
      for (Object object : elements) {
        if ((object instanceof UncategorizedTaskContainer)) {
          return false;
        }
      }
      return true;
    }
  }

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

import org.eclipse.mylyn.commons.ui.ClipboardCopier.TextProvider;

class CopyTaskDetailsAction$1
  implements ClipboardCopier.TextProvider
{
  CopyTaskDetailsAction$1(CopyTaskDetailsAction paramCopyTaskDetailsAction) {}
  
  public String getTextForElement(Object element)
  {
    return CopyTaskDetailsAction.getTextForTask(element, this$0.getMode());
  }
}

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

import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
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.ITask;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.ITaskActivityManager;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class TaskSelectionDialogWithRandom
  extends TaskSelectionDialog
{
  private static final int RANDOM_ID = 1025;
  private Button randomTaskButton;
  private boolean activateTask = false;
  
  public TaskSelectionDialogWithRandom(Shell parent, boolean multi)
  {
    super(parent, multi);
  }
  
  public TaskSelectionDialogWithRandom(Shell parent)
  {
    super(parent);
  }
  
  protected void createAdditionalButtons(Composite parent)
  {
    randomTaskButton = createButton(parent, 1025, Messages.TaskSelectionDialog_Random_Task, false);
    randomTaskButton.setToolTipText(Messages.TaskSelectionDialogWithRandom_Feeling_Lazy_Tooltip);
    randomTaskButton.addSelectionListener(new SelectionListener()
    {
      public void widgetDefaultSelected(SelectionEvent e) {}
      
      public void widgetSelected(SelectionEvent se)
      {
        try
        {
          Set<ITask> selectedTasks = new HashSet();
          Set<ITask> allScheduled = ((TaskActivityManager)TasksUi.getTaskActivityManager()).getAllScheduledTasks();
          if (!allScheduled.isEmpty())
          {
            selectedTasks.addAll(allScheduled);
            
            selectedTasks.retainAll(TasksUiPlugin.getTaskList().getAllTasks());
          }
          if (selectedTasks.isEmpty()) {
            selectedTasks.addAll(TasksUiPlugin.getTaskList().getAllTasks());
          }
          Set<ITask> potentialTasks = new HashSet();
          addLowEnergyTasks(selectedTasks, potentialTasks, ITask.PriorityLevel.P5);
          addLowEnergyTasks(selectedTasks, potentialTasks, ITask.PriorityLevel.P4);
          if (potentialTasks.isEmpty()) {
            addLowEnergyTasks(selectedTasks, potentialTasks, ITask.PriorityLevel.P3);
          }
          if (potentialTasks.isEmpty()) {
            addLowEnergyTasks(selectedTasks, potentialTasks, ITask.PriorityLevel.P2);
          }
          int randomTaskIndex = new Random().nextInt(potentialTasks.size());
          ITask randomTask = ((ITask[])potentialTasks.toArray(new ITask[potentialTasks.size()]))[randomTaskIndex];
          if (activateTask) {
            TasksUi.getTaskActivityManager().activateTask(randomTask);
          }
          TasksUiInternal.refreshAndOpenTaskListElement(randomTask);
          close();
        }
        catch (Exception localException)
        {
          MessageDialog.openInformation(Display.getDefault().getActiveShell(), 
            Messages.TaskSelectionDialogWithRandom_Feeling_Lazy_Error_Title, 
            Messages.TaskSelectionDialogWithRandom_Feeling_Lazy_Error);
        }
      }
      
      private void addLowEnergyTasks(Set<ITask> selectedTasks, Set<ITask> potentialTasks, ITask.PriorityLevel priorityLevel)
      {
        for (ITask task : selectedTasks) {
          if ((task.getSynchronizationState().isSynchronized()) && (!task.isCompleted()) && 
            (priorityLevel.toString().equals(task.getPriority()))) {
            potentialTasks.add(task);
          }
        }
      }
    });
  }
  
  public boolean isActivateTask()
  {
    return activateTask;
  }
  
  public void setActivateTask(boolean activateTask)
  {
    this.activateTask = activateTask;
  }
}

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

import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;

class TaskSelectionDialog$2
  implements SelectionListener
{
  TaskSelectionDialog$2(TaskSelectionDialog paramTaskSelectionDialog) {}
  
  public void widgetDefaultSelected(SelectionEvent e) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.close();
    new NewTaskAction().run();
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.ui.actions.messages";
  public static String AbstractChangeCompletionAction_Mark_selected_local_tasks_X;
  public static String ActivateTaskDialogAction_Activate_Task;
  public static String ActivateTaskDialogAction_Select_a_task_to_activate__;
  public static String ActivateTaskHistoryDropDownAction_Activate_Previous_Task;
  public static String AddRepositoryAction_Add_new_query;
  public static String AddRepositoryAction_Add_a_query_to_the_Task_List;
  public static String AddRepositoryAction_Add_Task_Repository;
  public static String AddRepositoryAction_Do_not_show_again;
  public static String AutoUpdateQueryAction_Synchronize_Automatically_Label;
  public static String ClearOutgoingAction_Clear_outgoing;
  public static String ClearOutgoingAction_Clear_outgoing_failed;
  public static String ClearOutgoingAction_Confirm_discard;
  public static String ClearOutgoingAction_Discard_all_outgoing_changes_;
  public static String CloneTaskAction_Clone_Label;
  public static String CloneTaskAction_Clone_Task_Failed;
  public static String CloneTaskAction_Cloned_from_;
  public static String CollapseAllAction_Collapse_All;
  public static String CompareAttachmentsAction_Compare__;
  public static String CompareAttachmentsAction_Compare_Attachments;
  public static String CompareAttachmentsAction_Failed_to_find_attachment;
  public static String CopyCommentDetailsAction_Copy_User_ID;
  public static String CopyCommentDetailsAction_Copy_User_ID_Tooltip;
  public static String CopyCommenterNameAction_Copy_User_Name;
  public static String CopyCommenterNameAction_Copy_User_Name_Tooltip;
  public static String CopyTaskDetailsAction_ID_Menu_Label;
  public static String CopyTaskDetailsAction_Summary_and_Url_Menu_Label;
  public static String CopyTaskDetailsAction_Summary_Menu_Label;
  public static String CopyTaskDetailsAction_Url_Menu_Label;
  public static String DeleteAction_Also_delete_from_repository_X;
  public static String DeleteAction_Delete_Tasks;
  public static String DeleteAction_Delete;
  public static String DeleteAction_Delete_all_of_the_unsubmitted_tasks;
  public static String DeleteAction_Delete_elements_from_task_list_context_planning_deleted;
  public static String DeleteAction_Delete_failed;
  public static String DeleteAction_Delete_in_progress;
  public static String DeleteAction_Delete_task_from_task_list_context_planning_deleted;
  public static String DeleteAction_Delete_tasks_from_task_list_context_planning_deleted;
  public static String DeleteAction_Delete_the_planning_information_and_context_of_all_unmatched_tasks;
  public static String DeleteAction_Deleting_tasks_from_repositories;
  public static String DeleteAction_Not_supported;
  public static String DeleteAction_Nothing_selected;
  public static String DeleteAction_Permanently_delete_from_task_list;
  public static String DeleteAction_Permanently_delete_the_category;
  public static String DeleteAction_Permanently_delete_the_element_listed_below;
  public static String DeleteAction_Permanently_delete_the_query;
  public static String DeleteTaskEditorAction_Delete_Task;
  public static String DeleteTaskRepositoryAction_Confirm_Delete;
  public static String DeleteTaskRepositoryAction_Delete_Specific_Task_Repository;
  public static String DeleteTaskRepositoryAction_Delete_Repository;
  public static String DeleteTaskRepositoryAction_Delete_the_selected_task_repositories;
  public static String DeleteTaskRepositoryAction_Delete_Repository_In_Progress;
  public static String DeleteTaskRepositoryAction_Delete_Task_Repository_Failed;
  public static String EditRepositoryPropertiesAction_Properties;
  public static String ExpandAllAc
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