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

roxyServiceReference	Lorg/osgi/framework/ServiceReference;
    //   60: invokeinterface 1447 2 0
    //   65: checkcast 603	org/eclipse/core/net/proxy/IProxyService
    //   68: astore_2
    //   69: aload_2
    //   70: ifnull +13 -> 83
    //   73: aload_2
    //   74: aload_0
    //   75: getfield 1191	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:proxyChangeListener	Lorg/eclipse/core/net/proxy/IProxyChangeListener;
    //   78: invokeinterface 1421 2 0
    //   83: aload_1
    //   84: aload_0
    //   85: getfield 1215	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:proxyServiceReference	Lorg/osgi/framework/ServiceReference;
    //   88: invokeinterface 1446 2 0
    //   93: pop
    //   94: aload_0
    //   95: getfield 1216	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:identityServiceTracker	Lorg/osgi/util/tracker/ServiceTracker;
    //   98: ifnull +15 -> 113
    //   101: aload_0
    //   102: getfield 1216	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:identityServiceTracker	Lorg/osgi/util/tracker/ServiceTracker;
    //   105: invokevirtual 1400	org/osgi/util/tracker/ServiceTracker:close	()V
    //   108: aload_0
    //   109: aconst_null
    //   110: putfield 1216	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:identityServiceTracker	Lorg/osgi/util/tracker/ServiceTracker;
    //   113: invokestatic 1392	org/eclipse/ui/PlatformUI:isWorkbenchRunning	()Z
    //   116: ifeq +93 -> 209
    //   119: aload_0
    //   120: invokevirtual 1344	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getPreferenceStore	()Lorg/eclipse/jface/preference/IPreferenceStore;
    //   123: aload_0
    //   124: getfield 1208	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:taskListNotificationManager	Lorg/eclipse/mylyn/internal/tasks/ui/TaskListNotificationManager;
    //   127: invokeinterface 1438 2 0
    //   132: aload_0
    //   133: invokevirtual 1344	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getPreferenceStore	()Lorg/eclipse/jface/preference/IPreferenceStore;
    //   136: aload_0
    //   137: getfield 1207	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:taskListBackupManager	Lorg/eclipse/mylyn/internal/tasks/ui/TaskListBackupManager;
    //   140: invokeinterface 1438 2 0
    //   145: aload_0
    //   146: invokevirtual 1344	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getPreferenceStore	()Lorg/eclipse/jface/preference/IPreferenceStore;
    //   149: aload_0
    //   150: getfield 1193	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:PROPERTY_LISTENER	Lorg/eclipse/jface/util/IPropertyChangeListener;
    //   153: invokeinterface 1438 2 0
    //   158: invokestatic 1281	org/eclipse/mylyn/commons/ui/compatibility/CommonColors:dispose	()V
    //   161: aload_0
    //   162: getfield 1194	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:serviceMessageManager	Lorg/eclipse/mylyn/commons/notifications/feed/ServiceMessageManager;
    //   165: invokevirtual 1279	org/eclipse/mylyn/commons/notifications/feed/ServiceMessageManager:stop	()V
    //   168: aconst_null
    //   169: putstatic 1211	org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:INSTANCE	Lorg/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin;
    //   172: goto +37 -> 209
    //   175: astore_2
    //   176: new 613	org/eclipse/core/runtime/Status
    //   179: dup
    //   180: iconst_4
    //   181: ldc 3
    //   183: ldc_w 532
    //   186: aload_2
    //   187: invokespecial 1270	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   190: invokestatic 1276	org/eclipse/mylyn/commons/core/StatusHandler:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   193: aload_0
    //   194: aload_1
    //   195: invokespecial 1399	org/eclipse/ui/plugin/AbstractUIPlugin:stop	(Lorg/osgi/framework/BundleContext;)V
    //   198: goto +16 -> 214
    //   201: astore_3
    //   202: aload_0
    //   203: aload_1
    //   204: invokespecial 1399	org/eclipse/ui/plugin/AbstractUIPlugin:stop	(Lorg/osgi/framework/BundleContext;)V
    //   207: aload_3
    //   208: athrow
    //   209: aload_0
    //   210: aload_1
    //   211: invokespecial 1399	org/eclipse/ui/plugin/AbstractUIPlugin:stop	(Lorg/osgi/framework/BundleContext;)V
    //   214: return
    // Line number table:
    //   Java source line #753	-> byte code offset #0
    //   Java source line #754	-> byte code offset #7
    //   Java source line #755	-> byte code offset #14
    //   Java source line #757	-> byte code offset #19
    //   Java source line #758	-> byte code offset #26
    //   Java source line #761	-> byte code offset #33
    //   Java source line #762	-> byte code offset #39
    //   Java source line #765	-> byte code offset #48
    //   Java source line #766	-> byte code offset #55
    //   Java source line #767	-> byte code offset #69
    //   Java source line #768	-> byte code offset #73
    //   Java source line #770	-> byte code offset #83
    //   Java source line #772	-> byte code offset #94
    //   Java source line #773	-> byte code offset #101
    //   Java source line #774	-> byte code offset #108
    //   Java source line #777	-> byte code offset #113
    //   Java source line #778	-> byte code offset #119
    //   Java source line #779	-> byte code offset #132
    //   Java source line #780	-> byte code offset #145
    //   Java source line #782	-> byte code offset #158
    //   Java source line #787	-> byte code offset #161
    //   Java source line #788	-> byte code offset #168
    //   Java source line #790	-> byte code offset #175
    //   Java source line #791	-> byte code offset #176
    //   Java source line #792	-> byte code offset #183
    //   Java source line #791	-> byte code offset #187
    //   Java source line #794	-> byte code offset #193
    //   Java source line #793	-> byte code offset #201
    //   Java source line #794	-> byte code offset #202
    //   Java source line #795	-> byte code offset #207
    //   Java source line #794	-> byte code offset #209
    //   Java source line #796	-> byte code offset #214
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	215	0	this	TasksUiPlugin
    //   0	215	1	context	BundleContext
    //   68	6	2	proxyService	IProxyService
    //   175	12	2	e	Exception
    //   201	7	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	172	175	java/lang/Exception
    //   0	193	201	finally
  }
  
  public String getDefaultDataDirectory()
  {
    return 
      ResourcesPlugin.getWorkspace().getRoot().getLocation().toString() + '/' + ".metadata" + '/' + ".mylyn";
  }
  
  public String getDataDirectory()
  {
    return getPreferenceStore().getString("org.eclipse.mylyn.data.dir");
  }
  
  public void setDataDirectory(final String path)
    throws CoreException
  {
    Assert.isNotNull(path);
    IRunnableWithProgress runner = new IRunnableWithProgress()
    {
      /* Error */
      public void run(IProgressMonitor monitor)
        throws InvocationTargetException, 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	IProgressMonitor
        //   80	8	2	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   0	80	80	finally
      }
    };
    IProgressService service = PlatformUI.getWorkbench().getProgressService();
    try
    {
      service.runInUI(service, runner, ITasksCoreConstants.ROOT_SCHEDULING_RULE);
    }
    catch (InvocationTargetException e)
    {
      throw new CoreException(new Status(4, "org.eclipse.mylyn.tasks.ui", "Failed to set data directory", 
        e.getCause()));
    }
    catch (InterruptedException localInterruptedException)
    {
      throw new OperationCanceledException();
    }
  }
  
  public void reloadDataDirectory()
    throws CoreException
  {
    setDataDirectory(getDataDirectory());
  }
  
  public void initializeDataSources()
  {
    File storeFile = new File(getDataDirectory(), "contexts");
    if (!storeFile.exists()) {
      storeFile.mkdirs();
    }
    taskDataManager.setDataPath(getDataDirectory());
    externalizationManager.setRootFolderPath(getDataDirectory());
    getContextStore().setDirectory(new File(getDataDirectory(), "tasks"));
    
    externalizationManager.load();
    
    loadTemplateRepositories();
    
    taskActivityManager.clear();
    taskActivityMonitor.loadActivityTime();
    taskActivityManager.reloadPlanningData();
    ITask task;
    if ((!activationHistoryFile.exists()) && (taskActivityManager.getTaskActivationHistory().getSize() == 0))
    {
      List<ITask> tasks = taskActivityMonitor.getActivationHistory();
      for (Iterator localIterator = tasks.iterator(); localIterator.hasNext();)
      {
        task = (ITask)localIterator.next();
        taskActivityManager.getTaskActivationHistory().addTask((AbstractTask)task);
      }
    }
    if (!MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean("org.eclipse.mylyn.monitor.activity.tracking.enabled.checked"))
    {
      if (!taskActivityMonitor.getActivationHistory().isEmpty()) {
        MonitorUiPlugin.getDefault().getPreferenceStore().setValue("org.eclipse.mylyn.monitor.activity.tracking.enabled", true);
      }
      MonitorUiPlugin.getDefault().getPreferenceStore().setValue("org.eclipse.mylyn.monitor.activity.tracking.enabled.checked", true);
      MonitorUiPlugin.getDefault().savePluginPreferences();
    }
    for (final IRepositoryModelListener listener : listeners) {
      SafeRunner.run(new ISafeRunnable()
      {
        public void handleException(Throwable exception)
        {
          StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.ui", "Listener failed: " + 
            listener.getClass(), exception));
        }
        
        public void run()
          throws Exception
        {
          listener.loaded();
        }
      });
    }
  }
  
  private void initializePreferences(IPreferenceStore store)
  {
    store.setDefault("org.eclipse.mylyn.data.dir", getDefaultDataDirectory());
    store.setDefault("org.eclipse.mylyn.tasks.ui.group.subtasks", true);
    store.setDefault("org.eclipse.mylyn.tasks.ui.notifications.enabled", true);
    store.setDefault("org.eclipse.mylyn.tasks.ui.messages.enabled", false);
    store.setDefault("org.eclipse.mylyn.tasks.ui.filters.priority", ITask.PriorityLevel.P5.toString());
    store.setDefault("org.eclipse.mylyn.tasks.ui.reporting.open.editor", true);
    store.setDefault("org.eclipse.mylyn.tasks.ui.editor.currentLineHighlight", false);
    store.setDefault("org.eclipse.mylyn.tasks.ui.activate.when.opened", false);
    store.setDefault("org.eclipse.mylyn.tasks.ui.show.trim", false);
    
    store.setToDefault("org.eclipse.mylyn.tasks.ui.subtasks.local");
    store.setDefault("org.eclipse.mylyn.tasks.ui.strikethrough.for.completed", true);
    
    store.setDefault("org.eclipse.mylyn.tasks.ui.repositories.synch.schedule", true);
    store.setDefault("org.eclipse.mylyn.tasks.ui.repositories.synch.schedule.miliseconds", "1200000");
    
    store.setDefault("org.eclipse.mylyn.tasks.ui.backup.maxfiles", 20);
    store.setDefault("org.eclipse.mylyn.tasks.ui.backup.last", 0.0F);
    
    store.setDefault("org.eclipse.mylyn.tasks.ui.filters.hidden", true);
    store.setDefault("org.eclipse.mylyn.tasks.ui.filters.archive", true);
    store.setDefault("org.eclipse.mylyn.tasks.ui.activation.multipe", false);
    store.setValue("org.eclipse.mylyn.tasks.ui.activation.multipe", false);
    
    store.setDefault("org.eclipse.mylyn.tasks.ui.planning.week.start.day", Calendar.getInstance().getFirstDayOfWeek());
    
    store.setDefault("org.eclipse.mylyn.tasks.ui.planning.end.hour", 18);
    
    store.setDefault("org.eclipse.mylyn.tasks.ui.auto.expand", true);
    store.setDefault("org.eclipse.mylyn.tasks.ui.task.list.tool.tip", true);
    
    store.setDefault("org.eclipse.mylyn.tasks.ui.servicemessage.url", "http://eclipse.org/mylyn/updates.xml");
  }
  
  public static TaskActivityManager getTaskActivityManager()
  {
    return taskActivityManager;
  }
  
  public static TaskListNotificationManager getTaskListNotificationManager()
  {
    return INSTANCEtaskListNotificationManager;
  }
  
  public static TasksUiPlugin getDefault()
  {
    return INSTANCE;
  }
  
  public boolean groupSubtasks(ITaskContainer element)
  {
    boolean groupSubtasks = getDefault()
      .getPreferenceStore()
      .getBoolean("org.eclipse.mylyn.tasks.ui.group.subtasks");
    if ((element instanceof ITask))
    {
      AbstractRepositoryConnectorUi connectorUi = getConnectorUi(((ITask)element).getConnectorKind());
      if ((connectorUi != null) && 
        (connectorUi.hasStrictSubtaskHierarchy())) {
        groupSubtasks = true;
      }
    }
    if ((element instanceof IRepositoryQuery))
    {
      AbstractRepositoryConnectorUi connectorUi = getConnectorUi(((IRepositoryQuery)element).getConnectorKind());
      if ((connectorUi != null) && 
        (connectorUi.hasStrictSubtaskHierarchy())) {
        groupSubtasks = true;
      }
    }
    return groupSubtasks;
  }
  
  private final Map<String, List<IDynamicSubMenuContributor>> menuContributors = new HashMap();
  private ServiceTracker identityServiceTracker;
  
  public Map<String, List<IDynamicSubMenuContributor>> getDynamicMenuMap()
  {
    return menuContributors;
  }
  
  public void addDynamicPopupContributor(String menuPath, IDynamicSubMenuContributor contributor)
  {
    List<IDynamicSubMenuContributor> contributors = (List)menuContributors.get(menuPath);
    if (contributors == null)
    {
      contributors = new ArrayList();
      menuContributors.put(menuPath, contributors);
    }
    contributors.add(contributor);
  }
  
  public String[] getSaveOptions()
  {
    String[] options = { TaskListSaveMode.ONE_HOUR.toString(), TaskListSaveMode.THREE_HOURS.toString(), 
      TaskListSaveMode.DAY.toString() };
    return options;
  }
  
  public String getBackupFolderPath()
  {
    return getDataDirectory() + '/' + "backup";
  }
  
  public AbstractTaskEditorPageFactory[] getTaskEditorPageFactories()
  {
    return (AbstractTaskEditorPageFactory[])taskEditorPageFactories.toArray(new AbstractTaskEditorPageFactory[0]);
  }
  
  public void addTaskEditorPageFactory(AbstractTaskEditorPageFactory factory)
  {
    Assert.isNotNull(factory);
    taskEditorPageFactories.add(factory);
  }
  
  public void removeTaskEditorPageFactory(AbstractTaskEditorPageFactory factory)
  {
    Assert.isNotNull(factory);
    taskEditorPageFactories.remove(factory);
  }
  
  public static TaskRepositoryManager getRepositoryManager()
  {
    return repositoryManager;
  }
  
  public static RepositoryTemplateManager getRepositoryTemplateManager()
  {
    return INSTANCErepositoryTemplateManager;
  }
  
  public void addBrandingIcon(String repositoryType, Image icon)
  {
    brandingIcons.put(repositoryType, icon);
  }
  
  public Image getBrandingIcon(String repositoryType)
  {
    return (Image)brandingIcons.get(repositoryType);
  }
  
  public void addOverlayIcon(String repositoryType, ImageDescriptor icon)
  {
    overlayIcons.put(repositoryType, icon);
  }
  
  public ImageDescriptor getOverlayIcon(String repositoryType)
  {
    return (ImageDescriptor)overlayIcons.get(repositoryType);
  }
  
  public void addRepositoryLinkProvider(AbstractTaskRepositoryLinkProvider repositoryLinkProvider)
  {
    if (repositoryLinkProvider != null) {
      repositoryLinkProviders.add(repositoryLinkProvider);
    }
  }
  
  public static synchronized TaskListBackupManager getBackupManager()
  {
    if (INSTANCEtaskListBackupManager == null)
    {
      INSTANCEtaskListBackupManager = new TaskListBackupManager(INSTANCE.getBackupFolderPath());
      INSTANCE.getPreferenceStore().addPropertyChangeListener(INSTANCEtaskListBackupManager);
    }
    return INSTANCEtaskListBackupManager;
  }
  
  public void addRepositoryConnectorUi(AbstractRepositoryConnectorUi repositoryConnectorUi)
  {
    if (!repositoryConnectorUiMap.values().contains(repositoryConnectorUi)) {
      repositoryConnectorUiMap.put(repositoryConnectorUi.getConnectorKind(), repositoryConnectorUi);
    }
  }
  
  public static AbstractRepositoryConnector getConnector(String kind)
  {
    return getRepositoryManager().getRepositoryConnector(kind);
  }
  
  public static AbstractRepositoryConnectorUi getConnectorUi(String kind)
  {
    return (AbstractRepositoryConnectorUi)repositoryConnectorUiMap.get(kind);
  }
  
  @Deprecated
  public static TaskListSynchronizationScheduler getSynchronizationScheduler()
  {
    return synchronizationScheduler;
  }
  
  public static TaskDataManager getTaskDataManager()
  {
    return taskDataManager;
  }
  
  public static TaskJobFactory getTaskJobFactory()
  {
    return INSTANCEtaskJobFactory;
  }
  
  public void addDuplicateDetector(AbstractDuplicateDetector duplicateDetector)
  {
    Assert.isNotNull(duplicateDetector);
    duplicateDetectors.add(duplicateDetector);
  }
  
  public Set<AbstractDuplicateDetector> getDuplicateSearchCollectorsList()
  {
    return duplicateDetectors;
  }
  
  public String getRepositoriesFilePath()
  {
    return getDataDirectory() + File.separator + "repositories.xml.zip";
  }
  
  public void addModelListener(IRepositoryModelListener listener)
  {
    listeners.add(listener);
  }
  
  public void removeModelListener(IRepositoryModelListener listener)
  {
    listeners.remove(listener);
  }
  
  public boolean canSetRepositoryForResource(final IResource resource)
  {
    if (resource == null) {
      return false;
    }
    final boolean[] result = new boolean[1];
    final boolean[] found = new boolean[1];
    for (final AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders)
    {
      SafeRunner.run(new ISafeRunnable()
      {
        public void handleException(Throwable e)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
            "Task repository link provider failed: \"" + linkProvider.getId() + "\"", e));
        }
        
        public void run()
          throws Exception
        {
          if (linkProvider.getTaskRepository(resource, TasksUiPlugin.getRepositoryManager()) != null)
          {
            found[0] = true;
            result[0] = linkProvider.canSetTaskRepository(resource);
          }
        }
      });
      if (found[0] != 0) {
        return result[0];
      }
    }
    for (final AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders)
    {
      SafeRunner.run(new ISafeRunnable()
      {
        public void handleException(Throwable e)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
            "Task repository link provider failed: \"" + linkProvider.getId() + "\"", e));
        }
        
        public void run()
          throws Exception
        {
          if (linkProvider.canSetTaskRepository(resource)) {
            result[0] = true;
          }
        }
      });
      if (result[0] != 0) {
        return true;
      }
    }
    return false;
  }
  
  public void setRepositoryForResource(final IResource resource, final TaskRepository repository)
  {
    Assert.isNotNull(resource);
    for (final AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders) {
      SafeRunner.run(new ISafeRunnable()
      {
        public void handleException(Throwable e)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
            "Task repository link provider failed: \"" + linkProvider.getId() + "\"", e));
        }
        
        public void run()
          throws Exception
        {
          boolean canSetRepository = linkProvider.canSetTaskRepository(resource);
          if (canSetRepository) {
            linkProvider.setTaskRepository(resource, repository);
          }
        }
      });
    }
  }
  
  public TaskRepository getRepositoryForResource(final IResource resource)
  {
    Assert.isNotNull(resource);
    long timeout;
    try
    {
      timeout = Long.parseLong(System.getProperty("org.eclipse.mylyn.linkProviderTimeout", 
        "5000"));
    }
    catch (NumberFormatException localNumberFormatException)
    {
      long timeout;
      timeout = 5000L;
    }
    Set<AbstractTaskRepositoryLinkProvider> defectiveLinkProviders = new HashSet();
    for (final AbstractTaskRepositoryLinkProvider linkProvider : repositoryLinkProviders)
    {
      long startTime = System.currentTimeMillis();
      final TaskRepository[] repository = new TaskRepository[1];
      SafeRunnable.run(new ISafeRunnable()
      {
        public void handleException(Throwable e)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", "Task repository link provider failed: \"" + 
            linkProvider.getId() + "\"", e));
        }
        
        public void run()
          throws Exception
        {
          repository[0] = linkProvider.getTaskRepository(resource, TasksUiPlugin.getRepositoryManager());
        }
      });
      long elapsed = System.currentTimeMillis() - startTime;
      if ((timeout >= 0L) && (elapsed > timeout)) {
        defectiveLinkProviders.add(linkProvider);
      }
      if (repository[0] != null) {
        return repository[0];
      }
    }
    if (!defectiveLinkProviders.isEmpty())
    {
      repositoryLinkProviders.removeAll(defectiveLinkProviders);
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.ui", "Repository link provider took over " + timeout + 
        " ms to execute and was timed out: \"" + defectiveLinkProviders + "\""));
    }
    return null;
  }
  
  public static ExternalizationManager getExternalizationManager()
  {
    return externalizationManager;
  }
  
  public static AbstractTaskActivityMonitor getTaskActivityMonitor()
  {
    return INSTANCEtaskActivityMonitor;
  }
  
  public static TaskList getTaskList()
  {
    return taskList;
  }
  
  public static RepositoryModel getRepositoryModel()
  {
    return repositoryModel;
  }
  
  public void addSearchHandler(AbstractSearchHandler searchHandler)
  {
    searchHandlers.add(searchHandler);
  }
  
  public void removeSearchHandler(AbstractSearchHandler searchHandler)
  {
    searchHandlers.remove(searchHandler);
  }
  
  public AbstractSearchHandler getSearchHandler(String connectorKind)
  {
    Assert.isNotNull(connectorKind);
    for (AbstractSearchHandler searchHandler : searchHandlers) {
      if (searchHandler.getConnectorKind().equals(connectorKind)) {
        return searchHandler;
      }
    }
    return null;
  }
  
  public FormColors getFormColors(Display display)
  {
    if (formColors == null)
    {
      formColors = new FormColors(display);
      formColors.markShared();
    }
    return formColors;
  }
  
  public void removeRepositoryLinkProvider(AbstractTaskRepositoryLinkProvider provider)
  {
    repositoryLinkProviders.remove(provider);
  }
  
  public TaskListExternalizer createTaskListExternalizer()
  {
    return new TaskListExternalizer(repositoryModel, repositoryManager);
  }
  
  public static TaskListExternalizationParticipant getTaskListExternalizationParticipant()
  {
    return taskListExternalizationParticipant;
  }
  
  public static TasksUiFactory getUiFactory()
  {
    if (uiFactory == null) {
      uiFactory = new TasksUiFactory();
    }
    return uiFactory;
  }
  
  public void initializeNotificationsAndSynchronization()
  {
    if (initializationCount.incrementAndGet() != 2) {
      return;
    }
    try
    {
      taskListNotificationManager.addNotificationProvider(REMINDER_NOTIFICATION_PROVIDER);
      
      TaskListNotifier taskListNotifier = new TaskListNotifier(getTaskDataManager(), getSynchronizationManger());
      getTaskDataManager().addListener(taskListNotifier);
      taskListNotificationManager.addNotificationProvider(taskListNotifier);
      taskListNotificationManager.startNotification(5000L);
      getPreferenceStore().addPropertyChangeListener(taskListNotificationManager);
    }
    catch (Throwable t)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not initialize notifications", t));
    }
    try
    {
      getBackupManager();
      
      synchronizationScheduler = new TaskListSynchronizationScheduler(taskJobFactory);
      MonitorUiPlugin.getDefault().getActivityContextManager().addListener(synchronizationScheduler);
      updateSynchronizationScheduler(true);
    }
    catch (Throwable t)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
        "Could not initialize task list backup and synchronization", t));
    }
  }
  
  public ServiceMessageManager getServiceMessageManager()
  {
    return serviceMessageManager;
  }
  
  public SynchronizationManger getSynchronizationManger()
  {
    return synchronizationManger;
  }
  
  public IIdentityService getIdentityService()
  {
    if (identityServiceTracker == null)
    {
      identityServiceTracker = new ServiceTracker(getBundle().getBundleContext(), 
        IIdentityService.class.getName(), null);
      identityServiceTracker.open();
    }
    return (IIdentityService)identityServiceTracker.getService();
  }
  
  public static synchronized AbstractTaskContextStore getContextStore()
  {
    if (contextStore == null) {
      contextStore = TasksUiExtensionReader.loadTaskContextStore();
    }
    return contextStore;
  }
  
  public static class TasksUiStartup
    implements IStartup
  {
    public void earlyStartup() {}
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;

class OpenRepositoryTaskJob$4
  implements Runnable
{
  OpenRepositoryTaskJob$4(OpenRepositoryTaskJob paramOpenRepositoryTaskJob, CoreException paramCoreException) {}
  
  public void run()
  {
    TasksUiInternal.displayStatus(Messages.OpenRepositoryTaskJob_Unable_to_open_task, val$e.getStatus());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.OpenRepositoryTaskJob.4
 * 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.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.internal.tasks.core.TaskList;

class TaskListBackupManager$1
  extends Job
{
  TaskListBackupManager$1(TaskListBackupManager paramTaskListBackupManager, String $anonymous0)
  {
    super($anonymous0);
  }
  
  protected IStatus run(IProgressMonitor monitor)
  {
    try
    {
      if (TasksUiPlugin.getTaskList().getAllTasks().size() > 0) {
        this$0.backupNow(false, monitor);
      }
      return Status.OK_STATUS;
    }
    finally
    {
      schedule(1800000L);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.TaskListBackupManager.1
 * 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.Collections;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.actions.NewCategoryAction;
import org.eclipse.mylyn.internal.tasks.ui.util.TaskContainerComparator;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;

public class MoveToCategoryMenuContributor
  implements IDynamicSubMenuContributor
{
  public MenuManager getSubMenuManager(final List<IRepositoryElement> selectedElements)
  {
    MenuManager subMenuManager = new MenuManager(
      Messages.MoveToCategoryMenuContributor_Set_Category_Menu_Item);
    
    List<AbstractTask> selectedTasks = new ArrayList(selectedElements.size());
    for (IRepositoryElement element : selectedElements) {
      if ((element instanceof ITask)) {
        selectedTasks.add((AbstractTask)element);
      }
    }
    subMenuManager.setVisible(!selectedTasks.isEmpty());
    
    List<AbstractTaskCategory> categories = new ArrayList(TasksUiInternal.getTaskList()
      .getCategories());
    Collections.sort(categories, new TaskContainerComparator());
    for (final AbstractTaskCategory category : categories) {
      if (!(category instanceof UnmatchedTaskContainer))
      {
        String text = handleAcceleratorKeys(category.getSummary());
        Action action = new Action(text, 8)
        {
          public void run()
          {
            MoveToCategoryMenuContributor.this.moveToCategory(selectedElements, category);
          }
        };
        action.setImageDescriptor(TasksUiImages.CATEGORY);
        if ((selectedTasks.size() == 1) && 
          (category.contains(((AbstractTask)selectedTasks.get(0)).getHandleIdentifier()))) {
          action.setChecked(true);
        }
        subMenuManager.add(action);
      }
    }
    Object action = new NewCategoryAction()
    {
      public void run()
      {
        TaskCategory category = createCategory();
        if (category != null) {
          MoveToCategoryMenuContributor.this.moveToCategory(selectedElements, category);
        }
      }
    };
    subMenuManager.add(new Separator());
    subMenuManager.add((IAction)action);
    return subMenuManager;
  }
  
  public String handleAcceleratorKeys(String text)
  {
    if (text == null) {
      return null;
    }
    int index = text.lastIndexOf('\t');
    if (index == -1) {
      index = text.lastIndexOf('@');
    }
    if (index >= 0) {
      return text.concat("@");
    }
    return text;
  }
  
  private void moveToCategory(List<IRepositoryElement> selectedElements, AbstractTaskCategory category)
  {
    for (IRepositoryElement element : selectedElements) {
      if ((element instanceof ITask)) {
        TasksUiInternal.getTaskList().addTask((AbstractTask)element, category);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.MoveToCategoryMenuContributor
 * 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.core.net.proxy.IProxyChangeEvent;
import org.eclipse.core.net.proxy.IProxyChangeListener;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta.Type;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;

class TasksUiPlugin$4
  implements IProxyChangeListener
{
  TasksUiPlugin$4(TasksUiPlugin paramTasksUiPlugin) {}
  
  public void proxyInfoChanged(IProxyChangeEvent event)
  {
    List<TaskRepository> repositories = TasksUiPlugin.access$8().getAllRepositories();
    for (TaskRepository repository : repositories) {
      if (repository.isDefaultProxyEnabled()) {
        TasksUiPlugin.access$8().notifyRepositorySettingsChanged(repository, 
          new TaskRepositoryDelta(TaskRepositoryDelta.Type.PROYX));
      }
    }
  }
}

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

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

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

import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableFontProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;

public class TaskTableLabelProvider
  extends DecoratingLabelProvider
  implements ITableLabelProvider, ITableColorProvider, ITableFontProvider
{
  private Color categoryBackgroundColor;
  
  public TaskTableLabelProvider(ILabelProvider provider, ILabelDecorator decorator, Color parentBackground)
  {
    super(provider, decorator);
    categoryBackgroundColor = parentBackground;
  }
  
  public String getColumnText(Object obj, int columnIndex)
  {
    if ((obj instanceof ITaskContainer)) {
      switch (columnIndex)
      {
      case 0: 
        return super.getText(obj);
      case 1: 
        return null;
      }
    }
    return null;
  }
  
  public Image getColumnImage(Object element, int columnIndex)
  {
    if (!(element instanceof ITaskContainer)) {
      return null;
    }
    if (columnIndex == 0) {
      return super.getImage(element);
    }
    return null;
  }
  
  public Font getFont(Object element, int columnIndex)
  {
    return super.getFont(element);
  }
  
  public Color getForeground(Object element, int columnIndex)
  {
    return super.getForeground(element);
  }
  
  public Color getBackground(Object element, int columnIndex)
  {
    if (((element instanceof ITaskContainer)) && (!(element instanceof ITask))) {
      return categoryBackgroundColor;
    }
    if ((element instanceof IRepositoryQuery)) {
      return categoryBackgroundColor;
    }
    return super.getBackground(element);
  }
  
  public void setCategoryBackgroundColor(Color parentBackgroundColor)
  {
    categoryBackgroundColor = parentBackgroundColor;
  }
}

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

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

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

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

import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryAdapter;
import org.eclipse.mylyn.tasks.core.TaskRepository;

class TaskRepositoriesView$2
  extends TaskRepositoryAdapter
{
  TaskRepositoriesView$2(TaskRepositoriesView paramTaskRepositoriesView) {}
  
  public void repositoryAdded(TaskRepository repository)
  {
    TaskRepositoriesView.access$0(this$0, new Runnable()
    {
      public void run()
      {
        this$0.refresh();
      }
    });
  }
  
  public void repositoryRemoved(TaskRepository repository)
  {
    TaskRepositoriesView.access$0(this$0, new Runnable()
    {
      public void run()
      {
        this$0.refresh();
      }
    });
  }
  
  public void repositorySettingsChanged(TaskRepository repository)
  {
    TaskRepositoriesView.access$0(this$0, new Runnable()
    {
      public void run()
      {
        this$0.refresh();
      }
    });
  }
}

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

import java.util.Set;
import org.eclipse.mylyn.commons.workbench.DelayedRefreshJob;
import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta;
import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnsubmittedTaskContainer;
import org.eclipse.mylyn.tasks.core.ITaskContainer;

class TaskListView$4$1
  implements Runnabl
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