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

nds SelectionAdapter
{
  TasksUiPreferencePage$8(TasksUiPreferencePage paramTasksUiPreferencePage) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.updateRefreshGroupEnablements();
  }
}

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

import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;

class TasksUiPreferencePage$2
  extends ExpansionAdapter
{
  TasksUiPreferencePage$2(TasksUiPreferencePage paramTasksUiPreferencePage) {}
  
  public void expansionStateChanged(ExpansionEvent e)
  {
    this$0.getControl().getShell().pack();
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.ui.preferences.messages";
  public static String MylynPreferencePage_General_settings_Description;
  public static String MylynPreferencePage_Mylyn_Title;
  public static String TasksUiPreferencePage_Advanced;
  public static String TasksUiPreferencePage_Browse_;
  public static String TasksUiPreferencePage_Change_data_directory;
  public static String TasksUiPreferencePage_Confirm_Task_List_data_directory_change;
  public static String TasksUiPreferencePage_Data_directory_;
  public static String TasksUiPreferencePage_Destination_folder_cannot_be_created;
  public static String TasksUiPreferencePage_Display_notifications_for_overdue_tasks_and_incoming_changes;
  public static String TasksUiPreferencePage_Enable_inactivity_timeouts;
  public static String TasksUiPreferencePage_Enable_Time_Tracking;
  public static String TasksUiPreferencePage_Error_applying_Task_List_data_directory_changes;
  public static String TasksUiPreferencePage_Folder_Selection;
  public static String TasksUiPreferencePage_If_disabled;
  public static String TasksUiPreferencePage_minutes;
  public static String TasksUiPreferencePage_minutes_of_inactivity;
  public static String TasksUiPreferencePage_A_new_empty_Task_List_will_be_created_in_the_chosen_directory_if_one_does_not_already_exists;
  public static String TasksUiPreferencePage_highlight_current_line;
  public static String TasksUiPreferencePage_Rich_Editor__Recommended_;
  public static String TasksUiPreferencePage_Scheduling;
  public static String TasksUiPreferencePage_See_X_for_configuring_Task_List_colors;
  public static String TasksUiPreferencePage_Show_active_task_trim_Button_Label;
  public static String TasksUiPreferencePage_Show_tooltip_on_hover_Label;
  public static String TasksUiPreferencePage_Specify_the_folder_for_tasks;
  public static String TasksUiPreferencePage_Stop_time_accumulation_after;
  public static String TasksUiPreferencePage_Synchronize_schedule_time_must_be_GT_0;
  public static String TasksUiPreferencePage_Synchronize_schedule_time_must_be_valid_integer;
  public static String TasksUiPreferencePage_Synchronize_with_repositories_every;
  public static String TasksUiPreferencePage_Synchronization;
  public static String TasksUiPreferencePage_Task_Data;
  public static String TasksUiPreferencePage_Task_Data_Directory_Error;
  public static String TasksUiPreferencePage_Task_Editing;
  public static String TasksUiPreferencePage_Task_List_Group;
  public static String TasksUiPreferencePage_Task_Navigation_Group_Label;
  public static String TasksUiPreferencePage_Task_Timing;
  public static String TasksUiPreferencePage_Track_Time_Spent;
  public static String TasksUiPreferencePage_Use_the_Restore_dialog_to_recover_missing_tasks;
  public static String TasksUiPreferencePage_Web_Browser;
  public static String TasksUiPreferencePage_Week_Start;
  
  static {}
  
  public static void reloadMessages()
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.tasks.ui.preferences.messages", Messages.class);
  }
}

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

import java.io.PrintStream;
import java.util.Date;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.mylyn.commons.core.DateUtil;
import org.eclipse.mylyn.internal.tasks.core.ITaskJobFactory;
import org.eclipse.mylyn.monitor.ui.IUserAttentionListener;
import org.eclipse.mylyn.tasks.core.sync.SynchronizationJob;

public class TaskListSynchronizationScheduler
  implements IUserAttentionListener
{
  private static final boolean TRACE_ENABLED = Boolean.valueOf(Platform.getDebugOption("org.eclipse.mylyn.tasks.ui/debug/synchronization")).booleanValue();
  private long interval;
  private long inactiveInterval;
  private final SynchronizationJob refreshJob;
  private boolean userActive;
  private long scheduledTime;
  private long lastSyncTime;
  private final JobChangeAdapter jobListener;
  
  public TaskListSynchronizationScheduler(ITaskJobFactory jobFactory)
  {
    userActive = true;
    jobListener = new JobChangeAdapter()
    {
      public void done(IJobChangeEvent event)
      {
        jobDone();
      }
    };
    refreshJob = jobFactory.createSynchronizeRepositoriesJob(null);
    
    refreshJob.setSystem(true);
    refreshJob.setUser(false);
    refreshJob.setFullSynchronization(true);
  }
  
  public synchronized SynchronizationJob getRefreshJob()
  {
    return refreshJob;
  }
  
  private synchronized void reschedule()
  {
    long delay = interval;
    if (delay != 0L)
    {
      if (!userActive)
      {
        inactiveInterval *= 3L;
        delay = inactiveInterval;
        if (TRACE_ENABLED) {
          trace("Set inactive interval to " + DateUtil.getFormattedDurationShort(inactiveInterval));
        }
      }
      if (scheduledTime != 0L)
      {
        if (scheduledTime < System.currentTimeMillis() + delay)
        {
          if (TRACE_ENABLED) {
            trace("Synchronization already scheduled in " + DateUtil.getFormattedDurationShort(scheduledTime - System.currentTimeMillis()));
          }
          return;
        }
        cancel();
      }
      schedule(delay);
    }
  }
  
  private synchronized void cancel()
  {
    if (TRACE_ENABLED) {
      trace("Canceling synchronization scheduled to run in " + DateUtil.getFormattedDurationShort(scheduledTime - System.currentTimeMillis()));
    }
    refreshJob.removeJobChangeListener(jobListener);
    refreshJob.cancel();
    refreshJob.addJobChangeListener(jobListener);
  }
  
  private void schedule(long interval)
  {
    if (TRACE_ENABLED) {
      trace("Scheduling synchronization in " + DateUtil.getFormattedDurationShort(interval));
    }
    scheduledTime = (System.currentTimeMillis() + interval);
    refreshJob.schedule(interval);
  }
  
  public synchronized void setInterval(long interval)
  {
    setInterval(interval, interval);
  }
  
  public synchronized void setInterval(long delay, long interval)
  {
    if (this.interval != interval)
    {
      this.interval = interval;
      inactiveInterval = interval;
      scheduledTime = 0L;
      
      cancel();
      if (interval > 0L) {
        schedule(delay);
      }
    }
  }
  
  public void userAttentionGained()
  {
    synchronized (this)
    {
      if (!userActive)
      {
        if (TRACE_ENABLED) {
          trace("User activity detected");
        }
        userActive = true;
        
        inactiveInterval = interval;
        if (interval != 0L) {
          if (System.currentTimeMillis() - lastSyncTime > interval)
          {
            cancel();
            schedule(0L);
          }
          else
          {
            reschedule();
          }
        }
      }
    }
  }
  
  private void trace(String message)
  {
    System.err.println("[" + new Date() + "] " + message);
  }
  
  public void userAttentionLost()
  {
    synchronized (this)
    {
      userActive = false;
    }
  }
  
  synchronized void jobDone()
  {
    scheduledTime = 0L;
    lastSyncTime = System.currentTimeMillis();
    reschedule();
  }
}

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

class TaskTrimWidget$4
  implements Runnable
{
  TaskTrimWidget$4(TaskTrimWidget paramTaskTrimWidget) {}
  
  public void run()
  {
    TaskTrimWidget.access$2(this$0, TaskTrimWidget.access$3(this$0));
  }
}

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

import java.util.Comparator;
import org.eclipse.mylyn.tasks.ui.AbstractTaskRepositoryLinkProvider;

final class TasksUiPlugin$OrderComparator
  implements Comparator<AbstractTaskRepositoryLinkProvider>
{
  public int compare(AbstractTaskRepositoryLinkProvider p1, AbstractTaskRepositoryLinkProvider p2)
  {
    return p1.getOrder() - p2.getOrder();
  }
}

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

import java.util.Comparator;

class PersonProposalProvider$1
  implements Comparator<String>
{
  PersonProposalProvider$1(PersonProposalProvider paramPersonProposalProvider) {}
  
  public int compare(String s1, String s2)
  {
    return s1.compareToIgnoreCase(s2);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.PersonProposalProvider.1
 * 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.ui.AbstractTaskRepositoryLinkProvider;

class TasksUiPlugin$10
  implements ISafeRunnable
{
  TasksUiPlugin$10(TasksUiPlugin paramTasksUiPlugin, AbstractTaskRepositoryLinkProvider paramAbstractTaskRepositoryLinkProvider, IResource paramIResource, boolean[] paramArrayOfBoolean) {}
  
  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
  {
    if (val$linkProvider.canSetTaskRepository(val$resource)) {
      val$result[0] = true;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.10
 * 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.action.Action;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;

class MoveToCategoryMenuContributor$1
  extends Action
{
  MoveToCategoryMenuContributor$1(MoveToCategoryMenuContributor paramMoveToCategoryMenuContributor, String $anonymous0, int $anonymous1, List paramList, AbstractTaskCategory paramAbstractTaskCategory)
  {
    super($anonymous0, $anonymous1);
  }
  
  public void run()
  {
    MoveToCategoryMenuContributor.access$0(this$0, val$selectedElements, val$category);
  }
}

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

import java.util.Collection;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.PresentationFilter;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;

public abstract class AbstractTaskListFilter
{
  public abstract boolean select(Object paramObject1, Object paramObject2);
  
  public boolean applyToFilteredText()
  {
    return false;
  }
  
  public static boolean hasDescendantIncoming(ITaskContainer container)
  {
    return hasDescendantIncoming(container, 10);
  }
  
  public static boolean hasIncompleteDescendant(ITaskContainer container)
  {
    return hasIncompleteDescendant(container, 10);
  }
  
  private static boolean hasDescendantIncoming(ITaskContainer container, int depth)
  {
    Collection<ITask> children = container.getChildren();
    if ((children == null) || (depth <= 0)) {
      return false;
    }
    if (!PresentationFilter.getInstance().select(null, container)) {
      return false;
    }
    for (ITask task : children) {
      if ((task != null) && (PresentationFilter.getInstance().select(container, task)))
      {
        if (TasksUiInternal.shouldShowIncoming(task)) {
          return true;
        }
        if ((TasksUiPlugin.getDefault().groupSubtasks(container)) && ((task instanceof ITaskContainer)) && 
          (hasDescendantIncoming((ITaskContainer)task, depth - 1))) {
          return true;
        }
      }
    }
    return false;
  }
  
  private static boolean hasIncompleteDescendant(ITaskContainer container, int depth)
  {
    Collection<ITask> children = container.getChildren();
    if ((children == null) || (depth <= 0)) {
      return false;
    }
    for (ITask task : children) {
      if (task != null)
      {
        ITask containedRepositoryTask = task;
        if (!containedRepositoryTask.isCompleted()) {
          return true;
        }
        if (((task instanceof ITaskContainer)) && (hasIncompleteDescendant((ITaskContainer)task, depth - 1))) {
          return true;
        }
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter
 * 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$1
  extends Action
{
  ScheduleTaskMenuContributor$1(ScheduleTaskMenuContributor paramScheduleTaskMenuContributor) {}
  
  public void run() {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.ScheduleTaskMenuContributor.1
 * 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.core.runtime.CoreException;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;

public class RefactorRepositoryUrlOperation
  extends TaskListModifyOperation
{
  private final String oldUrl;
  private final String newUrl;
  private final TaskRepository repository;
  
  public RefactorRepositoryUrlOperation(String oldUrl, String newUrl)
  {
    this(null, oldUrl, newUrl);
  }
  
  public RefactorRepositoryUrlOperation(TaskRepository repository, String oldUrl, String newUrl)
  {
    super(ITasksCoreConstants.ROOT_SCHEDULING_RULE);
    Assert.isNotNull(oldUrl);
    Assert.isNotNull(newUrl);
    Assert.isTrue(!oldUrl.equals(newUrl));
    this.repository = repository;
    this.oldUrl = oldUrl;
    this.newUrl = newUrl;
  }
  
  /* Error */
  protected void operations(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws CoreException, java.lang.reflect.InvocationTargetException, java.lang.InterruptedException
  {
    // Byte code:
    //   0: aload_1
    //   1: getstatic 125	org/eclipse/mylyn/internal/tasks/ui/Messages:RefactorRepositoryUrlOperation_Repository_URL_update	Ljava/lang/String;
    //   4: iconst_m1
    //   5: invokeinterface 148 3 0
    //   10: aload_0
    //   11: aload_0
    //   12: getfield 127	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:oldUrl	Ljava/lang/String;
    //   15: aload_0
    //   16: getfield 126	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:newUrl	Ljava/lang/String;
    //   19: invokespecial 136	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:refactorOfflineHandles	(Ljava/lang/String;Ljava/lang/String;)V
    //   22: aload_0
    //   23: invokevirtual 135	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:getTaskList	()Lorg/eclipse/mylyn/internal/tasks/core/TaskList;
    //   26: aload_0
    //   27: getfield 127	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:oldUrl	Ljava/lang/String;
    //   30: aload_0
    //   31: getfield 126	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:newUrl	Ljava/lang/String;
    //   34: invokevirtual 133	org/eclipse/mylyn/internal/tasks/core/TaskList:refactorRepositoryUrl	(Ljava/lang/String;Ljava/lang/String;)V
    //   37: invokestatic 141	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getContextStore	()Lorg/eclipse/mylyn/tasks/core/context/AbstractTaskContextStore;
    //   40: aload_0
    //   41: getfield 128	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:repository	Lorg/eclipse/mylyn/tasks/core/TaskRepository;
    //   44: aload_0
    //   45: getfield 127	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:oldUrl	Ljava/lang/String;
    //   48: aload_0
    //   49: getfield 126	org/eclipse/mylyn/internal/tasks/ui/RefactorRepositoryUrlOperation:newUrl	Ljava/lang/String;
    //   52: invokevirtual 143	org/eclipse/mylyn/tasks/core/context/AbstractTaskContextStore:refactorRepositoryUrl	(Lorg/eclipse/mylyn/tasks/core/TaskRepository;Ljava/lang/String;Ljava/lang/String;)V
    //   55: invokestatic 140	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getTaskActivityMonitor	()Lorg/eclipse/mylyn/tasks/core/activity/AbstractTaskActivityMonitor;
    //   58: invokevirtual 142	org/eclipse/mylyn/tasks/core/activity/AbstractTaskActivityMonitor:reloadActivityTime	()V
    //   61: goto +12 -> 73
    //   64: astore_2
    //   65: aload_1
    //   66: invokeinterface 147 1 0
    //   71: aload_2
    //   72: athrow
    //   73: aload_1
    //   74: invokeinterface 147 1 0
    //   79: return
    // Line number table:
    //   Java source line #54	-> byte code offset #0
    //   Java source line #55	-> byte code offset #10
    //   Java source line #56	-> byte code offset #22
    //   Java source line #57	-> byte code offset #37
    //   Java source line #58	-> byte code offset #55
    //   Java source line #59	-> byte code offset #64
    //   Java source line #60	-> byte code offset #65
    //   Java source line #61	-> byte code offset #71
    //   Java source line #60	-> byte code offset #73
    //   Java source line #62	-> byte code offset #79
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	80	0	this	RefactorRepositoryUrlOperation
    //   0	80	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   64	8	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	64	64	finally
  }
  
  private void refactorOfflineHandles(String oldRepositoryUrl, String newRepositoryUrl)
    throws CoreException
  {
    TaskDataManager taskDataManager = TasksUiPlugin.getTaskDataManager();
    for (ITask task : getTaskList().getAllTasks())
    {
      if (oldRepositoryUrl.equals(task.getAttribute("outgoingNewRepositoryUrl"))) {
        taskDataManager.refactorRepositoryUrl(task, task.getRepositoryUrl(), newRepositoryUrl);
      }
      if (task.getRepositoryUrl().equals(oldRepositoryUrl)) {
        taskDataManager.refactorRepositoryUrl(task, newRepositoryUrl, newRepositoryUrl);
      }
    }
  }
}

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

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.commons.workbench.forms.DatePicker;
import org.eclipse.mylyn.commons.workbench.forms.DateSelectionDialog;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.DateRange;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.WeekDateRange;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;

public class ScheduleTaskMenuContributor
  implements IDynamicSubMenuContributor
{
  private AbstractTask singleTaskSelection;
  private final List<IRepositoryElement> taskListElementsToSchedule = new ArrayList();
  
  public MenuManager getSubMenuManager(List<IRepositoryElement> selectedElements)
  {
    singleTaskSelection = null;
    taskListElementsToSchedule.clear();
    
    final MenuManager subMenuManager = new MenuManager(Messages.ScheduleTaskMenuContributor_Schedule_for);
    if (selectedElements.size() == 1)
    {
      IRepositoryElement selectedElement = (IRepositoryElement)selectedElements.get(0);
      if ((selectedElement instanceof ITask)) {
        singleTaskSelection = ((AbstractTask)selectedElement);
      }
    }
    for (IRepositoryElement selectedElement : selectedElements) {
      if ((selectedElement instanceof ITask)) {
        taskListElementsToSchedule.add(selectedElement);
      }
    }
    if (selectionIncludesCompletedTasks())
    {
      Action action = new Action()
      {
        public void run() {}
      };
      action.setText(Messages.ScheduleTaskMenuContributor_Cannot_schedule_completed_tasks);
      action.setEnabled(false);
      subMenuManager.add(action);
      return subMenuManager;
    }
    WeekDateRange week = TaskActivityUtil.getCurrentWeek();
    int days = 0;
    for (DateRange day : week.getDaysOfWeek()) {
      if (day.includes(TaskActivityUtil.getCalendar()))
      {
        days++;
        
        Action action = createDateSelectionAction(day, CommonImages.SCHEDULE_DAY);
        subMenuManager.add(action);
        if ((singleTaskSelection != null) && (isPastReminder(singleTaskSelection))) {
          action.setChecked(true);
        }
      }
      else if (day.after(TaskActivityUtil.getCalendar()))
      {
        days++;
        
        Action action = createDateSelectionAction(day, null);
        subMenuManager.add(action);
      }
    }
    int toAdd = 7 - days;
    WeekDateRange nextWeek = TaskActivityUtil.getNextWeek();
    for (int x = 0; x < toAdd; x++)
    {
      int next = TasksUiPlugin.getTaskActivityManager().getWeekStartDay() + x;
      if (next > 7) {
        next -= 7;
      }
      DateRange day = nextWeek.getDayOfWeek(next);
      Action action = createDateSelectionAction(day, null);
      subMenuManager.add(action);
    }
    subMenuManager.add(new Separator());
    
    Action action = createDateSelectionAction(week, CommonImages.SCHEDULE_WEEK);
    subMenuManager.add(action);
    if (isThisWeek(singleTaskSelection)) {
      action.setChecked(true);
    }
    action = createDateSelectionAction(week.next(), null);
    subMenuManager.add(action);
    
    action = createDateSelectionAction(week.next().next(), null);
    subMenuManager.add(action);
    if ((singleTaskSelection != null) && (getScheduledForDate(singleTaskSelection) != null))
    {
      DateRange range = getScheduledForDate(singleTaskSelection);
      if ((range.equals(TaskActivityUtil.getNextWeek().next())) || 
        (TaskActivityUtil.getNextWeek().next().includes(range))) {
        action.setChecked(true);
      }
      if ((getScheduledForDate(singleTaskSelection).after(week.next().next().getEndDate())) && 
        (!(getScheduledForDate(singleTaskSelection) instanceof WeekDateRange)))
      {
        action = new Action()
        {
          public void run() {}
        };
        action.setChecked(true);
        action.setText(Messages.ScheduleTaskMenuContributor_Future);
        subMenuManager.add(action);
      }
    }
    subMenuManager.add(new Separator());
    
    action = new Action()
    {
      public void run()
      {
        Calendar theCalendar = TaskActivityUtil.getCalendar();
        if (getScheduledForDate(singleTaskSelection) != null) {
          theCalendar.setTime(getScheduledForDate(singleTaskSelection).getStartDate().getTime());
        }
        Shell shell = null;
        if ((subMenuManager != null) && (subMenuManager.getMenu() != null) && 
          (!subMenuManager.getMenu().isDisposed())) {
          shell = subMenuManager.getMenu().getShell();
        }
        if (shell == null) {
          shell = WorkbenchUtil.getShell();
        }
        DateSelectionDialog reminderDialog = new DateSelectionDialog(shell, theCalendar, 
          DatePicker.TITLE_DIALOG, false, TasksUiPlugin.getDefault()
          .getPreferenceStore()
          .getInt("org.eclipse.mylyn.tasks.ui.planning.end.hour"));
        int result = reminderDialog.open();
        if (result == 0)
        {
          DateRange range = null;
          if (reminderDialog.getDate() != null) {
            range = TaskActivityUtil.getDayOf(reminderDialog.getDate());
          }
          setScheduledDate(range);
        }
      }
    };
    action.setText(Messages.ScheduleTaskMenuContributor_Choose_Date_);
    action.setEnabled(canSchedule());
    subMenuManager.add(action);
    
    action = new Action()
    {
      public void run()
      {
        setScheduledDate(null);
      }
    };
    action.setText(Messages.ScheduleTaskMenuContributor_Not_Scheduled);
    action.setChecked(false);
    if ((singleTaskSelection != null) && 
      (getScheduledForDate(singleTaskSelection) == null)) {
      action.setChecked(true);
    }
    subMenuManager.add(action);
    return subMenuManager;
  }
  
  private boolean isThisWeek(AbstractTask task)
  {
    return (task != null) && (task.getScheduledForDate() != null) && ((task.getScheduledForDate() instanceof WeekDateRange)) && (task.getScheduledForDate().isBefore(TaskActivityUtil.getCurrentWeek()));
  }
  
  private boolean selectionIncludesCompletedTasks()
  {
    if (((singleTaskSelection instanceof AbstractTask)) && 
      (singleTaskSelection.isCompleted())) {
      return true;
    }
    if (taskListElementsToSchedule.size() > 0) {
      for (IRepositoryElement task : taskListElementsToSchedule) {
        if (((task instanceof AbstractTask)) && 
          (((AbstractTask)task).isCompleted())) {
          return true;
        }
      }
    }
    return false;
  }
  
  private Action createDateSelectionAction(final DateRange dateContainer, ImageDescriptor imageDescriptor)
  {
    Action action = new Action()
    {
      public void run()
      {
        setScheduledDate(dateContainer);
      }
    };
    action.setText(dateContainer.toString());
    action.setImageDescriptor(imageDescriptor);
    action.setEnabled(canSchedule());
    
    DateRange scheduledDate = getScheduledForDate(singleTaskSelection);
    if (scheduledDate != null) {
      action.setChecked(dateContainer.equals(scheduledDate));
    }
    return action;
  }
  
  private boolean canSchedule()
  {
    if (taskListElementsToSchedule.size() == 0) {
      return true;
    }
    if ((singleTaskSelection instanceof ITask)) {
      return (!singleTaskSelection.isCompleted()) || (taskListElementsToSchedule.size() > 0);
    }
    return taskListElementsToSchedule.size() > 0;
  }
  
  protected void setScheduledDate(DateRange dateContainer)
  {
    for (IRepositoryElement element : taskListElementsToSchedule) {
      if ((element instanceof AbstractTask))
      {
        AbstractTask task = (AbstractTask)element;
        TasksUiPlugin.getTaskList().addTaskIfAbsent(task);
        if (dateContainer != null) {
          TasksUiPlugin.getTaskActivityManager().setScheduledFor(task, dateContainer);
        } else {
          TasksUiPlugin.getTaskActivityManager().setScheduledFor(task, null);
        }
      }
    }
  }
  
  protected DateRange getScheduledForDate(AbstractTask selectedTask)
  {
    if (selectedTask != null) {
      return selectedTask.getScheduledForDate();
    }
    return null;
  }
  
  private boolean isPastReminder(AbstractTask task)
  {
    return TasksUiPlugin.getTaskActivityManager().isPastReminder(task);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.ScheduleTaskMenuContributor
 * 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.IProgressMonitor;
import org.eclipse.mylyn.commons.notifications.core.NotificationEnvironment;
import org.eclipse.mylyn.internal.discovery.ui.AbstractInstallJob;
import org.eclipse.mylyn.internal.discovery.ui.DiscoveryUi;

class TasksUiPlugin$6
  extends NotificationEnvironment
{
  private Set<String> installedFeatures;
  
  TasksUiPlugin$6(TasksUiPlugin paramTasksUiPlugin) {}
  
  public Set<String> getInstalledFeatures(IProgressMonitor monitor)
  {
    if (installedFeatures == null) {
      installedFeatures = DiscoveryUi.createInstallJob().getInstalledFeatures(monitor);
    }
    return installedFeatures;
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable;

class TaskListModifyOperation$1
  implements ITaskListRunnable
{
  TaskListModifyOperation$1(TaskListModifyOperation paramTaskListModifyOperation, InvocationTargetException[] paramArrayOfInvocationTargetException) {}
  
  /* Error */
  public void execute(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: invokestatic 72	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   3: aload_0
    //   4: getfield 67	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation;
    //   7: getfield 65	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation:rule	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   10: new 32	org/eclipse/core/runtime/SubProgressMonitor
    //   13: dup
    //   14: aload_1
    //   15: iconst_m1
    //   16: invokespecial 71	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   19: invokeinterface 75 3 0
    //   24: aload_0
    //   25: getfield 67	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation;
    //   28: aload_1
    //   29: invokevirtual 73	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation:operations	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   32: goto +60 -> 92
    //   35: astore_2
    //   36: aload_0
    //   37: getfield 66	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation$1:val$ite	[Ljava/lang/reflect/InvocationTargetException;
    //   40: iconst_0
    //   41: aload_2
    //   42: aastore
    //   43: invokestatic 72	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   46: aload_0
    //   47: getfield 67	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation;
    //   50: getfield 65	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation:rule	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   53: invokeinterface 74 2 0
    //   58: goto +49 -> 107
    //   61: astore_2
    //   62: new 31	org/eclipse/core/runtime/OperationCanceledException
    //   65: dup
    //   66: aload_2
    //   67: invokevirtual 68	java/lang/InterruptedException:getMessage	()Ljava/lang/String;
    //   70: invokespecial 70	org/eclipse/core/runtime/OperationCanceledException:<init>	(Ljava/lang/String;)V
    //   73: athrow
    //   74: astore_3
    //   75: invokestatic 72	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   78: aload_0
    //   79: getfield 67	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation;
    //   82: getfield 65	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation:rule	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   85: invokeinterface 74 2 0
    //   90: aload_3
    //   91: athrow
    //   92: invokestatic 72	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   95: aload_0
    //   96: getfield 67	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation;
    //   99: getfield 65	org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation:rule	Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   102: invokeinterface 74 2 0
    //   107: return
    // Line number table:
    //   Java source line #54	-> byte code offset #0
    //   Java source line #55	-> byte code offset #24
    //   Java source line #56	-> byte code offset #35
    //   Java source line #57	-> byte code offset #36
    //   Java source line #61	-> byte code offset #43
    //   Java source line #58	-> byte code offset #61
    //   Java source line #59	-> byte code offset #62
    //   Java source line #60	-> byte code offset #74
    //   Java source line #61	-> byte code offset #75
    //   Java source line #62	-> byte code offset #90
    //   Java source line #61	-> byte code offset #92
    //   Java source line #63	-> byte code offset #107
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	108	0	this	1
    //   0	108	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   35	7	2	e	InvocationTargetException
    //   61	6	2	e	InterruptedException
    //   74	17	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	32	35	java/lang/reflect/InvocationTargetException
    //   0	32	61	java/lang/InterruptedException
    //   0	43	74	finally
    //   61	74	74	finally
  }
}

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

import org.eclipse.mylyn.tasks.core.AbstractRepositoryMigrator;
import org.eclipse.mylyn.tasks.core.TaskRepository;

public class LocalRepositoryMigrator
  extends AbstractRepositoryMigrator
{
  public String getConnectorKind()
  {
    return "local";
  }
  
  public boolean migrateRepository(TaskRepository repository)
  {
    if (repository.getProperty("category") == null)
    {
      repository.setProperty("category", "org.eclipse.mylyn.category.tasks");
      return true;
    }
    return false;
  }
}

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

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivityManager;
import org.eclipse.mylyn.tasks.ui.TasksUi;

public class ActivateTaskHandler
  extends AbstractTaskHandler
{
  public ActivateTaskHandler()
  {
    singleTask = true;
  }
  
  protected void execute(ExecutionEvent event, ITask task)
    throws ExecutionException
  {
    TasksUi.getTaskActivityManager().activateTask(task);
  }
}

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

class GoToUnreadTaskHandler$2
  extends GoToUnreadTaskHandler
{}

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

import java.util.Map;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.HandlerEvent;
import org.eclipse.jface.action.IAction;
import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.IFormPage;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.menus.UIElement;

public class ViewSourceHandler
  extends AbstractHandler
  implements IElementUpdater
{
  private static boolean checked;
  private static ViewSourceHandler instance;
  public static final String VIEW_SOURCE_ACTION = "viewSourceAction";
  
  public ViewSourceHandler()
  {
    instance = this;
  }
  
  public boolean isChecked()
  {
    return checked;
  }
  
  public static void setChecked(boolean checked)
  {
    checked = checked;
    if (instance != null) {
      instance.fireHandlerChanged(new HandlerEvent(instance, true, false));
    }
  }
  
  private Control getFocusControl()
  {
    return PlatformUI.getWorkbench().getDisplay().getFocusControl();
  }
  
  public boolean isEnabled()
  {
    Control focusControl = getFocusControl();
    if (((focusControl instanceof StyledText)) && ((focusControl.getData("viewSourceAction") instanceof IAction))) {
      return true;
    }
    return false;
  }
  
  public Object execute(ExecutionEvent event)
    throws ExecutionException
  {
    IWorkbenchSite site = HandlerUtil.getActiveSite(event);
    if ((site instanceof IEditorSite))
    {
      IWorkbenchPart part = ((IEditorSite)site).getPart();
      if ((part instanceof FormEditor))
      {
        IFormPage page = ((FormEditor)part).getActivePageInstance();
        Control focusedControl = EditorUtil.getFocusControl(page);
        if (focusedControl != null)
        {
          Object data = focusedControl.getData("viewSourceAction");
          if ((data instanceof IAction))
          {
            IAction action = (IAction)data;
            action.setChecked(!action.isChecked());
            action.run();
            setChecked(action.isChecked());
          }
        }
      }
    }
    return null;
  }
  
  public void updateElement(UIElement element, Map parameters)
  {
    element.setChecked(checked);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.commands.ViewSourc
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