Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2014-03-25 14:18:03 +0000
committerSteffen Pingel2014-03-26 07:45:13 +0000
commit604234eb263e3bf3981a715500d36e5d7be293be (patch)
tree1cd0e7e2dfe10db6ea497f23cfad2dbe5c515a3d /org.eclipse.mylyn.tasks.ui
parentfe57c91b477700aa2c10ae658d31aefb703accbf (diff)
downloadorg.eclipse.mylyn.tasks-604234eb263e3bf3981a715500d36e5d7be293be.tar.gz
org.eclipse.mylyn.tasks-604234eb263e3bf3981a715500d36e5d7be293be.tar.xz
org.eclipse.mylyn.tasks-604234eb263e3bf3981a715500d36e5d7be293be.zip
316253: move loading of task activity extension into core
Change-Id: I3cc373119f7a19f69a2b4391f94ffc0b64d56935 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=316253
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java46
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java82
2 files changed, 27 insertions, 101 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
index 852709636..dcf5828a4 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
@@ -127,7 +127,7 @@ import org.osgi.util.tracker.ServiceTracker;
/**
* Main entry point for the Tasks UI.
- *
+ *
* @author Mik Kersten
* @since 3.0
*/
@@ -432,7 +432,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
// Needs to happen asynchronously to avoid bug 159706
for (AbstractTask task : taskList.getAllTasks()) {
if (task.isActive()) {
- // the externalizer might set multiple tasks active
+ // the externalizer might set multiple tasks active
task.setActive(false);
if (activateTask) {
// make sure only one task is activated
@@ -570,7 +570,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
try {
// initialize framework and settings
if (DEBUG_HTTPCLIENT) {
- // do this before anything else, once commons logging is initialized and an instance
+ // do this before anything else, once commons logging is initialized and an instance
// of Log has been created it's too late
initHttpLogging();
}
@@ -644,7 +644,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
taskJobFactory = new TaskJobFactory(taskList, taskDataManager, repositoryManager, repositoryModel);
- taskActivityMonitor = TasksUiExtensionReader.loadTaskActivityMonitor();
+ taskActivityMonitor = TasksCoreExtensionReader.loadTaskActivityMonitor();
taskActivityMonitor.start(taskActivityManager);
saveParticipant = new ISaveParticipant() {
@@ -680,7 +680,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
migrateCredentials(repositoryManager.getAllRepositories());
- // make this available early for clients that are not initialized through tasks ui but need access
+ // make this available early for clients that are not initialized through tasks ui but need access
taskListNotificationManager = new TaskListNotificationManager();
String lastMod = getPreferenceStore().getString(
@@ -692,16 +692,16 @@ public class TasksUiPlugin extends AbstractUIPlugin {
serviceMessageManager = new ServiceMessageManager(serviceMessageUrl, lastMod, etag, checktime,
new NotificationEnvironment() {
- private Set<String> installedFeatures;
+ private Set<String> installedFeatures;
- @Override
- public Set<String> getInstalledFeatures(IProgressMonitor monitor) {
- if (installedFeatures == null) {
- installedFeatures = DiscoveryUi.createInstallJob().getInstalledFeatures(monitor);
- }
- return installedFeatures;
- }
- });
+ @Override
+ public Set<String> getInstalledFeatures(IProgressMonitor monitor) {
+ if (installedFeatures == null) {
+ installedFeatures = DiscoveryUi.createInstallJob().getInstalledFeatures(monitor);
+ }
+ return installedFeatures;
+ }
+ });
// Disabled for initial 3.4 release as per bug#263528
if (getPreferenceStore().getBoolean(ITasksUiPreferenceConstants.SERVICE_MESSAGES_ENABLED)) {
@@ -833,7 +833,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
/**
* Returns the local task repository. If the repository does not exist it is created and added to the task
* repository manager.
- *
+ *
* @return the local task repository; never <code>null</code>
* @since 3.0
*/
@@ -923,7 +923,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
* Persist <code>path</code> as data directory and loads data from <code>path</code>. This method may block if other
* jobs are running that modify tasks data. This method will only execute after all conflicting jobs have been
* completed.
- *
+ *
* @throws CoreException
* in case setting of the data directory did not complete normally
* @throws OperationCanceledException
@@ -946,7 +946,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
getPreferenceStore().setValue(ITasksUiPreferenceConstants.PREF_DATA_DIR, path);
}
- // reload data from new directory
+ // reload data from new directory
initializeDataSources();
} finally {
// FIXME roll back preferences change in case of an error?
@@ -1010,12 +1010,12 @@ public class TasksUiPlugin extends AbstractUIPlugin {
if (!taskActivityMonitor.getActivationHistory().isEmpty()) {
// tasks have been active before so fore preference enabled
MonitorUiPlugin.getDefault()
- .getPreferenceStore()
- .setValue(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED, true);
+ .getPreferenceStore()
+ .setValue(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED, true);
}
MonitorUiPlugin.getDefault()
- .getPreferenceStore()
- .setValue(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED + ".checked", true); //$NON-NLS-1$
+ .getPreferenceStore()
+ .setValue(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED + ".checked", true); //$NON-NLS-1$
MonitorUiPlugin.getDefault().savePluginPreferences();
}
@@ -1313,7 +1313,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
/**
* Associate a Task Repository with a workbench project
- *
+ *
* @param resource
* project or resource belonging to a project
* @param repository
@@ -1456,7 +1456,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
public void initializeNotificationsAndSynchronization() {
// this method is invoked by the tasks ui initialization job and the task list view
- // only proceed if both calls have been made
+ // only proceed if both calls have been made
if (initializationCount.incrementAndGet() != 2) {
return;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
index b362e513e..2112be840 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
@@ -23,10 +23,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.internal.tasks.core.activity.DefaultTaskActivityMonitor;
-import org.eclipse.mylyn.internal.tasks.core.context.DefaultTaskContextStore;
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer;
import org.eclipse.mylyn.internal.tasks.core.util.ContributorBlackList;
import org.eclipse.mylyn.internal.tasks.core.util.RepositoryConnectorExtensionReader;
@@ -36,13 +33,10 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.views.AbstractTaskListPresentation;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.AbstractDuplicateDetector;
-import org.eclipse.mylyn.tasks.core.activity.AbstractTaskActivityMonitor;
-import org.eclipse.mylyn.tasks.core.context.AbstractTaskContextStore;
import org.eclipse.mylyn.tasks.core.spi.RepositoryConnectorDescriptor;
import org.eclipse.mylyn.tasks.ui.AbstractTaskRepositoryLinkProvider;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPageFactory;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
@@ -210,7 +204,7 @@ public class TasksUiExtensionReader {
String name = element.getAttribute(ATTR_NAME);
String iconPath = element.getAttribute(ATTR_ICON);
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin( //
+ ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin( //
element.getContributor().getName(), iconPath);
AbstractTaskListPresentation presentation = (AbstractTaskListPresentation) element.createExecutableExtension(ATTR_CLASS);
presentation.setPluginId(element.getNamespaceIdentifier());
@@ -255,7 +249,7 @@ public class TasksUiExtensionReader {
} else {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load repository link provider " //$NON-NLS-1$
- + repositoryLinkProvider.getClass().getCanonicalName()));
+ + repositoryLinkProvider.getClass().getCanonicalName()));
}
} catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
@@ -280,7 +274,7 @@ public class TasksUiExtensionReader {
} else {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load editor page factory " + item.getClass().getCanonicalName() + " must implement " //$NON-NLS-1$ //$NON-NLS-2$
- + AbstractTaskEditorPageFactory.class.getCanonicalName()));
+ + AbstractTaskEditorPageFactory.class.getCanonicalName()));
}
} catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load page editor factory", //$NON-NLS-1$
@@ -298,7 +292,7 @@ public class TasksUiExtensionReader {
} else {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load dynamic popup menu: " + dynamicPopupContributor.getClass().getCanonicalName() //$NON-NLS-1$
- + " must implement " + IDynamicSubMenuContributor.class.getCanonicalName())); //$NON-NLS-1$
+ + " must implement " + IDynamicSubMenuContributor.class.getCanonicalName())); //$NON-NLS-1$
}
} catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
@@ -306,72 +300,4 @@ public class TasksUiExtensionReader {
}
}
- public static AbstractTaskActivityMonitor loadTaskActivityMonitor() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint connectorsExtensionPoint = registry.getExtensionPoint(ITasksCoreConstants.ID_PLUGIN
- + ".activityMonitor"); //$NON-NLS-1$
- IExtension[] extensions = connectorsExtensionPoint.getExtensions();
- for (IExtension extension : extensions) {
- IConfigurationElement[] elements = extension.getConfigurationElements();
- for (IConfigurationElement element : elements) {
- if ("activityMonitor".equals(element.getName())) { //$NON-NLS-1$
- try {
- Object object = element.createExecutableExtension("class"); //$NON-NLS-1$
- if (object instanceof AbstractTaskActivityMonitor) {
- return (AbstractTaskActivityMonitor) object;
- } else {
- StatusHandler.log(new Status(
- IStatus.ERROR,
- ITasksCoreConstants.ID_PLUGIN,
- NLS.bind(
- "Task activity monitor ''{0}'' does not extend expected class for extension contributed by {1}", //$NON-NLS-1$
- object.getClass().getCanonicalName(), element.getContributor().getName())));
- }
- } catch (Throwable e) {
- StatusHandler.log(new Status(
- IStatus.ERROR,
- ITasksCoreConstants.ID_PLUGIN,
- NLS.bind(
- "Task activity monitor failed to load for extension contributed by {0}", element.getContributor().getName()), e)); //$NON-NLS-1$
- }
- }
- }
- }
- return new DefaultTaskActivityMonitor();
- }
-
- public static AbstractTaskContextStore loadTaskContextStore() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint connectorsExtensionPoint = registry.getExtensionPoint(ITasksCoreConstants.ID_PLUGIN
- + ".contextStore"); //$NON-NLS-1$
- IExtension[] extensions = connectorsExtensionPoint.getExtensions();
- for (IExtension extension : extensions) {
- IConfigurationElement[] elements = extension.getConfigurationElements();
- for (IConfigurationElement element : elements) {
- if ("contextStore".equals(element.getName())) { //$NON-NLS-1$
- try {
- Object object = element.createExecutableExtension("class"); //$NON-NLS-1$
- if (object instanceof AbstractTaskContextStore) {
- return (AbstractTaskContextStore) object;
- } else {
- StatusHandler.log(new Status(
- IStatus.ERROR,
- ITasksCoreConstants.ID_PLUGIN,
- NLS.bind(
- "Task context store ''{0}'' does not extend expected class for extension contributed by {1}", //$NON-NLS-1$
- object.getClass().getCanonicalName(), element.getContributor().getName())));
- }
- } catch (Throwable e) {
- StatusHandler.log(new Status(
- IStatus.ERROR,
- ITasksCoreConstants.ID_PLUGIN,
- NLS.bind(
- "Task context store failed to load for extension contributed by {0}", element.getContributor().getName()), e)); //$NON-NLS-1$
- }
- }
- }
- }
- return new DefaultTaskContextStore();
- }
-
}

Back to the top