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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.externalization.ExternalizationManager;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiExtensionReader;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesView;
import org.eclipse.ui.progress.UIJob;

class TasksUiPlugin$TasksUiInitializationJob
  extends UIJob
{
  public TasksUiPlugin$TasksUiInitializationJob(TasksUiPlugin paramTasksUiPlugin)
  {
    super(Messages.TasksUiPlugin_Initializing_Task_List);
    setSystem(true);
  }
  
  public IStatus runInUIThread(IProgressMonitor monitor)
  {
    monitor.beginTask("Initializing Task List", 5);
    try
    {
      TasksUiExtensionReader.initWorkbenchUiExtensions();
      
      TasksUiPlugin.access$3().getLoadStatus();
      
      List<String> commandLineArgs = Arrays.asList(Platform.getCommandLineArgs());
      activateTask = !commandLineArgs.contains("-no-activate-task");
      if (activateTask) {
        try
        {
          Field field = Workspace.class.getDeclaredField("crashed");
          field.setAccessible(true);
          value = field.get(ResourcesPlugin.getWorkspace());
          if ((value instanceof Boolean)) {
            activateTask = !((Boolean)value).booleanValue();
          }
        }
        catch (Throwable t)
        {
          t.printStackTrace();
        }
      }
      for (Object value = TasksUiPlugin.access$4().getAllTasks().iterator(); ((Iterator)value).hasNext();)
      {
        AbstractTask task = (AbstractTask)((Iterator)value).next();
        if (task.isActive())
        {
          task.setActive(false);
          if (activateTask)
          {
            TasksUiPlugin.access$5().activateTask(task);
            activateTask = false;
          }
        }
      }
    }
    catch (Throwable t)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not initialize task activity", t));
    }
    monitor.worked(1);
    
    this$0.initializeNotificationsAndSynchronization();
    
    TasksUiPlugin.access$6(this$0);
    try
    {
      this$0.getPreferenceStore().addPropertyChangeListener(TasksUiPlugin.access$7(this$0));
      
      TaskRepositoriesView repositoriesView = TaskRepositoriesView.getFromActivePerspective();
      if (repositoriesView != null) {
        repositoriesView.getViewer().refresh();
      }
    }
    catch (Throwable t)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not finish Tasks UI initialization", t));
    }
    finally
    {
      monitor.done();
    }
    return new Status(0, "org.eclipse.mylyn.tasks.ui", 0, "", null);
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.swt.graphics.Image;

public class PersonContentProposal
  implements IContentProposal, Comparable<PersonContentProposal>
{
  private final String address;
  private final boolean isCurrentUser;
  private final String replacementText;
  private final int cursorPosition;
  
  public PersonContentProposal(String address, boolean isCurrentUser, String replacementText, int cursorPosition)
  {
    Assert.isNotNull(address);
    Assert.isNotNull(replacementText);
    this.address = address;
    this.isCurrentUser = isCurrentUser;
    this.replacementText = replacementText;
    this.cursorPosition = cursorPosition;
  }
  
  public PersonContentProposal(String address, boolean isCurrentUser)
  {
    this(address, isCurrentUser, address, address.length());
  }
  
  public String getLabel()
  {
    return address;
  }
  
  public String getDescription()
  {
    return null;
  }
  
  public int getCursorPosition()
  {
    return cursorPosition;
  }
  
  public String getContent()
  {
    return replacementText;
  }
  
  public Image getImage()
  {
    if (isCurrentUser) {
      return CommonImages.getImage(CommonImages.PERSON_ME);
    }
    return CommonImages.getImage(CommonImages.PERSON);
  }
  
  public int compareTo(PersonContentProposal otherContentProposal)
  {
    if (isCurrentUser) {
      return -1;
    }
    if (isCurrentUser) {
      return 1;
    }
    return address.compareToIgnoreCase(address);
  }
  
  public boolean isCurrentUser()
  {
    return isCurrentUser;
  }
}

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

public abstract interface ITasksUiPreferenceConstants
{
  public static final String ACTIVATE_MULTIPLE = "org.eclipse.mylyn.tasks.ui.activation.multipe";
  public static final String ACTIVATE_WHEN_OPENED = "org.eclipse.mylyn.tasks.ui.activate.when.opened";
  public static final String SHOW_TRIM = "org.eclipse.mylyn.tasks.ui.show.trim";
  @Deprecated
  public static final String BACKUP_LAST = "org.eclipse.mylyn.tasks.ui.backup.last";
  @Deprecated
  public static final String BACKUP_MAXFILES = "org.eclipse.mylyn.tasks.ui.backup.maxfiles";
  @Deprecated
  public static final String BACKUP_SCHEDULE = "org.eclipse.mylyn.tasks.ui.backup.schedule";
  public static final String FILTER_ARCHIVE_MODE = "org.eclipse.mylyn.tasks.ui.filters.archive";
  public static final String FILTER_COMPLETE_MODE = "org.eclipse.mylyn.tasks.ui.filters.complete";
  public static final String FILTER_HIDDEN = "org.eclipse.mylyn.tasks.ui.filters.hidden";
  public static final String FILTER_NON_MATCHING = "org.eclipse.mylyn.tasks.ui.filters.nonmatching";
  public static final String FILTER_PRIORITY = "org.eclipse.mylyn.tasks.ui.filters.priority";
  public static final String GROUP_SUBTASKS = "org.eclipse.mylyn.tasks.ui.group.subtasks";
  public static final String OVERLAYS_INCOMING_TIGHT = "org.eclipse.mylyn.tasks.ui.overlays.incoming.tight";
  public static final String NOTIFICATIONS_ENABLED = "org.eclipse.mylyn.tasks.ui.notifications.enabled";
  public static final String SERVICE_MESSAGES_ENABLED = "org.eclipse.mylyn.tasks.ui.messages.enabled";
  public static final String WEEK_START_DAY = "org.eclipse.mylyn.tasks.ui.planning.week.start.day";
  public static final String PLANNING_ENDHOUR = "org.eclipse.mylyn.tasks.ui.planning.end.hour";
  public static final String EDITOR_TASKS_RICH = "org.eclipse.mylyn.tasks.ui.reporting.open.editor";
  public static final String EDITOR_CURRENT_LINE_HIGHLIGHT = "org.eclipse.mylyn.tasks.ui.editor.currentLineHighlight";
  public static final String USE_STRIKETHROUGH_FOR_COMPLETED = "org.eclipse.mylyn.tasks.ui.strikethrough.for.completed";
  public static final String REPOSITORY_SYNCH_SCHEDULE_ENABLED = "org.eclipse.mylyn.tasks.ui.repositories.synch.schedule";
  public static final String REPOSITORY_SYNCH_SCHEDULE_MILISECONDS = "org.eclipse.mylyn.tasks.ui.repositories.synch.schedule.miliseconds";
  public static final String TEMPLATES_DELETED = "org.eclipse.mylyn.tasks.ui.templates.deleted";
  public static final String TEMPLATES_DELETED_DELIM = "|";
  public static final String AUTO_EXPAND_TASK_LIST = "org.eclipse.mylyn.tasks.ui.auto.expand";
  public static final String TASK_LIST_FOCUSED = "org.eclipse.mylyn.tasks.ui.task.list.focused";
  @Deprecated
  public static final String LOCAL_SUB_TASKS_ENABLED = "org.eclipse.mylyn.tasks.ui.subtasks.local";
  public static final String TASK_LIST_TOOL_TIPS_ENABLED = "org.eclipse.mylyn.tasks.ui.task.list.tool.tip";
  public static final String PREF_DATA_DIR = "org.eclipse.mylyn.data.dir";
  public static final String DEFAULT_ATTACHMENTS_DIRECTORY = "org.eclipse.mylyn.tasks.ui.attachments.defaultDirectory";
  public static final String PREFERRED_TASK_ATTACHMENT_VIEWER_ID = "org.eclipse.mylyn.tasks.ui.attachments.preferredViewerID";
  public static final String SERVICE_MESSAGE_URL = "org.eclipse.mylyn.tasks.ui.servicemessage.url";
  public static final String LAST_SERVICE_MESSAGE_ID = "org.eclipse.mylyn.tasks.ui.servicemessage.id";
  public static final String LAST_SERVICE_MESSAGE_ETAG = "org.eclipse.mylyn.tasks.ui.servicemessage.etag";
  public static final String LAST_SERVICE_MESSAGE_LAST_MODIFIED = "org.eclipse.mylyn.tasks.ui.servicemessage.lastmodified";
  public static final String LAST_SERVICE_MESSAGE_CHECKTIME = "org.eclipse.mylyn.tasks.ui.servicemessage.checktime";
}

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

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.DateRange;
import org.eclipse.mylyn.tasks.core.ITask;

class TasksReminderDialog$ReminderTaskSorter
  extends ViewerSorter
{
  public static final int DESCRIPTION = 1;
  public static final int PRIORITY = 2;
  public static final int DATE = 3;
  private final int criteria;
  
  public TasksReminderDialog$ReminderTaskSorter(int criteria)
  {
    this.criteria = criteria;
  }
  
  public int compare(Viewer viewer, Object obj1, Object obj2)
  {
    ITask t1 = (ITask)obj1;
    ITask t2 = (ITask)obj2;
    switch (criteria)
    {
    case 1: 
      return compareDescription(t1, t2);
    case 2: 
      return comparePriority(t1, t2);
    case 3: 
      return compareDate((AbstractTask)t1, (AbstractTask)t2);
    }
    return 0;
  }
  
  private int compareDescription(ITask task1, ITask task2)
  {
    return task1.getSummary().compareToIgnoreCase(task2.getSummary());
  }
  
  private int comparePriority(ITask task1, ITask task2)
  {
    return task1.getPriority().compareTo(task2.getPriority());
  }
  
  private int compareDate(AbstractTask task1, AbstractTask task2)
  {
    return task2.getScheduledForDate().compareTo(task1.getScheduledForDate());
  }
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.mylyn.commons.core.AbstractErrorReporter;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public class DialogErrorReporter
  extends AbstractErrorReporter
{
  private boolean errorDialogOpen;
  
  public int getPriority(IStatus status)
  {
    return AbstractErrorReporter.PRIORITY_LOW;
  }
  
  public void handle(final IStatus status)
  {
    if (Platform.isRunning())
    {
      IWorkbench workbench = PlatformUI.getWorkbench();
      if (workbench != null)
      {
        Display display = workbench.getDisplay();
        if ((display != null) && (!display.isDisposed())) {
          display.asyncExec(new Runnable()
          {
            /* Error */
            public void run()
            {
              // Byte code:
              //   0: aload_0
              //   1: getfield 54	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;
              //   4: invokestatic 59	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;)Z
              //   7: ifne +47 -> 54
              //   10: aload_0
              //   11: getfield 54	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;
              //   14: iconst_1
              //   15: invokestatic 60	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;Z)V
              //   18: invokestatic 61	org/eclipse/swt/widgets/Display:getDefault	()Lorg/eclipse/swt/widgets/Display;
              //   21: invokevirtual 62	org/eclipse/swt/widgets/Display:getActiveShell	()Lorg/eclipse/swt/widgets/Shell;
              //   24: astore_1
              //   25: aload_1
              //   26: getstatic 55	org/eclipse/mylyn/internal/tasks/ui/Messages:DialogErrorReporter_Mylyn_Error	Ljava/lang/String;
              //   29: getstatic 56	org/eclipse/mylyn/internal/tasks/ui/Messages:DialogErrorReporter_Please_report_the_following_error_at	Ljava/lang/String;
              //   32: aload_0
              //   33: getfield 53	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter$1:val$status	Lorg/eclipse/core/runtime/IStatus;
              //   36: invokestatic 58	org/eclipse/jface/dialogs/ErrorDialog:openError	(Lorg/eclipse/swt/widgets/Shell;Ljava/lang/String;Ljava/lang/String;Lorg/eclipse/core/runtime/IStatus;)I
              //   39: pop
              //   40: goto +14 -> 54
              //   43: astore_2
              //   44: aload_0
              //   45: getfield 54	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;
              //   48: iconst_0
              //   49: invokestatic 60	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;Z)V
              //   52: aload_2
              //   53: athrow
              //   54: aload_0
              //   55: getfield 54	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;
              //   58: iconst_0
              //   59: invokestatic 60	org/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/DialogErrorReporter;Z)V
              //   62: return
              // Line number table:
              //   Java source line #45	-> byte code offset #0
              //   Java source line #46	-> byte code offset #10
              //   Java source line #47	-> byte code offset #18
              //   Java source line #48	-> byte code offset #25
              //   Java source line #49	-> byte code offset #29
              //   Java source line #48	-> byte code offset #36
              //   Java source line #51	-> byte code offset #43
              //   Java source line #52	-> byte code offset #44
              //   Java source line #53	-> byte code offset #52
              //   Java source line #52	-> byte code offset #54
              //   Java source line #54	-> byte code offset #62
              // Local variable table:
              //   start	length	slot	name	signature
              //   0	63	0	this	1
              //   24	2	1	shell	org.eclipse.swt.widgets.Shell
              //   43	10	2	localObject	Object
              // Exception table:
              //   from	to	target	type
              //   0	43	43	finally
            }
          });
        }
      }
    }
  }
}

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

import com.ibm.icu.text.DateFormat;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.swt.graphics.Image;

class TasksReminderDialog$ReminderTasksLabelProvider
  extends LabelProvider
  implements ITableLabelProvider
{
  public Image getColumnImage(Object element, int columnIndex)
  {
    return null;
  }
  
  public String getColumnText(Object element, int columnIndex)
  {
    if ((element instanceof ITask))
    {
      AbstractTask task = (AbstractTask)element;
      switch (columnIndex)
      {
      case 0: 
        return task.getSummary();
      case 1: 
        return task.getPriority();
      case 2: 
        return DateFormat.getDateInstance(2).format(task.getScheduledForDate());
      }
    }
    return null;
  }
}

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

public enum TasksUiPlugin$ReportOpenMode
{
  EDITOR,  INTERNAL_BROWSER,  EXTERNAL_BROWSER;
}

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

import org.eclipse.jface.action.MenuManager;
import org.eclipse.swt.events.MenuDetectEvent;
import org.eclipse.swt.events.MenuDetectListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;

class TaskTrimWidget$5
  implements MenuDetectListener
{
  TaskTrimWidget$5(TaskTrimWidget paramTaskTrimWidget, Composite paramComposite) {}
  
  public void menuDetected(MenuDetectEvent e)
  {
    if (TaskTrimWidget.access$4(this$0) != null) {
      TaskTrimWidget.access$4(this$0).dispose();
    }
    TaskTrimWidget.access$6(this$0, TaskTrimWidget.access$5(this$0).createContextMenu(val$container));
    TaskTrimWidget.access$4(this$0).setVisible(true);
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractTaskRepositoryLinkProvider;

class TasksUiPlugin$11
  implements ISafeRunnable
{
  TasksUiPlugin$11(TasksUiPlugin paramTasksUiPlugin, AbstractTaskRepositoryLinkProvider paramAbstractTaskRepositoryLinkProvider, IResource paramIResource, TaskRepository paramTaskRepository) {}
  
  public void handleException(Throwable e)
  {
    StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
      "Task repository link provider failed: \"" + val$linkProvider.getId() + "\"", e));
  }
  
  public void run()
    throws Exception
  {
    boolean canSetRepository = val$linkProvider.canSetTaskRepository(val$resource);
    if (canSetRepository) {
      val$linkProvider.setTaskRepository(val$resource, val$repository);
    }
  }
}

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

import java.util.List;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

class TasksReminderDialog$ReminderTasksContentProvider
  implements IStructuredContentProvider
{
  private TasksReminderDialog$ReminderTasksContentProvider(TasksReminderDialog paramTasksReminderDialog) {}
  
  public Object[] getElements(Object inputElement)
  {
    return TasksReminderDialog.access$0(this$0).toArray();
  }
  
  public void dispose() {}
  
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}

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

import java.util.List;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.ui.actions.NewCategoryAction;

class MoveToCategoryMenuContributor$2
  extends NewCategoryAction
{
  MoveToCategoryMenuContributor$2(MoveToCategoryMenuContributor paramMoveToCategoryMenuContributor, List paramList) {}
  
  public void run()
  {
    TaskCategory category = createCategory();
    if (category != null) {
      MoveToCategoryMenuContributor.access$0(this$0, val$selectedElements, category);
    }
  }
}

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

import org.eclipse.mylyn.internal.tasks.ui.views.AbstractTaskListContentProvider;
import org.eclipse.mylyn.internal.tasks.ui.views.AbstractTaskListPresentation;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListContentProvider;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;

public class CategorizedPresentation
  extends AbstractTaskListPresentation
{
  public static final String ID = "org.eclipse.mylyn.tasks.ui.categorized";
  
  public CategorizedPresentation()
  {
    super("org.eclipse.mylyn.tasks.ui.categorized");
  }
  
  protected AbstractTaskListContentProvider createContentProvider(TaskListView taskListView)
  {
    return new TaskListContentProvider(taskListView);
  }
}

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

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractTaskRepositoryLinkProvider;
import org.osgi.service.prefs.BackingStoreException;

public class ProjectPropertiesLinkProvider
  extends AbstractTaskRepositoryLinkProvider
{
  private static final String PROPERTY_PREFIX = "project.repository";
  private static final String PROJECT_REPOSITORY_KIND = "project.repository.kind";
  private static final String PROJECT_REPOSITORY_URL = "project.repository.url";
  
  public TaskRepository getTaskRepository(IResource resource, IRepositoryManager repositoryManager)
  {
    IProject project = resource.getProject();
    if ((project == null) || (!project.isAccessible())) {
      return null;
    }
    IScopeContext projectScope = new ProjectScope(project);
    IEclipsePreferences projectNode = projectScope.getNode("org.eclipse.mylyn.tasks.ui");
    if (projectNode != null)
    {
      String kind = projectNode.get("project.repository.kind", "");
      String urlString = projectNode.get("project.repository.url", "");
      return repositoryManager.getRepository(kind, urlString);
    }
    return null;
  }
  
  public boolean canSetTaskRepository(IResource resource)
  {
    IProject project = resource.getProject();
    return (project != null) && (project.isAccessible());
  }
  
  public boolean setTaskRepository(IResource resource, TaskRepository repository)
  {
    IProject project = resource.getProject();
    if ((project == null) || (!project.isAccessible())) {
      return false;
    }
    IScopeContext projectScope = new ProjectScope(project);
    IEclipsePreferences projectNode = projectScope.getNode("org.eclipse.mylyn.tasks.ui");
    if (projectNode != null)
    {
      if (repository != null)
      {
        projectNode.put("project.repository.kind", repository.getConnectorKind());
        projectNode.put("project.repository.url", repository.getRepositoryUrl());
      }
      else
      {
        projectNode.remove("project.repository.kind");
        projectNode.remove("project.repository.url");
      }
      try
      {
        projectNode.flush();
        return true;
      }
      catch (BackingStoreException e)
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
          "Failed to save task repository to project association preference", e));
      }
    }
    return false;
  }
}

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

import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.actions.AddRepositoryAction;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesSorter;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoryLabelProvider;
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.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.IDecoratorManager;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PropertyPage;
import org.eclipse.ui.internal.dialogs.DialogUtil;

public class ProjectTaskRepositoryPage
  extends PropertyPage
{
  private static final int REPOSITORY_LIST_MULTIPLIER = 30;
  private IProject project;
  private boolean modified = false;
  private CheckboxTableViewer listViewer;
  
  protected Control createContents(Composite parent)
  {
    Font font = parent.getFont();
    
    Composite composite = new Composite(parent, 0);
    GridLayout layout = new GridLayout();
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(768));
    composite.setFont(font);
    
    initialize();
    
    Label description = createDescriptionLabel(composite);
    description.setLayoutData(new GridData(4, 128, true, false));
    
    listViewer = CheckboxTableViewer.newCheckList(composite, 2176);
    listViewer.getTable().setFont(font);
    GridData data = new GridData(1808);
    grabExcessHorizontalSpace = true;
    if (DialogUtil.inRegularFontMode(parent)) {
      heightHint = getDefaultFontHeight(listViewer.getTable(), 30);
    }
    listViewer.getTable().setLayoutData(data);
    listViewer.getTable().setFont(font);
    
    listViewer.setLabelProvider(new DecoratingLabelProvider(new TaskRepositoryLabelProvider(), 
      PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
    listViewer.setContentProvider(new IStructuredContentProvider()
    {
      public void inputChanged(Viewer v, Object oldInput, Object newInput) {}
      
      public void dispose() {}
      
      public Object[] getElements(Object parent)
      {
        return TasksUi.getRepositoryManager().getAllRepositories().toArray();
      }
    });
    listViewer.setSorter(new TaskRepositoriesSorter());
    listViewer.setInput(project.getWorkspace());
    
    listViewer.addCheckStateListener(new ICheckStateListener()
    {
      public void checkStateChanged(CheckStateChangedEvent event)
      {
        if (event.getChecked())
        {
          listViewer.setAllChecked(false);
          listViewer.setChecked(event.getElement(), event.getChecked());
        }
        modified = true;
      }
    });
    updateLinkedRepository();
    
    final AddRepositoryAction action = new AddRepositoryAction();
    action.setPromptToAddQuery(false);
    
    Button button = new Button(composite, 0);
    button.setLayoutData(new GridData(34));
    button.setText(AddRepositoryAction.TITLE);
    button.setEnabled(action.isEnabled());
    button.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent e)
      {
        TaskRepository taskRepository = action.showWizard();
        if (taskRepository != null)
        {
          listViewer.setInput(project.getWorkspace());
          listViewer.setSelection(new StructuredSelection(taskRepository));
          updateLinkedRepository();
        }
      }
    });
    return composite;
  }
  
  void updateLinkedRepository()
  {
    TaskRepository repository = TasksUiPlugin.getDefault().getRepositoryForResource(project);
    if (repository != null) {
      listViewer.setCheckedElements(new Object[] { repository });
    }
    listViewer.getControl().setEnabled(TasksUiPlugin.getDefault().canSetRepositoryForResource(project));
  }
  
  private static int getDefaultFontHeight(Control control, int lines)
  {
    FontData[] viewerFontData = control.getFont().getFontData();
    int fontHeight = 10;
    if (viewerFontData.length > 0) {
      fontHeight = viewerFontData[0].getHeight();
    }
    return lines * fontHeight;
  }
  
  private void initialize()
  {
    project = ((IProject)getElement().getAdapter(IResource.class));
    noDefaultAndApplyButton();
    setDescription(Messages.ProjectTaskRepositoryPage_Select_a_task_repository_to_associate_with_this_project_below);
  }
  
  public boolean performOk()
  {
    if (!modified) {
      return true;
    }
    if (listViewer.getCheckedElements().length > 0)
    {
      TaskRepository selectedRepository = (TaskRepository)listViewer.getCheckedElements()[0];
      TasksUiPlugin.getDefault().setRepositoryForResource(project, selectedRepository);
    }
    else
    {
      TasksUiPlugin.getDefault().setRepositoryForResource(project, null);
    }
    return true;
  }
}

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

import java.util.List;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.ui.TasksUi;

class ProjectTaskRepositoryPage$1
  implements IStructuredContentProvider
{
  ProjectTaskRepositoryPage$1(ProjectTaskRepositoryPage paramProjectTaskRepositoryPage) {}
  
  public void inputChanged(Viewer v, Object oldInput, Object newInput) {}
  
  public void dispose() {}
  
  public Object[] getElements(Object parent)
  {
    return TasksUi.getRepositoryManager().getAllRepositories().toArray();
  }
}

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

import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;

class ProjectTaskRepositoryPage$2
  implements ICheckStateListener
{
  ProjectTaskRepositoryPage$2(ProjectTaskRepositoryPage paramProjectTaskRepositoryPage) {}
  
  public void checkStateChanged(CheckStateChangedEvent event)
  {
    if (event.getChecked())
    {
      ProjectTaskRepositoryPage.access$0(this$0).setAllChecked(false);
      ProjectTaskRepositoryPage.access$0(this$0).setChecked(event.getElement(), event.getChecked());
    }
    ProjectTaskRepositoryPage.access$1(this$0, true);
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.ui.properties.messages";
  public static String ProjectTaskRepositoryPage_Select_a_task_repository_to_associate_with_this_project_below;
  
  static {}
  
  public static void reloadMessages()
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.tasks.ui.properties.messages", Messages.class);
  }
}

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

import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.internal.tasks.ui.actions.AddRepositoryAction;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class ProjectTaskRepositoryPage$3
  extends SelectionAdapter
{
  ProjectTaskRepositoryPage$3(ProjectTaskRepositoryPage paramProjectTaskRepositoryPage, AddRepositoryAction paramAddRepositoryAction) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    TaskRepository taskRepository = val$action.showWizard();
    if (taskRepository != null)
    {
      ProjectTaskRepositoryPage.access$0(this$0).setInput(ProjectTaskRepositoryPage.access$2(this$0).getWorkspace());
      ProjectTaskRepositoryPage.access$0(this$0).setSelection(new StructuredSelection(taskRepository));
      this$0.updateLinkedRepository();
    }
  }
}

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

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

class ScheduleDatePicker$1
  extends ScheduleTaskMenuContributor
{
  ScheduleDatePicker$1(ScheduleDatePicker paramScheduleDatePicker) {}
  
  protected DateRange getScheduledForDate(AbstractTask singleTaskSelection)
  {
    return ScheduleDatePicker.access$0(this$0);
  }
  
  protected void setScheduledDate(DateRange dateRange)
  {
    if (dateRange != null) {
      ScheduleDatePicker.access$1(this$0, dateRange);
    } else {
      ScheduleDatePicker.access$1(this$0, null);
    }
    ScheduleDatePicker.access$2(this$0);
    ScheduleDatePicker.access$3(this$0);
  }
}

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

import org.eclipse.jface.action.Action;

class ScheduleTaskMenuContributor$2
  extends Action
{
  ScheduleTaskMenuContributor$2(ScheduleTaskMenuContributor paramScheduleTaskMenuContributor) {}
  
  public void run() {}
}

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

import org.eclipse.jface.operation.IRunnableWithProgress;

class TasksUiPlugin$7
  implements IRunnableWithProgress
{
  TasksUiPlugin$7(TasksUiPlugin paramTasksUiPlugin, String paramString) {}
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws java.lang.reflect.InvocationTargetException, java.lang.InterruptedException
  {
    // Byte code:
    //   0: aload_1
    //   1: getstatic 75	org/eclipse/mylyn/internal/tasks/ui/Messages:TasksUiPlugin_Load_Data_Directory	Ljava/lang/String;
    //   4: iconst_m1
    //   5: invokeinterface 87 3 0
    //   10: aload_1
    //   11: invokeinterface 86 1 0
    //   16: ifeq +11 -> 27
    //   19: new 35	java/lang/InterruptedException
    //   22: dup
    //   23: invokespecial 78	java/lang/InterruptedException:<init>	()V
    //   26: athrow
    //   27: invokestatic 84	org/eclipse/mylyn/tasks/ui/TasksUi:getTaskActivityManager	()Lorg/eclipse/mylyn/tasks/core/ITaskActivityManager;
    //   30: invokeinterface 89 1 0
    //   35: aload_0
    //   36: getfield 76	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin$7:val$path	Ljava/lang/String;
    //   39: aload_0
    //   40: getfield 77	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin$7:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin;
    //   43: invokevirtual 82	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getDataDirectory	()Ljava/lang/String;
    //   46: invokevirtual 80	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   49: ifne +21 -> 70
    //   52: aload_0
    //   53: getfield 77	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin$7:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin;
    //   56: invokevirtual 83	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getPreferenceStore	()Lorg/eclipse/jface/preference/IPreferenceStore;
    //   59: ldc 1
    //   61: aload_0
    //   62: getfield 76	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin$7:val$path	Ljava/lang/String;
    //   65: invokeinterface 88 3 0
    //   70: aload_0
    //   71: getfield 77	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin$7:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin;
    //   74: invokevirtual 81	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:initializeDataSources	()V
    //   77: goto +12 -> 89
    //   80: astore_2
    //   81: aload_1
    //   82: invokeinterface 85 1 0
    //   87: aload_2
    //   88: athrow
    //   89: aload_1
    //   90: invokeinterface 85 1 0
    //   95: return
    // Line number table:
    //   Java source line #822	-> byte code offset #0
    //   Java source line #823	-> byte code offset #10
    //   Java source line #824	-> byte code offset #19
    //   Java source line #827	-> byte code offset #27
    //   Java source line #830	-> byte code offset #35
    //   Java source line #831	-> byte code offset #52
    //   Java source line #835	-> byte code offset #70
    //   Java source line #836	-> byte code offset #80
    //   Java source line #838	-> byte code offset #81
    //   Java source line #839	-> byte code offset #87
    //   Java source line #838	-> byte code offset #89
    //   Java source line #840	-> byte code offset #95
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	96	0	this	7
    //   0	96	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   80	8	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	80	80	finally
  }
}

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

import java.util.Set;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.IRepositoryModel;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskReposit
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