Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskActivationExternalizationParticipant.java (renamed from org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskActivationExternalizationParticipant.java)27
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties1
6 files changed, 19 insertions, 16 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java
index 792f462b1..b53d2049e 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java
@@ -32,4 +32,7 @@ public class Messages extends NLS {
public static String ExternalizationManager_Task_List_Save_Job;
public static String TaskListExternalizationParticipant_Task_List;
+
+ public static String TaskActivationExternalizationParticipant_Task_Activation_History;
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskActivationExternalizationParticipant.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskActivationExternalizationParticipant.java
index 59d0a32de..a4e2011e2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskActivationExternalizationParticipant.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskActivationExternalizationParticipant.java
@@ -9,28 +9,26 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.internal.tasks.ui;
+package org.eclipse.mylyn.internal.tasks.core.externalization;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.mylyn.commons.core.XmlMemento;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.TaskActivationHistory;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
-import org.eclipse.mylyn.internal.tasks.core.externalization.AbstractExternalizationParticipant;
-import org.eclipse.mylyn.internal.tasks.core.externalization.ExternalizationManager;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivationListener;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.XMLMemento;
/**
* @author Steffen Pingel
@@ -85,9 +83,9 @@ public class TaskActivationExternalizationParticipant extends AbstractExternaliz
if (file.exists()) {
FileReader reader = new FileReader(file);
try {
- XMLMemento memento = XMLMemento.createReadRoot(reader);
- IMemento[] items = memento.getChildren("task"); //$NON-NLS-1$
- for (IMemento child : items) {
+ XmlMemento memento = XmlMemento.createReadRoot(reader);
+ XmlMemento[] items = memento.getChildren("task"); //$NON-NLS-1$
+ for (XmlMemento child : items) {
String handle = child.getString("handle"); //$NON-NLS-1$
if (handle != null) {
AbstractTask task = taskList.getTask(handle);
@@ -100,8 +98,11 @@ public class TaskActivationExternalizationParticipant extends AbstractExternaliz
reader.close();
}
}
+ } catch (InvocationTargetException e) {
+ throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN,
+ "Failed to load task activation history", e)); //$NON-NLS-1$
} catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN,
"Failed to load task activation history", e)); //$NON-NLS-1$
}
}
@@ -112,9 +113,9 @@ public class TaskActivationExternalizationParticipant extends AbstractExternaliz
dirty = false;
}
- XMLMemento memento = XMLMemento.createWriteRoot("taskActivationHistory"); //$NON-NLS-1$
+ XmlMemento memento = XmlMemento.createWriteRoot("taskActivationHistory"); //$NON-NLS-1$
for (AbstractTask task : activationHistory.getPreviousTasks()) {
- IMemento child = memento.createChild("task"); //$NON-NLS-1$
+ XmlMemento child = memento.createChild("task"); //$NON-NLS-1$
child.putString("handle", task.getHandleIdentifier()); //$NON-NLS-1$
}
@@ -127,7 +128,7 @@ public class TaskActivationExternalizationParticipant extends AbstractExternaliz
writer.close();
}
} catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN,
"Failed to save task activation history", e)); //$NON-NLS-1$
}
}
@@ -156,7 +157,7 @@ public class TaskActivationExternalizationParticipant extends AbstractExternaliz
}
public void taskDeactivated(ITask task) {
- // ignore
+ // ignore
}
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties
index 50a62ccd1..68b87f4e4 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties
@@ -13,3 +13,4 @@ ExternalizationManager_Saving_=Saving...
ExternalizationManager_Task_List_Save_Job=Task List Save Job
TaskListExternalizationParticipant_Task_List=Task List
+TaskActivationExternalizationParticipant_Task_Activation_History=Task Activation History
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java
index 7bbc1825a..b7ecac90f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java
@@ -69,8 +69,6 @@ public class Messages extends NLS {
public static String ScheduleTaskMenuContributor_Schedule_for;
- public static String TaskActivationExternalizationParticipant_Task_Activation_History;
-
public static String TaskAttachmentEditorViewer_Do_not_warn_me_again;
public static String TaskAttachmentEditorViewer_Open_Attachment;
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 a059fefe8..852709636 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
@@ -83,6 +83,7 @@ import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataStore;
import org.eclipse.mylyn.internal.tasks.core.externalization.ExternalizationManager;
import org.eclipse.mylyn.internal.tasks.core.externalization.IExternalizationParticipant;
+import org.eclipse.mylyn.internal.tasks.core.externalization.TaskActivationExternalizationParticipant;
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizationParticipant;
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer;
import org.eclipse.mylyn.internal.tasks.core.util.TaskRepositoryKeyringMigrator;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties
index ad28d642f..d7882bdc2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties
@@ -41,7 +41,6 @@ ScheduleTaskMenuContributor_Future=Future
ScheduleTaskMenuContributor_Not_Scheduled=Not Scheduled
ScheduleTaskMenuContributor_Schedule_for=Schedule for
-TaskActivationExternalizationParticipant_Task_Activation_History=Task Activation History
TaskHistoryDropDown_Activate_Task_=Activate Task...
TaskHistoryDropDown_Deactivate_Task=Deactivate Task
TaskHistoryDropDown_Open_Active_Task=Open Active Task

Back to the top