Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-22 23:00:26 +0000
committermkersten2007-06-22 23:00:26 +0000
commit09f0db667d81f101a06d6ad664d47d3271371b17 (patch)
treedfafa789f0aafe5e1913031b863b375ecc009acd
parente1302bdc874028bcb074345cdd4fcef3e15d02a7 (diff)
downloadorg.eclipse.mylyn.tasks-09f0db667d81f101a06d6ad664d47d3271371b17.tar.gz
org.eclipse.mylyn.tasks-09f0db667d81f101a06d6ad664d47d3271371b17.tar.xz
org.eclipse.mylyn.tasks-09f0db667d81f101a06d6ad664d47d3271371b17.zip
NEW - bug 193842: [api] review Mylyn 2.0 APIs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193842
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java40
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java8
-rw-r--r--org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java10
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java12
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java148
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java9
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java165
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java25
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java0
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java127
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IAttachmentHandler.java48
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java12
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java106
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java30
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java4
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java14
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OfflineFileStorage.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskFactory.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeEditorAction.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/TaskRepositoryParameterValues.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryAttachmentEditorInput.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/DelegatingTaskExternalizer.java28
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java16
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java18
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoryLabelProvider.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/AbstractRepositoryClientWizard.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizard.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizardPage.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizard.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizardPage.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewAttachmentWizard.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryClientPage.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryPage.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/ContextUiUtil.java36
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java46
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java22
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java30
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java16
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java16
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttachmentTableLabelProvider.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java10
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttributeFactory.java2
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java14
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTask.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java4
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java6
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java6
74 files changed, 591 insertions, 590 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java
index 7906151b0..6f53c99b4 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java
@@ -96,7 +96,7 @@ public class BugzillaAttributeFactory extends AbstractAttributeFactory {
}
@Override
- public boolean getIsHidden(String key) {
+ public boolean isHidden(String key) {
try {
return BugzillaReportElement.valueOf(key.trim().toUpperCase(Locale.ENGLISH)).isHidden();
} catch (IllegalArgumentException e) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
index f079c557b..da1bb30a1 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
@@ -29,11 +29,11 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
import org.eclipse.mylyn.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
import org.eclipse.mylyn.tasks.core.ITaskCollector;
import org.eclipse.mylyn.tasks.core.ITaskFactory;
import org.eclipse.mylyn.tasks.core.QueryHitCollector;
@@ -83,7 +83,7 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public IAttachmentHandler getAttachmentHandler() {
+ public AbstractAttachmentHandler getAttachmentHandler() {
return attachmentHandler;
}
@@ -93,7 +93,7 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getRepositoryType() {
+ public String getConnectorKind() {
return BugzillaCorePlugin.REPOSITORY_KIND;
}
@@ -184,7 +184,7 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
bugzillaTask.setPriority(priority);
// Task Web Url
- String url = getTaskWebUrl(repository.getUrl(), taskData.getId());
+ String url = getTaskUrl(repository.getUrl(), taskData.getId());
if (url != null) {
bugzillaTask.setTaskUrl(url);
}
@@ -422,7 +422,7 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getTaskWebUrl(String repositoryUrl, String taskId) {
+ public String getTaskUrl(String repositoryUrl, String taskId) {
try {
return BugzillaClient.getBugUrlWithoutLogin(repositoryUrl, taskId);
} catch (Exception ex) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java
index 4f8fe4879..ced46f50d 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTask.java
@@ -41,7 +41,7 @@ public class BugzillaTask extends AbstractTask {
}
@Override
- public String getRepositoryKind() {
+ public String getConnectorKind() {
return BugzillaCorePlugin.REPOSITORY_KIND;
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java
index f0a6874ab..475e60fca 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java
@@ -102,7 +102,7 @@ public abstract class AbstractBugzillaTest extends TestCase {
AbstractRepositoryConnector abstractRepositoryClient = manager.getRepositoryConnector(DEFAULT_KIND);
- assertEquals(abstractRepositoryClient.getRepositoryType(), DEFAULT_KIND);
+ assertEquals(abstractRepositoryClient.getConnectorKind(), DEFAULT_KIND);
connector = (BugzillaRepositoryConnector) abstractRepositoryClient;
@@ -136,7 +136,7 @@ public abstract class AbstractBugzillaTest extends TestCase {
protected void synchAndAssertState(Set<AbstractTask> tasks, RepositoryTaskSyncState state) {
for (AbstractTask task : tasks) {
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
- assertEquals(task.getSyncState(), state);
+ assertEquals(task.getSynchronizationState(), state);
}
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
index 650d372d4..901b93bb3 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
@@ -84,7 +84,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
BugzillaTask task = generateLocalTaskAndDownload("1");
assertNotNull(task);
assertNotNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()));
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
BugzillaTask retrievedTask = (BugzillaTask) taskList.getTask(task.getHandleIdentifier());
assertNotNull(retrievedTask);
@@ -163,14 +163,14 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()));
TasksUiPlugin.getTaskListManager().activateTask(task);
File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
sourceContextFile.createNewFile();
sourceContextFile.deleteOnExit();
repository.setAuthenticationCredentials("wrong", "wrong");
try {
- connector.attachContext(repository, task, "", new NullProgressMonitor());
+ connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor());
} catch (CoreException e) {
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
return;
}
fail("Should have failed due to invalid userid and password.");
@@ -203,13 +203,13 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
// After submit task should be in SYNCHRONIZED state
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
RepositoryTaskData taskData2 = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertFalse(taskData2.getLastModified().equals(taskData.getLastModified()));
// Still not read
- assertFalse(taskData2.getLastModified().equals(task.getLastSyncDateStamp()));
+ assertFalse(taskData2.getLastModified().equals(task.getLastReadTimeStamp()));
TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true);
- assertEquals(taskData2.getLastModified(), task.getLastSyncDateStamp());
+ assertEquals(taskData2.getLastModified(), task.getLastReadTimeStamp());
assertTrue(taskData2.getComments().size() > numComments);
// Has no outgoing changes or conflicts yet needs synch
@@ -218,7 +218,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// task.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
TasksUiPlugin.getDefault().getTaskDataManager().remove(task.getRepositoryUrl(), task.getTaskId());
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, false, null);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
RepositoryTaskData bugReport2 = null;
bugReport2 = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertNotNull(bugReport2);
@@ -270,7 +270,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(task);
assertNotNull(taskData);
TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
assertEquals(taskNumber, taskData.getId());
int numAttached = taskData.getAttachments().size();
String fileName = "test-attach-" + System.currentTimeMillis() + ".txt";
@@ -303,7 +303,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// assertFalse(attachmentHandler.uploadAttachment(attachment,
// repository.getUserName(), repository.getPassword(),
// Proxy.NO_PROXY));
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, new NullProgressMonitor());
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
@@ -359,14 +359,14 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
RepositoryTaskData taskData4 = TasksUiPlugin.getDefault().getTaskDataManager().getEditableCopy(task4.getRepositoryUrl(), task4.getTaskId());
assertNotNull(task4);
assertNotNull(taskData4);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task4.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task4.getSynchronizationState());
assertEquals(taskID, taskData4.getId());
BugzillaTask task5 = generateLocalTaskAndDownload("5");
RepositoryTaskData taskData5 = TasksUiPlugin.getDefault().getTaskDataManager().getEditableCopy(task5.getRepositoryUrl(), task5.getTaskId());
assertNotNull(task5);
assertNotNull(taskData5);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task5.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task5.getSynchronizationState());
assertEquals("5", taskData5.getId());
Set<AbstractTask> tasks = new HashSet<AbstractTask>();
@@ -377,7 +377,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// AFTER
// task4's
- TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task5.getLastSyncDateStamp(),
+ TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task5.getLastReadTimeStamp(),
TasksUiPlugin.getDefault().getRepositoriesFilePath());
boolean changed = connector.markStaleTasks(repository, tasks, new NullProgressMonitor());
@@ -434,13 +434,13 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
RepositoryTaskData recentTaskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task7.getRepositoryUrl(), task7.getTaskId());
assertNotNull(recentTaskData);
TasksUiPlugin.getSynchronizationManager().setTaskRead(task7, true);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSynchronizationState());
assertEquals("7", recentTaskData.getId());
Set<AbstractTask> tasks = new HashSet<AbstractTask>();
tasks.add(task7);
- TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task7.getLastSyncDateStamp(),
+ TasksUiPlugin.getRepositoryManager().setSyncTime(repository, task7.getLastReadTimeStamp(),
TasksUiPlugin.getDefault().getRepositoriesFilePath());
assertNotNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, "7"));
@@ -448,8 +448,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(IBugzillaConstants.TEST_BUGZILLA_222_URL, "7"));
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSyncState());
- assertNotNull(task7.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSynchronizationState());
+ assertNotNull(task7.getLastReadTimeStamp());
// Task no longer stored offline
// make an external change
assertNotNull(repository.getUserName());
@@ -467,7 +467,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
TasksUiPlugin.getDefault().getTaskDataManager().clear();
connector.getTaskDataHandler().postTaskData(repository, recentTaskData, new NullProgressMonitor());
TasksUiPlugin.getSynchronizationManager().synchronizeChanged(connector, repository);
- assertEquals(RepositoryTaskSyncState.INCOMING, task7.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task7.getSynchronizationState());
}
public void testTimeTracker222() throws Exception {
@@ -501,14 +501,14 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
RepositoryTaskData bugtaskdata = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(bugtask.getRepositoryUrl(), bugtask.getTaskId());
assertNotNull(bugtaskdata);
assertEquals(taskid + "", bugtaskdata.getId());
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, bugtask.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, bugtask.getSynchronizationState());
Set<AbstractTask> tasks = new HashSet<AbstractTask>();
tasks.add(bugtask);
// synchAndAssertState(tasks, RepositoryTaskSyncState.SYNCHRONIZED);
- TasksUiPlugin.getRepositoryManager().setSyncTime(repository, bugtask.getLastSyncDateStamp(),
+ TasksUiPlugin.getRepositoryManager().setSyncTime(repository, bugtask.getLastReadTimeStamp(),
TasksUiPlugin.getDefault().getRepositoriesFilePath());
// connector.synchronizeChanged(repository);
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java
index acb8eeeaa..960c88fa9 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java
@@ -85,13 +85,13 @@ public class BugzillaTaskListManagerTest extends TestCase {
assertNotNull(tasksReturned);
assertEquals(1, tasksReturned.size());
for (AbstractTask task : tasksReturned) {
- assertTrue(task.hasBeenReminded());
+ assertTrue(task.isReminded());
}
}
public void testRepositoryTaskExternalization() {
BugzillaTask repositoryTask = new BugzillaTask("repo", "1", "label");
- repositoryTask.setKind("kind");
+ repositoryTask.setTaskKind("kind");
manager.getTaskList().moveToContainer(repositoryTask, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory());
manager.saveTaskList();
@@ -116,8 +116,8 @@ public class BugzillaTaskListManagerTest extends TestCase {
// query.setLastRefresh(oldDate);
assertEquals("repositoryUrl", query.getRepositoryUrl());
assertEquals("queryUrl", query.getUrl());
- assertEquals("<never>", query.getLastRefreshTimeStamp());
- query.setLastRefreshTimeStamp("today");
+ assertEquals("<never>", query.getLastSynchronizedTimeStamp());
+ query.setLastSynchronizedStamp("today");
// assertEquals(time, query.getLastSynchronized().getTime());
manager.getTaskList().addQuery(query);
manager.saveTaskList();
@@ -129,7 +129,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
AbstractRepositoryQuery readQuery = manager.getTaskList().getQueries().iterator().next();
assertEquals(query.getUrl(), readQuery.getUrl());
assertEquals(query.getRepositoryUrl(), readQuery.getRepositoryUrl());
- assertEquals("today", query.getLastRefreshTimeStamp());
+ assertEquals("today", query.getLastSynchronizedTimeStamp());
assertEquals("repositoryUrl", readQuery.getRepositoryUrl());
// assertEquals(time, readQuery.getLastSynchronized().getTime());
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java
index c3c2bdbdf..0dfca0666 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java
@@ -62,13 +62,13 @@ public class TaskListNotificationManagerTest extends TestCase {
task0 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-0");
assertNotNull(task0);
- assertTrue(task0.hasBeenReminded());
+ assertTrue(task0.isReminded());
task1 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-1");
assertNotNull(task1);
- assertTrue(task1.hasBeenReminded());
+ assertTrue(task1.isReminded());
task2 = TasksUiPlugin.getTaskListManager().getTaskList().getTask("local-2");
assertNotNull(task2);
- assertTrue(task2.hasBeenReminded());
+ assertTrue(task2.isReminded());
}
@@ -78,7 +78,7 @@ public class TaskListNotificationManagerTest extends TestCase {
TasksUiPlugin.getRepositoryManager().addRepository(repository,
TasksUiPlugin.getDefault().getRepositoriesFilePath());
AbstractTask task = new BugzillaTask("https://bugs.eclipse.org/bugs", "142891", "label");
- assertEquals( RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals( RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
assertFalse(task.isNotified());
TasksUiPlugin.getTaskListManager().getTaskList().addTask(task);
TaskListNotificationManager notificationManager = TasksUiPlugin.getDefault().getTaskListNotificationManager();
diff --git a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
index a23447a24..6eac12faa 100644
--- a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
+++ b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
@@ -305,7 +305,7 @@ public class UiLegendDialog extends PopupDialog {
Collection<AbstractRepositoryConnector> connectors = TasksUiPlugin.getRepositoryManager()
.getRepositoryConnectors();
for (AbstractRepositoryConnector connector : connectors) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(connector.getRepositoryType());
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(connector.getConnectorKind());
if (connectorUi != null) {
List<AbstractTaskContainer> elements = connectorUi.getLegendItems();
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java
index a8b47146b..f160f677a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java
@@ -17,12 +17,12 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
-import org.eclipse.mylyn.tasks.core.ITaskCollector;
import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler;
+import org.eclipse.mylyn.tasks.core.ITaskCollector;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -57,7 +57,7 @@ public class LocalRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public IAttachmentHandler getAttachmentHandler() {
+ public AbstractAttachmentHandler getAttachmentHandler() {
// TODO: Implement local attachments
return null;
}
@@ -74,7 +74,7 @@ public class LocalRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getRepositoryType() {
+ public String getConnectorKind() {
return REPOSITORY_KIND;
}
@@ -97,7 +97,7 @@ public class LocalRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getTaskWebUrl(String repositoryUrl, String taskId) {
+ public String getTaskUrl(String repositoryUrl, String taskId) {
// ignore
return null;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java
index b70740a3f..f3c199b45 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java
@@ -30,7 +30,7 @@ public class LocalTask extends AbstractTask {
}
@Override
- public String getRepositoryKind() {
+ public String getConnectorKind() {
return LocalRepositoryConnector.REPOSITORY_KIND;
}
@@ -38,7 +38,7 @@ public class LocalTask extends AbstractTask {
return true;
}
- public String getLastSyncDateStamp() {
+ public String getLastReadTimeStamp() {
return SYNC_DATE_NOW;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java
index 68dd9dbbd..f77be2d42 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java
@@ -150,8 +150,8 @@ public class ScheduledTaskDelegate extends AbstractTask {
return task.getTaskUrl();
}
- public boolean hasBeenReminded() {
- return task.hasBeenReminded();
+ public boolean isReminded() {
+ return task.isReminded();
}
public boolean hasValidUrl() {
@@ -204,8 +204,8 @@ public class ScheduledTaskDelegate extends AbstractTask {
// task.setHandleIdentifier(taskId);
// }
- public void setKind(String kind) {
- task.setKind(kind);
+ public void setTaskKind(String kind) {
+ task.setTaskKind(kind);
}
public void setNotes(String notes) {
@@ -250,7 +250,7 @@ public class ScheduledTaskDelegate extends AbstractTask {
}
@Override
- public String getRepositoryKind() {
- return task.getRepositoryKind();
+ public String getConnectorKind() {
+ return task.getConnectorKind();
}
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java
index 01cd315da..bc21ca0b6 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java
@@ -9,24 +9,63 @@
package org.eclipse.mylyn.tasks.core;
import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.util.HashSet;
+import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.mylyn.context.core.ContextCorePlugin;
import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
+import org.eclipse.mylyn.internal.tasks.core.TaskDataManager;
+import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState;
/**
+ * Extend to provide facility for downloading files from the task repository.
+ *
* @author Steffen Pingel
+ * @since 2.0
*/
-public abstract class AbstractAttachmentHandler implements IAttachmentHandler {
+public abstract class AbstractAttachmentHandler {
protected static final int BUFFER_SIZE = 1024;
+
+ private TaskDataManager taskDataManager = null;
+ public static final String MESSAGE_ATTACHMENTS_NOT_SUPPORTED = "Attachments not supported by connector: ";
+
+ public static final String MYLAR_CONTEXT_DESCRIPTION_LEGACY = "mylar/context/zip";
+
+ public final static String MYLAR_CONTEXT_FILENAME = "mylyn-context.zip";
+
+ public static final String MYLAR_CONTEXT_DESCRIPTION = "mylyn/context/zip";
+
+ public abstract void uploadAttachment(TaskRepository repository, AbstractTask task, ITaskAttachment attachment,
+ String comment, IProgressMonitor monitor) throws CoreException;
+
+ public abstract InputStream getAttachmentAsStream(TaskRepository repository, RepositoryAttachment attachment,
+ IProgressMonitor monitor) throws CoreException;
+
+ public abstract boolean canUploadAttachment(TaskRepository repository, AbstractTask task);
+
+ public abstract boolean canDownloadAttachment(TaskRepository repository, AbstractTask task);
+
+ public abstract boolean canDeprecate(TaskRepository repository, RepositoryAttachment attachment);
+
+ /**
+ * To deprecate, change the attribute on the RepositoryAttachment and pass
+ * to this method
+ */
+ public abstract void updateAttachment(TaskRepository repository, RepositoryAttachment attachment) throws CoreException;
+
public void downloadAttachment(TaskRepository repository, RepositoryAttachment attachment, OutputStream out,
IProgressMonitor monitor) throws CoreException {
monitor.beginTask("Downloading attachment", IProgressMonitor.UNKNOWN);
@@ -61,4 +100,111 @@ public abstract class AbstractAttachmentHandler implements IAttachmentHandler {
}
}
+ public final boolean hasRepositoryContext(TaskRepository repository, AbstractTask task) {
+ if (repository == null || task == null) {
+ return false;
+ } else {
+ Set<RepositoryAttachment> remoteContextAttachments = getContextAttachments(repository, task);
+ return (remoteContextAttachments != null && remoteContextAttachments.size() > 0);
+ }
+ }
+
+ /**
+ * Implementors of this repositoryOperations must perform it locally without going to the server since it is used
+ * for frequent repositoryOperations such as decoration.
+ *
+ * @return an empty set if no contexts
+ */
+ public final Set<RepositoryAttachment> getContextAttachments(TaskRepository repository, AbstractTask task) {
+ Set<RepositoryAttachment> contextAttachments = new HashSet<RepositoryAttachment>();
+
+ if (taskDataManager != null) {
+ RepositoryTaskData newData = taskDataManager.getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
+ if (newData != null) {
+ for (RepositoryAttachment attachment : newData.getAttachments()) {
+ if (attachment.getDescription().equals(MYLAR_CONTEXT_DESCRIPTION)) {
+ contextAttachments.add(attachment);
+ } else if (attachment.getDescription().equals(MYLAR_CONTEXT_DESCRIPTION_LEGACY)) {
+ contextAttachments.add(attachment);
+ }
+ }
+ }
+ }
+ return contextAttachments;
+ }
+
+ /**
+ * Attaches the associated context to <code>task</code>.
+ *
+ * @return false, if operation is not supported by repository
+ */
+ public final boolean attachContext(TaskRepository repository, AbstractTask task, String longComment,
+ IProgressMonitor monitor) throws CoreException {
+ ContextCorePlugin.getContextManager().saveContext(task.getHandleIdentifier());
+ final File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(
+ task.getHandleIdentifier());
+
+ RepositoryTaskSyncState previousState = task.getSynchronizationState();
+
+ if (sourceContextFile != null && sourceContextFile.exists()) {
+ try {
+ task.setSubmitting(true);
+ task.setSynchronizationState(RepositoryTaskSyncState.OUTGOING);
+ FileAttachment attachment = new FileAttachment(sourceContextFile);
+ attachment.setDescription(AbstractAttachmentHandler.MYLAR_CONTEXT_DESCRIPTION);
+ attachment.setFilename(AbstractAttachmentHandler.MYLAR_CONTEXT_FILENAME);
+ uploadAttachment(repository, task, attachment, longComment, monitor);
+ } catch (CoreException e) {
+ // TODO: Calling method should be responsible for returning
+ // state of task. Wizard will have different behaviour than
+ // editor.
+ task.setSynchronizationState(previousState);
+ throw e;
+ } catch (OperationCanceledException e) {
+ return true;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Retrieves a context stored in <code>attachment</code> from <code>task</code>.
+ *
+ * @return false, if operation is not supported by repository
+ */
+ public final boolean retrieveContext(TaskRepository repository, AbstractTask task, RepositoryAttachment attachment,
+ String destinationPath, IProgressMonitor monitor) throws CoreException {
+
+ File destinationContextFile = ContextCorePlugin.getContextManager().getFileForContext(
+ task.getHandleIdentifier());
+
+ // TODO: add functionality for not overwriting previous context
+ if (destinationContextFile.exists()) {
+ if (!destinationContextFile.delete()) {
+ return false;
+ }
+ }
+ FileOutputStream out;
+ try {
+ out = new FileOutputStream(destinationContextFile);
+ try {
+ downloadAttachment(repository, attachment, out, monitor);
+ } finally {
+ try {
+ out.close();
+ } catch (IOException e) {
+ StatusManager.fail(e, "Could not close context file", false);
+ }
+ }
+ } catch (FileNotFoundException e) {
+ throw new CoreException(new RepositoryStatus(IStatus.ERROR, "org.eclipse.mylyn.tasks.core",
+ RepositoryStatus.ERROR_INTERNAL, "Could not create context file", e));
+ }
+ return true;
+ }
+
+ public void setTaskDataManager(TaskDataManager taskDataManager) {
+ this.taskDataManager = taskDataManager;
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java
index ec4c36c7d..eab845474 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java
@@ -16,24 +16,27 @@ import java.util.Date;
/**
+ * Extend to provide mapping between repository task attribute IDs and native repository IDs.
+ *
* @author Rob Elves
+ * @since 2.0
*/
public abstract class AbstractAttributeFactory implements Serializable {
public RepositoryTaskAttribute createAttribute(String key) {
String mapped = mapCommonAttributeKey(key);
- RepositoryTaskAttribute attribute = new RepositoryTaskAttribute(mapped, getName(mapped), getIsHidden(mapped));
+ RepositoryTaskAttribute attribute = new RepositoryTaskAttribute(mapped, getName(mapped), isHidden(mapped));
attribute.setReadOnly(isReadOnly(mapped));
return attribute;
}
public abstract String mapCommonAttributeKey(String key);
- public abstract boolean getIsHidden(String key);
-
public abstract String getName(String key);
public abstract boolean isReadOnly(String key);
+
+ public abstract boolean isHidden(String key);
/**
* @return null if date cannot be parsed
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
index f265e0be4..9b3ad09de 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
@@ -32,21 +32,15 @@ import org.eclipse.mylyn.internal.tasks.core.TaskDataManager;
import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState;
/**
- * Operations on a task repository
+ * Encapsulates common operations that can be performed on a task repository. Extend to
+ * connect with a Java API or WS API for accessing the repository.
*
* @author Mik Kersten
* @author Rob Elves
+ * @since 2.0
*/
public abstract class AbstractRepositoryConnector {
- public static final String MESSAGE_ATTACHMENTS_NOT_SUPPORTED = "Attachments not supported by connector: ";
-
- public static final String MYLAR_CONTEXT_DESCRIPTION_LEGACY = "mylar/context/zip";
-
- public static final String MYLAR_CONTEXT_DESCRIPTION = "mylyn/context/zip";
-
- public final static String MYLAR_CONTEXT_FILENAME = "mylyn-context.zip";
-
protected Set<RepositoryTemplate> templates = new LinkedHashSet<RepositoryTemplate>();
protected TaskList taskList;
@@ -58,11 +52,22 @@ public abstract class AbstractRepositoryConnector {
public void init(TaskList taskList) {
this.taskList = taskList;
}
+
+ /**
+ * Set upon construction
+ */
+ public void setTaskDataManager(TaskDataManager taskDataManager) {
+ this.taskDataManager = taskDataManager;
+ AbstractAttachmentHandler handler = getAttachmentHandler();
+ if (handler != null) {
+ handler.setTaskDataManager(taskDataManager);
+ }
+ }
/**
* @return null if not supported
*/
- public abstract IAttachmentHandler getAttachmentHandler();
+ public abstract AbstractAttachmentHandler getAttachmentHandler();
/**
* @return null if not supported
@@ -73,7 +78,7 @@ public abstract class AbstractRepositoryConnector {
public abstract String getTaskIdFromTaskUrl(String taskFullUrl);
- public abstract String getTaskWebUrl(String repositoryUrl, String taskId);
+ public abstract String getTaskUrl(String repositoryUrl, String taskId);
public String[] getTaskIdsFromComment(TaskRepository repository, String comment) {
return null;
@@ -179,9 +184,9 @@ public abstract class AbstractRepositoryConnector {
public abstract String getLabel();
/**
- * @return the unique type of the repository, e.g. "bugzilla"
+ * @return the unique kind of the repository, e.g. "bugzilla"
*/
- public abstract String getRepositoryType();
+ public abstract String getConnectorKind();
/**
* Updates the properties of <code>repositoryTask</code>. Invoked when on task synchronization if
@@ -227,14 +232,6 @@ public abstract class AbstractRepositoryConnector {
existingTask.setSummary(queryHit.getSummary());
changed = true;
}
-// if (hasTaskPropertyChanged(existingTask.getCompletionDate(), queryHit.getCompletionDate())) {
-// existingTask.setCompletionDate(queryHit.getCompletionDate());
-// changed = true;
-// }
-// if (hasTaskPropertyChanged(existingTask.getCreationDate(), newTask.getCreationDate())) {
-// existingTask.setCreationDate(newTask.getCreationDate());
-// changed = true;
-// }
if (hasTaskPropertyChanged(existingTask.getDueDate(), queryHit.getDueDate())) {
existingTask.setDueDate(queryHit.getDueDate());
changed = true;
@@ -263,46 +260,12 @@ public abstract class AbstractRepositoryConnector {
return (existingProperty == null) ? true : !existingProperty.equals(newProperty);
}
- public String[] repositoryPropertyNames() {
+ public String[] getPepositoryPropertyNames() {
return new String[] { IRepositoryConstants.PROPERTY_VERSION, IRepositoryConstants.PROPERTY_TIMEZONE,
IRepositoryConstants.PROPERTY_ENCODING };
}
/**
- * Implementors of this repositoryOperations must perform it locally without going to the server since it is used
- * for frequent repositoryOperations such as decoration.
- *
- * @return an empty set if no contexts
- */
- public final Set<RepositoryAttachment> getContextAttachments(TaskRepository repository, AbstractTask task) {
- Set<RepositoryAttachment> contextAttachments = new HashSet<RepositoryAttachment>();
-
- if (taskDataManager != null) {
- RepositoryTaskData newData = taskDataManager.getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
- if (newData != null) {
- for (RepositoryAttachment attachment : newData.getAttachments()) {
- if (attachment.getDescription().equals(MYLAR_CONTEXT_DESCRIPTION)) {
- contextAttachments.add(attachment);
- } else if (attachment.getDescription().equals(MYLAR_CONTEXT_DESCRIPTION_LEGACY)) {
- contextAttachments.add(attachment);
- }
- }
- }
- }
- return contextAttachments;
- }
-
- // TODO: move
- public final boolean hasRepositoryContext(TaskRepository repository, AbstractTask task) {
- if (repository == null || task == null) {
- return false;
- } else {
- Set<RepositoryAttachment> remoteContextAttachments = getContextAttachments(repository, task);
- return (remoteContextAttachments != null && remoteContextAttachments.size() > 0);
- }
- }
-
- /**
* Of <code>tasks</code> provided, return all that have changed since last synchronization of
* <code>repository</code>.
*
@@ -324,85 +287,6 @@ public abstract class AbstractRepositoryConnector {
public abstract boolean markStaleTasks(TaskRepository repository, Set<AbstractTask> tasks, IProgressMonitor monitor)
throws CoreException;
- /**
- * Attaches the associated context to <code>task</code>.
- *
- * @return false, if operation is not supported by repository
- */
- public final boolean attachContext(TaskRepository repository, AbstractTask task, String longComment,
- IProgressMonitor monitor) throws CoreException {
- ContextCorePlugin.getContextManager().saveContext(task.getHandleIdentifier());
- final File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(
- task.getHandleIdentifier());
-
- RepositoryTaskSyncState previousState = task.getSyncState();
-
- if (sourceContextFile != null && sourceContextFile.exists()) {
- IAttachmentHandler handler = getAttachmentHandler();
- if (handler == null) {
- return false;
- }
-
- try {
- task.setSubmitting(true);
- task.setSyncState(RepositoryTaskSyncState.OUTGOING);
- FileAttachment attachment = new FileAttachment(sourceContextFile);
- attachment.setDescription(MYLAR_CONTEXT_DESCRIPTION);
- attachment.setFilename(MYLAR_CONTEXT_FILENAME);
- handler.uploadAttachment(repository, task, attachment, longComment, monitor);
- } catch (CoreException e) {
- // TODO: Calling method should be responsible for returning
- // state of task. Wizard will have different behaviour than
- // editor.
- task.setSyncState(previousState);
- throw e;
- } catch (OperationCanceledException e) {
- return true;
- }
- }
- return true;
- }
-
- /**
- * Retrieves a context stored in <code>attachment</code> from <code>task</code>.
- *
- * @return false, if operation is not supported by repository
- */
- public final boolean retrieveContext(TaskRepository repository, AbstractTask task, RepositoryAttachment attachment,
- String destinationPath, IProgressMonitor monitor) throws CoreException {
- IAttachmentHandler attachmentHandler = getAttachmentHandler();
- if (attachmentHandler == null) {
- return false;
- }
-
- File destinationContextFile = ContextCorePlugin.getContextManager().getFileForContext(
- task.getHandleIdentifier());
-
- // TODO: add functionality for not overwriting previous context
- if (destinationContextFile.exists()) {
- if (!destinationContextFile.delete()) {
- return false;
- }
- }
- FileOutputStream out;
- try {
- out = new FileOutputStream(destinationContextFile);
- try {
- attachmentHandler.downloadAttachment(repository, attachment, out, monitor);
- } finally {
- try {
- out.close();
- } catch (IOException e) {
- StatusManager.fail(e, "Could not close context file", false);
- }
- }
- } catch (FileNotFoundException e) {
- throw new CoreException(new RepositoryStatus(IStatus.ERROR, "org.eclipse.mylyn.tasks.core",
- RepositoryStatus.ERROR_INTERNAL, "Could not create context file", e));
- }
- return true;
- }
-
public void addTemplate(RepositoryTemplate template) {
this.templates.add(template);
}
@@ -425,6 +309,10 @@ public abstract class AbstractRepositoryConnector {
return null;
}
+ /**
+ * Used for referring to the task in the UI.
+ * @return
+ */
public String getTaskIdPrefix() {
return "task";
}
@@ -481,11 +369,4 @@ public abstract class AbstractRepositoryConnector {
return taskDataManager;
}
- /**
- * Set upon construction
- */
- public void setTaskDataManager(TaskDataManager taskDataManager) {
- this.taskDataManager = taskDataManager;
- }
-
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java
index 6c5ebee77..2a4913b56 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java
@@ -14,17 +14,20 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.tasks.core.AbstractTask.PriorityLevel;
/**
+ * Extend to provide a repository query that can be used in the Task List.
+ *
* @author Mik Kersten
* @author Eugene Kuleshov
* @author Rob Elves
+ * @since 2.0
*/
public abstract class AbstractRepositoryQuery extends AbstractTaskContainer {
protected String repositoryUrl;
- protected String lastRefreshTimeStamp = "<never>";
+ protected String lastSynchronizedStamp = "<never>";
- private boolean currentlySynchronizing = false;
+ private boolean synchronizing = false;
protected IStatus status = null;
@@ -61,26 +64,26 @@ public abstract class AbstractRepositoryQuery extends AbstractTaskContainer {
}
public boolean isSynchronizing() {
- return currentlySynchronizing;
+ return synchronizing;
}
- public void setCurrentlySynchronizing(boolean currentlySynchronizing) {
- this.currentlySynchronizing = currentlySynchronizing;
+ public void setSynchronizing(boolean synchronizing) {
+ this.synchronizing = synchronizing;
}
- public String getLastRefreshTimeStamp() {
- return lastRefreshTimeStamp;
+ public String getLastSynchronizedTimeStamp() {
+ return lastSynchronizedStamp;
}
- public void setLastRefreshTimeStamp(String lastRefreshTimeStamp) {
- this.lastRefreshTimeStamp = lastRefreshTimeStamp;
+ public void setLastSynchronizedStamp(String lastRefreshTimeStamp) {
+ this.lastSynchronizedStamp = lastRefreshTimeStamp;
}
- public IStatus getStatus() {
+ public IStatus getSynchronizationStatus() {
return status;
}
- public void setStatus(IStatus status) {
+ public void setSynchronizationStatus(IStatus status) {
this.status = status;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java
deleted file mode 100644
index e69de29bb..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java
+++ /dev/null
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java
index df1511308..813f00bcc 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java
@@ -21,60 +21,63 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil;
/**
+ * Encapsulates tasks that reside on a repository or local computer and participate in synchronization with the source
+ * that contains their data.
+ *
* @author Mik Kersten
* @author Rob Elves
+ * @since 2.0
*/
public abstract class AbstractTask extends AbstractTaskContainer {
-
+
public static final String DEFAULT_TASK_KIND = "task";
-
+
private String repositoryUrl;
- private String kind = DEFAULT_TASK_KIND;
-
+ private String taskKind = DEFAULT_TASK_KIND;
+
private String taskId;
-
+
private String owner;
-
+
private boolean active = false;
-
+
private String summary;
private String priority = PriorityLevel.getDefault().toString();
private boolean completed;
-
+
private boolean isNotifiedIncoming = false;
-
- private boolean hasReminded = false;
+
+ private boolean reminded = false;
private String taskUrl = "";
private Set<AbstractTaskContainer> containers = new HashSet<AbstractTaskContainer>();
-
-
+
// ************ Synch ****************
-
+
/** The last time this task's bug report was in a synchronized (read?) state. */
- private String lastSynchronizedDateStamp;
+ private String lastReadTimeStamp;
- private boolean currentlySynchronizing;
+ private boolean synchronizing;
private boolean submitting;
-
- private RepositoryTaskSyncState syncState = RepositoryTaskSyncState.SYNCHRONIZED;
+
+ private RepositoryTaskSyncState synchronizationState = RepositoryTaskSyncState.SYNCHRONIZED;
// transient
- private IStatus errorStatus = null;
+ private IStatus synchronizationStatus = null;
private boolean stale = false;
-
+
public enum RepositoryTaskSyncState {
OUTGOING, SYNCHRONIZED, INCOMING, CONFLICT
}
-
+
// ************ Planning ****************
-
+
private Date completionDate = null;
private Date creationDate = null;
@@ -82,14 +85,14 @@ public abstract class AbstractTask extends AbstractTaskContainer {
private Date scheduledForDate = null;
private Date dueDate = null;
-
+
private String notes = "";
private int estimatedTimeHours = 1;
-
+
public enum PriorityLevel {
P1, P2, P3, P4, P5;
-
+
@Override
public String toString() {
switch (this) {
@@ -107,7 +110,7 @@ public abstract class AbstractTask extends AbstractTaskContainer {
return "P3";
}
}
-
+
public String getDescription() {
switch (this) {
case P1:
@@ -124,7 +127,7 @@ public abstract class AbstractTask extends AbstractTaskContainer {
return "";
}
}
-
+
public static PriorityLevel fromString(String string) {
if (string.equals("P1"))
return P1;
@@ -138,7 +141,7 @@ public abstract class AbstractTask extends AbstractTaskContainer {
return P5;
return getDefault();
}
-
+
public static PriorityLevel fromDescription(String string) {
if (string == null)
return null;
@@ -154,12 +157,12 @@ public abstract class AbstractTask extends AbstractTaskContainer {
return P5;
return getDefault();
}
-
+
public static PriorityLevel getDefault() {
return P3;
}
}
-
+
public AbstractTask(String repositoryUrl, String taskId, String summary) {
super(RepositoryTaskHandleUtil.getHandle(repositoryUrl, taskId));
this.repositoryUrl = repositoryUrl;
@@ -172,35 +175,35 @@ public abstract class AbstractTask extends AbstractTaskContainer {
}
/**
- * True for tasks that can be modified without a round-trip to a server. For example,
- * such a task can be marked completed via the Task List.
+ * True for tasks that can be modified without a round-trip to a server. For example, such a task can be marked
+ * completed via the Task List.
*/
public abstract boolean isLocal();
-
- public abstract String getRepositoryKind();
- public String getLastSyncDateStamp() {
- return lastSynchronizedDateStamp;
+ public abstract String getConnectorKind();
+
+ public String getLastReadTimeStamp() {
+ return lastReadTimeStamp;
}
- public void setLastSyncDateStamp(String lastSyncDateStamp) {
- this.lastSynchronizedDateStamp = lastSyncDateStamp;
+ public void setLastReadTimeStamp(String lastReadTimeStamp) {
+ this.lastReadTimeStamp = lastReadTimeStamp;
}
- public void setSyncState(RepositoryTaskSyncState syncState) {
- this.syncState = syncState;
+ public void setSynchronizationState(RepositoryTaskSyncState syncState) {
+ this.synchronizationState = syncState;
}
- public RepositoryTaskSyncState getSyncState() {
- return syncState;
+ public RepositoryTaskSyncState getSynchronizationState() {
+ return synchronizationState;
}
public boolean isSynchronizing() {
- return currentlySynchronizing;
+ return synchronizing;
}
- public void setCurrentlySynchronizing(boolean currentlySychronizing) {
- this.currentlySynchronizing = currentlySychronizing;
+ public void setSynchronizing(boolean sychronizing) {
+ this.synchronizing = sychronizing;
}
public boolean isNotified() {
@@ -219,12 +222,12 @@ public abstract class AbstractTask extends AbstractTaskContainer {
this.owner = owner;
}
- public IStatus getStatus() {
- return errorStatus;
+ public IStatus getSynchronizationStatus() {
+ return synchronizationStatus;
}
- public void setStatus(IStatus status) {
- this.errorStatus = status;
+ public void setSynchronizationStatus(IStatus status) {
+ this.synchronizationStatus = status;
}
public final String getTaskId() {
@@ -240,15 +243,13 @@ public abstract class AbstractTask extends AbstractTaskContainer {
}
/**
- * User identifiable key for the task to be used in UI facilities such as
- * label displays and hyperlinked references. Can return the same as the ID
- * (e.g. in the case of Bugzilla). Can return null if no such label exists.
+ * User identifiable key for the task to be used in UI facilities such as label displays and hyperlinked references.
+ * Can return the same as the ID (e.g. in the case of Bugzilla). Can return null if no such label exists.
*/
public String getTaskKey() {
return taskId;
}
-
public boolean isSubmitting() {
return submitting;
}
@@ -276,7 +277,7 @@ public abstract class AbstractTask extends AbstractTaskContainer {
@Override
public boolean equals(Object obj) {
if (obj instanceof AbstractTask && obj != null) {
- return this.getHandleIdentifier().compareTo(((AbstractTask)obj).getHandleIdentifier()) == 0;
+ return this.getHandleIdentifier().compareTo(((AbstractTask) obj).getHandleIdentifier()) == 0;
} else {
return false;
}
@@ -350,7 +351,7 @@ public abstract class AbstractTask extends AbstractTaskContainer {
public void removeParentContainer(AbstractTaskContainer container) {
containers.remove(container);
}
-
+
public Set<AbstractTaskContainer> getParentContainers() {
return containers;
}
@@ -371,12 +372,12 @@ public abstract class AbstractTask extends AbstractTaskContainer {
return scheduledForDate;
}
- public boolean hasBeenReminded() {
- return hasReminded;
+ public boolean isReminded() {
+ return reminded;
}
public void setReminded(boolean reminded) {
- this.hasReminded = reminded;
+ this.reminded = reminded;
}
public Date getCreationDate() {
@@ -424,15 +425,15 @@ public abstract class AbstractTask extends AbstractTaskContainer {
}
public String getTaskKind() {
- return kind;
+ return taskKind;
}
- public void setKind(String kind) {
- this.kind = kind;
+ public void setTaskKind(String kind) {
+ this.taskKind = kind;
}
public int compareTo(AbstractTaskContainer taskListElement) {
- return summary.compareTo(((AbstractTask)taskListElement).summary);
+ return summary.compareTo(((AbstractTask) taskListElement).summary);
}
public Date getDueDate() {
@@ -446,9 +447,9 @@ public abstract class AbstractTask extends AbstractTaskContainer {
public boolean isStale() {
return stale;
}
-
+
public void setStale(boolean stale) {
this.stale = stale;
}
-
+
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IAttachmentHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IAttachmentHandler.java
deleted file mode 100644
index 20667b182..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IAttachmentHandler.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 University Of British Columbia and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.tasks.core;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * @author Mik Kersten
- * @author Rob Elves
- * @author Steffen Pingel
- */
-public interface IAttachmentHandler {
-
- public void uploadAttachment(TaskRepository repository, AbstractTask task, ITaskAttachment attachment,
- String comment, IProgressMonitor monitor) throws CoreException;
-
- public void downloadAttachment(TaskRepository repository, RepositoryAttachment attachment, OutputStream target,
- IProgressMonitor monitor) throws CoreException;
-
- public InputStream getAttachmentAsStream(TaskRepository repository, RepositoryAttachment attachment,
- IProgressMonitor monitor) throws CoreException;
-
- public boolean canUploadAttachment(TaskRepository repository, AbstractTask task);
-
- public boolean canDownloadAttachment(TaskRepository repository, AbstractTask task);
-
- public boolean canDeprecate(TaskRepository repository, RepositoryAttachment attachment);
-
- /**
- * To deprecate, change the attribute on the RepositoryAttachment and pass
- * to this method
- */
- public void updateAttachment(TaskRepository repository, RepositoryAttachment attachment) throws CoreException;
-
-}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
index 11ba1cf60..5ec533438 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
@@ -66,13 +66,13 @@ public class TaskRepositoryManager {
}
public AbstractRepositoryConnector getRepositoryConnector(AbstractTask task) {
- return getRepositoryConnector(task.getRepositoryKind());
+ return getRepositoryConnector(task.getConnectorKind());
}
public void addRepositoryConnector(AbstractRepositoryConnector repositoryConnector) {
if (!repositoryConnectors.values().contains(repositoryConnector)) {
repositoryConnector.init(taskList);
- repositoryConnectors.put(repositoryConnector.getRepositoryType(), repositoryConnector);
+ repositoryConnectors.put(repositoryConnector.getConnectorKind(), repositoryConnector);
}
}
@@ -162,7 +162,7 @@ public class TaskRepositoryManager {
public AbstractRepositoryConnector getConnectorForRepositoryTaskUrl(String url) {
for (AbstractRepositoryConnector connector : getRepositoryConnectors()) {
if (connector.getRepositoryUrlFromTaskUrl(url) != null) {
- for (TaskRepository repository : getRepositories(connector.getRepositoryType())) {
+ for (TaskRepository repository : getRepositories(connector.getConnectorKind())) {
if (url.startsWith(repository.getUrl())) {
return connector;
}
@@ -183,8 +183,8 @@ public class TaskRepositoryManager {
public List<TaskRepository> getAllRepositories() {
List<TaskRepository> repositories = new ArrayList<TaskRepository>();
for (AbstractRepositoryConnector repositoryConnector : repositoryConnectors.values()) {
- if (repositoryMap.containsKey(repositoryConnector.getRepositoryType())) {
- repositories.addAll(repositoryMap.get(repositoryConnector.getRepositoryType()));
+ if (repositoryMap.containsKey(repositoryConnector.getConnectorKind())) {
+ repositories.addAll(repositoryMap.get(repositoryConnector.getConnectorKind()));
}
}
return repositories;
@@ -251,7 +251,7 @@ public class TaskRepositoryManager {
// Will only load repositories for which a connector exists
for (AbstractRepositoryConnector repositoryConnector : repositoryConnectors.values()) {
- repositoryMap.put(repositoryConnector.getRepositoryType(), new HashSet<TaskRepository>());
+ repositoryMap.put(repositoryConnector.getConnectorKind(), new HashSet<TaskRepository>());
}
if (repositoriesFile.exists()) {
Set<TaskRepository> repositories = externalizer.readRepositoriesFromXML(repositoriesFile);
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java
index 903a1a5e4..eff0c3627 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java
@@ -62,18 +62,18 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
public void testHasIncoming() {
AbstractTask task = new MockRepositoryTask(MOCCK_ID);
- RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getRepositoryType(),
+ RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(),
MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID);
- task.setLastSyncDateStamp("never");
+ task.setLastReadTimeStamp("never");
assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData));
taskData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, "2006-06-21 15:29:39");
assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData));
taskData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_1);
assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData));
- task.setLastSyncDateStamp("2006-06-21 15:29:39");
+ task.setLastReadTimeStamp("2006-06-21 15:29:39");
assertTrue(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData));
- task.setLastSyncDateStamp(DATE_STAMP_1);
+ task.setLastReadTimeStamp(DATE_STAMP_1);
assertFalse(TasksUiPlugin.getSynchronizationManager().checkHasIncoming(task, taskData));
}
@@ -90,32 +90,32 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
RepositoryTaskSyncState.INCOMING);
RepositoryTaskData taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(
task.getRepositoryUrl(), task.getTaskId());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
assertEquals(DATE_STAMP_2, newData.getLastModified());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
// TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true);
// assertEquals(DATE_STAMP_2, task.getLastSyncDateStamp());
// and again...
RepositoryTaskData taskData3 = new RepositoryTaskData(new MockAttributeFactory(),
- connector.getRepositoryType(), MockRepositoryConnector.REPOSITORY_URL, "1");
+ connector.getConnectorKind(), MockRepositoryConnector.REPOSITORY_URL, "1");
taskData3.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_3);
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, taskData3, false);
// last modified stamp not updated until user synchronizes (newdata ==
// olddata)
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertEquals(DATE_STAMP_3, taskData.getLastModified());
// Should keep INCOMING state state since new data has same date samp
// and sych is not forced.
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, taskData3, false);
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertEquals(DATE_STAMP_3, taskData.getLastModified());
}
@@ -127,26 +127,26 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
// if new data has same date stamp as old data.
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING,
RepositoryTaskSyncState.SYNCHRONIZED);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false);
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, RepositoryTaskSyncState.SYNCHRONIZED);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true);
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
// assertEquals(RepositoryTaskSyncState.SYNCHRONIZED,
// task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
// Test forced with remote incoming
// Update: bug#163850 - synchronize gets new data but doesn't mark
// synchronized
task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, RepositoryTaskSyncState.INCOMING);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true);
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
}
@@ -185,9 +185,9 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
public void testSynchronizedToIncoming() {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED,
RepositoryTaskSyncState.INCOMING);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false);
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
RepositoryTaskData taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertEquals(DATE_STAMP_2, taskData.getLastModified());
// assertEquals(DATE_STAMP_2, task.getLastModifiedDateStamp());
@@ -196,10 +196,10 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
public void testSynchronizedToSynchronized() {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED,
RepositoryTaskSyncState.SYNCHRONIZED);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
}
/*
@@ -209,7 +209,7 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
public void testSynchronizedToOutgoing() {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED,
RepositoryTaskSyncState.SYNCHRONIZED);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
RepositoryTaskData taskData = TasksUiPlugin.getDefault().getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), task.getTaskId());
@@ -218,22 +218,22 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
HashSet<RepositoryTaskAttribute> changed = new HashSet<RepositoryTaskAttribute>();
changed.add(taskData.getAttribute(RepositoryTaskAttribute.COMMENT_NEW));
TasksUiPlugin.getSynchronizationManager().saveOutgoing(task, changed);
- assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
}
public void testConflictToConflict() {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.CONFLICT,
RepositoryTaskSyncState.INCOMING);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true);
- assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSynchronizationState());
RepositoryTaskData taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(
task.getRepositoryUrl(), task.getTaskId());
assertEquals(DATE_STAMP_2, taskData.getLastModified());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true);
- assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSynchronizationState());
taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertEquals(DATE_STAMP_2, taskData.getLastModified());
}
@@ -258,10 +258,10 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
RepositoryTaskSyncState.INCOMING);
RepositoryTaskData taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
- assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSyncState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
+ assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true);
- assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSynchronizationState());
taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId());
assertEquals(DATE_STAMP_2, taskData.getLastModified());
@@ -273,39 +273,39 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.OUTGOING,
RepositoryTaskSyncState.SYNCHRONIZED);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true);
- assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
}
public void testOutgoingToOutgoing() {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.OUTGOING,
RepositoryTaskSyncState.SYNCHRONIZED);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false);
- assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSyncState());
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
+ assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
}
public void testMarkRead() {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING,
RepositoryTaskSyncState.SYNCHRONIZED);
- task.setLastSyncDateStamp(null);
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
+ task.setLastReadTimeStamp(null);
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true);
- assertEquals(DATE_STAMP_1, task.getLastSyncDateStamp());
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
}
public void testMarkUnread() {
AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.SYNCHRONIZED,
RepositoryTaskSyncState.SYNCHRONIZED);
- task.setLastSyncDateStamp(null);
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSyncState());
+ task.setLastReadTimeStamp(null);
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
TasksUiPlugin.getSynchronizationManager().setTaskRead(task, false);
- assertEquals(RepositoryTaskSyncState.INCOMING, task.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState());
}
public void testClearOutgoing() {
@@ -326,7 +326,7 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
TasksUiPlugin.getSynchronizationManager().discardOutgoing(task);
- assertTrue(task.getSyncState().equals(RepositoryTaskSyncState.SYNCHRONIZED));
+ assertTrue(task.getSynchronizationState().equals(RepositoryTaskSyncState.SYNCHRONIZED));
RepositoryTaskData taskData = TasksUiPlugin.getDefault().getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), task.getTaskId());
assertEquals("", taskData.getNewComment());
@@ -417,12 +417,12 @@ public class RepositoryTaskSynchronizationTest extends TestCase {
RepositoryTaskData taskData = null;
AbstractTask task = new MockRepositoryTask(MOCCK_ID);
- taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getRepositoryType(), MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID);
+ taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID);
taskData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_1);
- task.setLastSyncDateStamp(DATE_STAMP_1);
- task.setSyncState(localState);
+ task.setLastReadTimeStamp(DATE_STAMP_1);
+ task.setSynchronizationState(localState);
TasksUiPlugin.getDefault().getTaskDataManager().setNewTaskData(taskData);
- newData = new RepositoryTaskData(new MockAttributeFactory(), connector.getRepositoryType(), MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID);
+ newData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID);
switch (remoteState) {
case CONFLICT:
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
index 91df4171a..15d4c43ba 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
@@ -188,13 +188,13 @@ public class TaskListManagerTest extends TestCase {
manager.getTaskList().addTask(task);
manager.getTaskList().addTask(task2);
- RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), task.getRepositoryKind(),
+ RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), task.getConnectorKind(),
task.getRepositoryUrl(), task.getTaskId(), task.getTaskKind());
TasksUiPlugin.getDefault().getTaskDataManager().setNewTaskData(taskData);
assertNotNull(TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(task.getRepositoryUrl(),
task.getTaskId()));
- RepositoryTaskData taskData2 = new RepositoryTaskData(new MockAttributeFactory(), task2.getRepositoryKind(),
+ RepositoryTaskData taskData2 = new RepositoryTaskData(new MockAttributeFactory(), task2.getConnectorKind(),
task2.getRepositoryUrl(), task2.getTaskId(), task2.getTaskKind());
taskData2.setNewComment("TEST");
TasksUiPlugin.getDefault().getTaskDataManager().setNewTaskData(taskData2);
@@ -479,7 +479,7 @@ public class TaskListManagerTest extends TestCase {
public void testCreateAndMove() {
MockRepositoryTask repositoryTask = new MockRepositoryTask("1");
- repositoryTask.setKind("kind");
+ repositoryTask.setTaskKind("kind");
manager.getTaskList().addTask(repositoryTask, manager.getTaskList().getDefaultCategory());
assertEquals(0, manager.getTaskList().getArchiveContainer().getChildren().size());
assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size());
@@ -493,7 +493,7 @@ public class TaskListManagerTest extends TestCase {
public void testArchiveRepositoryTaskExternalization() {
MockRepositoryTask repositoryTask = new MockRepositoryTask("1");
- repositoryTask.setKind("kind");
+ repositoryTask.setTaskKind("kind");
manager.getTaskList().addTask(repositoryTask);
assertEquals(1, manager.getTaskList().getArchiveContainer().getChildren().size());
assertEquals(0, manager.getTaskList().getDefaultCategory().getChildren().size());
@@ -821,15 +821,15 @@ public class TaskListManagerTest extends TestCase {
String repositoryUrl = "http://mylar.eclipse.org/bugs222";
MockRepositoryTask task1 = new MockRepositoryTask(repositoryUrl, "1");
MockRepositoryTask task2 = new MockRepositoryTask(repositoryUrl, "2");
- task1.setSyncState(RepositoryTaskSyncState.INCOMING);
- task2.setSyncState(RepositoryTaskSyncState.INCOMING);
+ task1.setSynchronizationState(RepositoryTaskSyncState.INCOMING);
+ task2.setSynchronizationState(RepositoryTaskSyncState.INCOMING);
List<AbstractTaskContainer> elements = new ArrayList<AbstractTaskContainer>();
elements.add(task1);
elements.add(task2);
MarkTaskReadAction readAction = new MarkTaskReadAction(elements);
readAction.run();
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task1.getSyncState());
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task2.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task1.getSynchronizationState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task2.getSynchronizationState());
manager.getTaskList().reset();
MockRepositoryTask hit1 = new MockRepositoryTask("1");
@@ -847,7 +847,7 @@ public class TaskListManagerTest extends TestCase {
for (AbstractTaskContainer element : query.getChildren()) {
if (element instanceof MockRepositoryTask) {
MockRepositoryTask mockTask = (MockRepositoryTask) element;
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, mockTask.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, mockTask.getSynchronizationState());
}
}
@@ -857,15 +857,15 @@ public class TaskListManagerTest extends TestCase {
String repositoryUrl = "http://mylar.eclipse.org/bugs222";
MockRepositoryTask task1 = new MockRepositoryTask(repositoryUrl, "1");
MockRepositoryTask task2 = new MockRepositoryTask(repositoryUrl, "2");
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task1.getSyncState());
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task2.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task1.getSynchronizationState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task2.getSynchronizationState());
List<AbstractTaskContainer> elements = new ArrayList<AbstractTaskContainer>();
elements.add(task1);
elements.add(task2);
MarkTaskUnreadAction unreadAction = new MarkTaskUnreadAction(elements);
unreadAction.run();
- assertEquals(RepositoryTaskSyncState.INCOMING, task1.getSyncState());
- assertEquals(RepositoryTaskSyncState.INCOMING, task2.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task1.getSynchronizationState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, task2.getSynchronizationState());
manager.getTaskList().reset();
MockRepositoryTask hit1 = new MockRepositoryTask("1");
@@ -883,7 +883,7 @@ public class TaskListManagerTest extends TestCase {
for (AbstractTaskContainer element : query.getChildren()) {
if (element instanceof MockRepositoryTask) {
MockRepositoryTask mockTask = (MockRepositoryTask) element;
- assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, mockTask.getSyncState());
+ assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, mockTask.getSynchronizationState());
} else {
fail();
}
@@ -895,7 +895,7 @@ public class TaskListManagerTest extends TestCase {
for (AbstractTaskContainer element : query.getChildren()) {
if (element instanceof MockRepositoryTask) {
MockRepositoryTask mockTask = (MockRepositoryTask) element;
- assertEquals(RepositoryTaskSyncState.INCOMING, mockTask.getSyncState());
+ assertEquals(RepositoryTaskSyncState.INCOMING, mockTask.getSynchronizationState());
} else {
fail();
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java
index 4b7e50e5d..df7b172ca 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java
@@ -85,7 +85,7 @@ public class TaskRepositoryManagerTest extends TestCase {
public void testConnectorAddition() {
AbstractRepositoryConnector connector = new MockRepositoryConnector();
manager.addRepositoryConnector(connector);
- assertNotNull(manager.getRepositoryConnector(connector.getRepositoryType()));
+ assertNotNull(manager.getRepositoryConnector(connector.getConnectorKind()));
}
public void testRepositoryPersistance() throws MalformedURLException {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java
index bc58b8bde..3834f381a 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java
@@ -15,8 +15,8 @@ import java.io.OutputStream;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -24,7 +24,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository;
/**
* @author Steffen Pingel
*/
-public class MockAttachmentHandler implements IAttachmentHandler {
+public class MockAttachmentHandler extends AbstractAttachmentHandler {
private byte[] data;
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java
index 1183b35a8..38ae94fe2 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java
@@ -22,7 +22,7 @@ public class MockAttributeFactory extends AbstractAttributeFactory {
private static final long serialVersionUID = 7713746838934802731L;
@Override
- public boolean getIsHidden(String key) {
+ public boolean isHidden(String key) {
// ignore
return false;
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java
index 381eb8e83..9a42de18d 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java
@@ -17,13 +17,13 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
-import org.eclipse.mylyn.tasks.core.ITaskCollector;
import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler;
+import org.eclipse.mylyn.tasks.core.ITaskCollector;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -37,7 +37,7 @@ public class MockRepositoryConnector extends AbstractRepositoryConnector {
public static final String REPOSITORY_URL = "http://mockrepository.test";
- private IAttachmentHandler attachmentHandler;
+ private AbstractAttachmentHandler attachmentHandler;
@Override
public boolean canCreateNewTask(TaskRepository repository) {
@@ -52,7 +52,7 @@ public class MockRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public IAttachmentHandler getAttachmentHandler() {
+ public AbstractAttachmentHandler getAttachmentHandler() {
return attachmentHandler;
}
@@ -101,7 +101,7 @@ public class MockRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getRepositoryType() {
+ public String getConnectorKind() {
return REPOSITORY_KIND;
}
@@ -118,7 +118,7 @@ public class MockRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getTaskWebUrl(String repositoryUrl, String taskId) {
+ public String getTaskUrl(String repositoryUrl, String taskId) {
return null;
}
@@ -159,7 +159,7 @@ public class MockRepositoryConnector extends AbstractRepositoryConnector {
return null;
}
- public void setAttachmentHandler(IAttachmentHandler attachmentHandler) {
+ public void setAttachmentHandler(AbstractAttachmentHandler attachmentHandler) {
this.attachmentHandler = attachmentHandler;
}
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java
index 4a87c9823..7f5b2ff71 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java
@@ -33,7 +33,7 @@ public class MockRepositoryTask extends AbstractTask {
}
@Override
- public String getRepositoryKind() {
+ public String getConnectorKind() {
return "mock";
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OfflineFileStorage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OfflineFileStorage.java
index fb9f71759..b5f0d0bd5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OfflineFileStorage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OfflineFileStorage.java
@@ -158,7 +158,7 @@ public class OfflineFileStorage implements ITaskDataStorage {
}
@Override
- public boolean getIsHidden(String key) {
+ public boolean isHidden(String key) {
return false;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java
index dd412f271..8e44f3dbe 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java
@@ -90,7 +90,7 @@ public class PersonProposalProvider implements IContentProposalProvider {
if (currentTask != null) {
repositoryUrl = currentTask.getRepositoryUrl();
- repositoryKind = currentTask.getRepositoryKind();
+ repositoryKind = currentTask.getConnectorKind();
}
if (repositoryUrl == null || repositoryKind == null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskFactory.java
index 060703581..b7efba722 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskFactory.java
@@ -70,7 +70,7 @@ public class TaskFactory implements ITaskFactory {
AbstractTask repositoryTask = taskList.getTask(taskData.getRepositoryUrl(), taskData.getId());
if (repositoryTask == null) {
repositoryTask = connector.createTaskFromTaskData(repository, taskData, updateTasklist, monitor);
- repositoryTask.setSyncState(RepositoryTaskSyncState.INCOMING);
+ repositoryTask.setSynchronizationState(RepositoryTaskSyncState.INCOMING);
if (updateTasklist) {
taskList.addTask(repositoryTask);
synchManager.saveIncoming(repositoryTask, taskData, forced);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java
index 67b8b8361..8bc42bbf5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java
@@ -39,7 +39,7 @@ public class AttachFileAction extends BaseSelectionListenerAction {
if (selection instanceof AbstractTask) {
AbstractTask repositoryTask = (AbstractTask) selection;
TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
- repositoryTask.getRepositoryKind(), repositoryTask.getRepositoryUrl());
+ repositoryTask.getConnectorKind(), repositoryTask.getRepositoryUrl());
NewAttachmentWizard attachmentWizard = new NewAttachmentWizard(repository, repositoryTask);
NewAttachmentWizardDialog dialog = new NewAttachmentWizardDialog(PlatformUI.getWorkbench()
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java
index 052e11019..69b219e76 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java
@@ -41,7 +41,7 @@ public class ClearOutgoingAction extends Action {
setId(ID);
if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof AbstractTask)) {
AbstractTask task = (AbstractTask) selectedElements.get(0);
- setEnabled(task.getSyncState().equals(RepositoryTaskSyncState.OUTGOING));
+ setEnabled(task.getSynchronizationState().equals(RepositoryTaskSyncState.OUTGOING));
} else {
setEnabled(false);
}
@@ -52,7 +52,7 @@ public class ClearOutgoingAction extends Action {
ArrayList<AbstractTask> toClear = new ArrayList<AbstractTask>();
for (Object selectedObject : selectedElements) {
if (selectedObject instanceof AbstractTask
- && ((AbstractTask) selectedObject).getSyncState()
+ && ((AbstractTask) selectedObject).getSynchronizationState()
.equals(RepositoryTaskSyncState.OUTGOING)) {
toClear.add(((AbstractTask) selectedObject));
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java
index 29af066ae..9b61eaca0 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java
@@ -16,8 +16,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -50,7 +50,7 @@ public class CopyAttachmentToClipboardJob extends Job {
attachment.getRepositoryUrl());
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
attachment.getRepositoryKind());
- IAttachmentHandler handler = connector.getAttachmentHandler();
+ AbstractAttachmentHandler handler = connector.getAttachmentHandler();
if (handler == null) {
return new RepositoryStatus(IStatus.INFO, TasksUiPlugin.PLUGIN_ID, RepositoryStatus.ERROR_INTERNAL,
"The repository does not support attachments.");
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
index 2bdddea7d..d455e0ff9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
@@ -92,7 +92,7 @@ public class CopyTaskDetailsAction extends BaseSelectionListenerAction {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
selection.getRepositoryKind());
if (connector != null) {
- text += "\n" + connector.getTaskWebUrl(selection.getRepositoryUrl(), selection.getId());
+ text += "\n" + connector.getTaskUrl(selection.getRepositoryUrl(), selection.getId());
} else {
text += "\n" + selection.getRepositoryUrl();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java
index bd4d43847..42885a6eb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java
@@ -18,8 +18,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -54,7 +54,7 @@ public class DownloadAttachmentJob extends Job {
this.attachment.getRepositoryUrl());
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
this.attachment.getRepositoryKind());
- IAttachmentHandler handler = connector.getAttachmentHandler();
+ AbstractAttachmentHandler handler = connector.getAttachmentHandler();
if (handler == null) {
return new RepositoryStatus(repository, IStatus.INFO, TasksUiPlugin.PLUGIN_ID, RepositoryStatus.ERROR_INTERNAL,
"The repository does not support attachments.");
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeEditorAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeEditorAction.java
index 8ba63b0bf..0abcb94cb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeEditorAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeEditorAction.java
@@ -66,7 +66,7 @@ public class SynchronizeEditorAction extends BaseSelectionListenerAction {
if (repositoryTask != null) {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
- repositoryTask.getRepositoryKind());
+ repositoryTask.getConnectorKind());
if (connector != null) {
TasksUiPlugin.getSynchronizationManager().synchronize(connector, repositoryTask, false,
new JobChangeAdapter() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java
index dd8fdbaa3..9627c4fe0 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java
@@ -70,13 +70,13 @@ public class SynchronizeSelectedAction extends ActionDelegate implements IViewAc
TaskCategory cat = (TaskCategory) obj;
for (AbstractTask task : cat.getChildren()) {
AbstractRepositoryConnector client = TasksUiPlugin.getRepositoryManager()
- .getRepositoryConnector(((AbstractTask) task).getRepositoryKind());
+ .getRepositoryConnector(((AbstractTask) task).getConnectorKind());
addTaskToSync(client, (AbstractTask) task);
}
} else if (obj instanceof AbstractTask) {
AbstractTask repositoryTask = (AbstractTask) obj;
AbstractRepositoryConnector client = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
- repositoryTask.getRepositoryKind());
+ repositoryTask.getConnectorKind());
addTaskToSync(client, repositoryTask);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java
index 94f935bc8..07758ffbb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java
@@ -95,7 +95,7 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog {
TaskRepositoryManager repositoryManager = TasksUiPlugin.getRepositoryManager();
for (AbstractRepositoryConnector connector : repositoryManager.getRepositoryConnectors()) {
Set<TaskRepository> connectorRepositories = repositoryManager
- .getRepositories(connector.getRepositoryType());
+ .getRepositories(connector.getConnectorKind());
for (TaskRepository repository : connectorRepositories) {
if (TaskRepositoryFilter.CAN_CREATE_TASK_FROM_KEY.accept(repository, connector)) {
repositories.add(repository);
@@ -279,7 +279,7 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog {
} else if (element instanceof AbstractTask) {
AbstractTask task = (AbstractTask) element;
- return getRepository(task.getRepositoryUrl(), task.getRepositoryKind());
+ return getRepository(task.getRepositoryUrl(), task.getConnectorKind());
} else if (element instanceof IResource) {
IResource resource = (IResource) element;
return TasksUiPlugin.getDefault().getRepositoryForResource(resource, true);
@@ -292,7 +292,7 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog {
AbstractTask task = (AbstractTask) adaptable.getAdapter(AbstractTask.class);
if (task instanceof AbstractTask) {
AbstractTask rtask = (AbstractTask) task;
- return getRepository(rtask.getRepositoryUrl(), rtask.getRepositoryKind());
+ return getRepository(rtask.getRepositoryUrl(), rtask.getConnectorKind());
}
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/TaskRepositoryParameterValues.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/TaskRepositoryParameterValues.java
index 214c5a82a..dc7e20ff6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/TaskRepositoryParameterValues.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/TaskRepositoryParameterValues.java
@@ -28,7 +28,7 @@ public class TaskRepositoryParameterValues implements IParameterValues {
.getRepositoryConnectors();
Map<String, String> values = new HashMap<String, String>();
for (AbstractRepositoryConnector connector : connectors) {
- values.put(connector.getRepositoryType(), connector.getLabel());
+ values.put(connector.getConnectorKind(), connector.getLabel());
}
return values;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryAttachmentEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryAttachmentEditorInput.java
index 544a9b21f..ca6b5e01a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryAttachmentEditorInput.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryAttachmentEditorInput.java
@@ -16,8 +16,8 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -83,7 +83,7 @@ public class RepositoryAttachmentEditorInput extends PlatformObject implements I
public InputStream getContents() throws CoreException {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
repository.getKind());
- IAttachmentHandler handler = connector.getAttachmentHandler();
+ AbstractAttachmentHandler handler = connector.getAttachmentHandler();
return handler.getAttachmentAsStream(repository, attachment, new NullProgressMonitor());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
index 31d46450d..a9966bdd3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
@@ -630,7 +630,7 @@ public class TaskPlanningEditor extends TaskFormPage {
});
if (task instanceof AbstractTask && !(task instanceof LocalTask)) {
- AbstractRepositoryConnectorUi connector = TasksUiPlugin.getRepositoryUi(((AbstractTask) task).getRepositoryKind());
+ AbstractRepositoryConnectorUi connector = TasksUiPlugin.getRepositoryUi(((AbstractTask) task).getConnectorKind());
if (connector != null && connector.handlesDueDates((AbstractTask) task)) {
dueDatePicker.setEnabled(false);
clearDueDate.setEnabled(false);
@@ -742,7 +742,7 @@ public class TaskPlanningEditor extends TaskFormPage {
TaskRepository repository = null;
if (task instanceof AbstractTask && !(task instanceof LocalTask)) {
AbstractTask repositoryTask = (AbstractTask) task;
- repository = TasksUiPlugin.getRepositoryManager().getRepository(repositoryTask.getRepositoryKind(),
+ repository = TasksUiPlugin.getRepositoryManager().getRepository(repositoryTask.getConnectorKind(),
repositoryTask.getRepositoryUrl());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/DelegatingTaskExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/DelegatingTaskExternalizer.java
index 742a869bc..eab2faf18 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/DelegatingTaskExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/DelegatingTaskExternalizer.java
@@ -219,7 +219,7 @@ final class DelegatingTaskExternalizer {
node.setAttribute(KEY_DATE_CREATION, formatExternDate(task.getCreationDate()));
node.setAttribute(KEY_DATE_DUE, formatExternDate(task.getDueDate()));
node.setAttribute(KEY_DATE_REMINDER, formatExternDate(task.getScheduledForDate()));
- if (task.hasBeenReminded()) {
+ if (task.isReminded()) {
node.setAttribute(KEY_REMINDED, VAL_TRUE);
} else {
node.setAttribute(KEY_REMINDED, VAL_FALSE);
@@ -232,8 +232,8 @@ final class DelegatingTaskExternalizer {
if (task instanceof AbstractTask) {
AbstractTask abstractTask = (AbstractTask) task;
- if (abstractTask.getLastSyncDateStamp() != null) {
- node.setAttribute(KEY_LAST_MOD_DATE, abstractTask.getLastSyncDateStamp());
+ if (abstractTask.getLastReadTimeStamp() != null) {
+ node.setAttribute(KEY_LAST_MOD_DATE, abstractTask.getLastReadTimeStamp());
}
if (abstractTask.isNotified()) {
@@ -242,8 +242,8 @@ final class DelegatingTaskExternalizer {
node.setAttribute(KEY_NOTIFIED_INCOMING, VAL_FALSE);
}
- if (abstractTask.getSyncState() != null) {
- node.setAttribute(KEY_SYNC_STATE, abstractTask.getSyncState().toString());
+ if (abstractTask.getSynchronizationState() != null) {
+ node.setAttribute(KEY_SYNC_STATE, abstractTask.getSynchronizationState().toString());
} else {
node.setAttribute(KEY_SYNC_STATE, RepositoryTaskSyncState.SYNCHRONIZED.toString());
}
@@ -422,7 +422,7 @@ final class DelegatingTaskExternalizer {
}
if (element.hasAttribute(KEY_KIND)) {
- task.setKind(element.getAttribute(KEY_KIND));
+ task.setTaskKind(element.getAttribute(KEY_KIND));
}
if (element.getAttribute(KEY_ACTIVE).compareTo(VAL_TRUE) == 0) {
@@ -492,14 +492,14 @@ final class DelegatingTaskExternalizer {
if (task instanceof AbstractTask) {
AbstractTask abstractTask = (AbstractTask) task;
- abstractTask.setCurrentlySynchronizing(false);
+ abstractTask.setSynchronizing(false);
if (element.hasAttribute(DelegatingTaskExternalizer.KEY_REPOSITORY_URL)) {
abstractTask.setRepositoryUrl(element.getAttribute(DelegatingTaskExternalizer.KEY_REPOSITORY_URL));
}
if (element.hasAttribute(KEY_LAST_MOD_DATE) && !element.getAttribute(KEY_LAST_MOD_DATE).equals("")) {
- abstractTask.setLastSyncDateStamp(element.getAttribute(KEY_LAST_MOD_DATE));
+ abstractTask.setLastReadTimeStamp(element.getAttribute(KEY_LAST_MOD_DATE));
}
if (element.hasAttribute(KEY_OWNER)) {
@@ -515,13 +515,13 @@ final class DelegatingTaskExternalizer {
if (element.hasAttribute(KEY_SYNC_STATE)) {
String syncState = element.getAttribute(KEY_SYNC_STATE);
if (syncState.compareTo(RepositoryTaskSyncState.SYNCHRONIZED.toString()) == 0) {
- abstractTask.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
+ abstractTask.setSynchronizationState(RepositoryTaskSyncState.SYNCHRONIZED);
} else if (syncState.compareTo(RepositoryTaskSyncState.INCOMING.toString()) == 0) {
- abstractTask.setSyncState(RepositoryTaskSyncState.INCOMING);
+ abstractTask.setSynchronizationState(RepositoryTaskSyncState.INCOMING);
} else if (syncState.compareTo(RepositoryTaskSyncState.OUTGOING.toString()) == 0) {
- abstractTask.setSyncState(RepositoryTaskSyncState.OUTGOING);
+ abstractTask.setSynchronizationState(RepositoryTaskSyncState.OUTGOING);
} else if (syncState.compareTo(RepositoryTaskSyncState.CONFLICT.toString()) == 0) {
- abstractTask.setSyncState(RepositoryTaskSyncState.CONFLICT);
+ abstractTask.setSynchronizationState(RepositoryTaskSyncState.CONFLICT);
}
}
}
@@ -622,8 +622,8 @@ final class DelegatingTaskExternalizer {
node.setAttribute(DelegatingTaskExternalizer.KEY_NAME, query.getSummary());
node.setAttribute(AbstractTaskListFactory.KEY_QUERY_STRING, query.getUrl());
node.setAttribute(DelegatingTaskExternalizer.KEY_REPOSITORY_URL, query.getRepositoryUrl());
- if (query.getLastRefreshTimeStamp() != null) {
- node.setAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH, query.getLastRefreshTimeStamp());
+ if (query.getLastSynchronizedTimeStamp() != null) {
+ node.setAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH, query.getLastSynchronizedTimeStamp());
}
for (AbstractTask hit : query.getChildren()) {
try {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java
index b7853e904..e67a63e13 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java
@@ -336,7 +336,7 @@ public class TaskListWriter {
if (query != null) {
wasRead = true;
if (childElement.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH) != null && !childElement.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH).equals("")) {
- query.setLastRefreshTimeStamp(childElement.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH));
+ query.setLastSynchronizedStamp(childElement.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH));
}
taskList.internalAddQuery(query);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java
index 325b99c37..30ebada98 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java
@@ -143,7 +143,7 @@ class CustomTaskListDecorationDrawer implements Listener {
for (AbstractTask task : container.getChildren()) {
if (task instanceof AbstractTask) {
AbstractTask containedRepositoryTask = (AbstractTask) task;
- if (containedRepositoryTask.getSyncState() == RepositoryTaskSyncState.INCOMING) {
+ if (containedRepositoryTask.getSynchronizationState() == RepositoryTaskSyncState.INCOMING) {
return true;
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
index 85b4180d9..7cf857f73 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
@@ -97,7 +97,7 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
AbstractRepositoryConnectorUi connectorUi = null;
if (element instanceof AbstractTask) {
AbstractTask repositoryTask = (AbstractTask) element;
- connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractTask) element).getRepositoryKind());
+ connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractTask) element).getConnectorKind());
if (connectorUi != null) {
compositeDescriptor.overlayKind = connectorUi.getTaskKindOverlay(repositoryTask);
}
@@ -129,29 +129,29 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
repositoryTask = (AbstractTask) element;
}
if (repositoryTask != null) {
- if (repositoryTask.getLastSyncDateStamp() == null) {
+ if (repositoryTask.getLastReadTimeStamp() == null) {
if (synchViewStyle) {
return TasksUiImages.OVERLAY_SYNCH_INCOMMING_NEW;
} else {
return TasksUiImages.OVERLAY_INCOMMING_NEW;
}
}
- if (repositoryTask.getSyncState() == RepositoryTaskSyncState.OUTGOING) {
+ if (repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.OUTGOING) {
if (synchViewStyle) {
imageDescriptor = TasksUiImages.OVERLAY_SYNCH_OUTGOING;
} else {
imageDescriptor = TasksUiImages.OVERLAY_OUTGOING;
}
- } else if (repositoryTask.getSyncState() == RepositoryTaskSyncState.INCOMING) {
+ } else if (repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.INCOMING) {
if (synchViewStyle) {
imageDescriptor = TasksUiImages.OVERLAY_SYNCH_INCOMMING;
} else {
imageDescriptor = TasksUiImages.OVERLAY_INCOMMING;
}
- } else if (repositoryTask.getSyncState() == RepositoryTaskSyncState.CONFLICT) {
+ } else if (repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.CONFLICT) {
imageDescriptor = TasksUiImages.OVERLAY_CONFLICT;
}
- if (imageDescriptor == null && repositoryTask.getStatus() != null) {
+ if (imageDescriptor == null && repositoryTask.getSynchronizationStatus() != null) {
return TasksUiImages.OVERLAY_WARNING;
} else if (imageDescriptor != null) {
return imageDescriptor;
@@ -160,7 +160,7 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
AbstractTaskContainer container = (AbstractTaskContainer) element;
if (container instanceof AbstractRepositoryQuery) {
AbstractRepositoryQuery query = (AbstractRepositoryQuery) container;
- if (query.getStatus() != null) {
+ if (query.getSynchronizationStatus() != null) {
return TasksUiImages.OVERLAY_WARNING;
}
}
@@ -173,7 +173,7 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
AbstractRepositoryConnectorUi connectorUi;
if (element instanceof AbstractTask) {
AbstractTask repositoryTask = (AbstractTask) element;
- connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractTask) element).getRepositoryKind());
+ connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractTask) element).getConnectorKind());
if (connectorUi != null) {
return connectorUi.getTaskPriorityOverlay(repositoryTask);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
index 8901686a3..5e5de28f5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
@@ -193,7 +193,7 @@ public class TaskListDropAdapter extends ViewerDropAdapter {
return false;
}
for (TaskRepository repository : TasksUiPlugin.getRepositoryManager().getRepositories(
- connector.getRepositoryType())) {
+ connector.getConnectorKind())) {
if (repository.getUrl().equals(repositoryUrl)) {
try {
newTask = connector.createTaskFromExistingId(repository, id, new NullProgressMonitor());
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java
index 2e816dc08..872247ee5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java
@@ -120,7 +120,7 @@ public class TaskListToolTipHandler {
} else if (element instanceof AbstractRepositoryQuery) {
AbstractRepositoryQuery query = (AbstractRepositoryQuery) element;
StringBuilder sb = new StringBuilder();
- String syncStamp = query.getLastRefreshTimeStamp();
+ String syncStamp = query.getLastSynchronizedTimeStamp();
if (syncStamp != null) {
sb.append("Synchronized: " + syncStamp);
}
@@ -128,7 +128,7 @@ public class TaskListToolTipHandler {
} else if (element instanceof AbstractTask) {
AbstractTask task = (AbstractTask) element;
StringBuilder sb = new StringBuilder();
- sb.append(TasksUiPlugin.getRepositoryUi(task.getRepositoryKind()).getTaskKindLabel(task));
+ sb.append(TasksUiPlugin.getRepositoryUi(task.getConnectorKind()).getTaskKindLabel(task));
String key = task.getTaskKey();
if (key != null) {
sb.append(" ");
@@ -137,7 +137,7 @@ public class TaskListToolTipHandler {
sb.append(", ");
sb.append(task.getPriority());
sb.append(" [");
- sb.append(getRepositoryLabel(task.getRepositoryKind(), task.getRepositoryUrl()));
+ sb.append(getRepositoryLabel(task.getConnectorKind(), task.getRepositoryUrl()));
sb.append("]");
sb.append("\n");
return sb.toString();
@@ -185,7 +185,7 @@ public class TaskListToolTipHandler {
private String getIncommingText(AbstractTaskContainer element) {
if (element instanceof AbstractTask) {
AbstractTask task = (AbstractTask) element;
- if (task.getSyncState() == RepositoryTaskSyncState.INCOMING) {
+ if (task.getSynchronizationState() == RepositoryTaskSyncState.INCOMING) {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
task);
if (connector != null) {
@@ -208,10 +208,10 @@ public class TaskListToolTipHandler {
IStatus status = null;
if (element instanceof AbstractTask) {
AbstractTask task = (AbstractTask) element;
- status = task.getStatus();
+ status = task.getSynchronizationStatus();
} else if (element instanceof AbstractRepositoryQuery) {
AbstractRepositoryQuery query = (AbstractRepositoryQuery) element;
- status = query.getStatus();
+ status = query.getSynchronizationStatus();
}
if (status != null) {
@@ -249,15 +249,15 @@ public class TaskListToolTipHandler {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
query.getRepositoryKind());
if (connector != null) {
- return TasksUiPlugin.getDefault().getBrandingIcon(connector.getRepositoryType());
+ return TasksUiPlugin.getDefault().getBrandingIcon(connector.getConnectorKind());
}
} else if (element instanceof AbstractTask) {
AbstractTask repositoryTask = (AbstractTask) element;
if (repositoryTask != null) {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
- repositoryTask.getRepositoryKind());
+ repositoryTask.getConnectorKind());
if (connector != null) {
- return TasksUiPlugin.getDefault().getBrandingIcon(connector.getRepositoryType());
+ return TasksUiPlugin.getDefault().getBrandingIcon(connector.getConnectorKind());
}
}
} else if (element instanceof ScheduledTaskContainer) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoryLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoryLabelProvider.java
index b2e05440e..089c55893 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoryLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoryLabelProvider.java
@@ -37,7 +37,7 @@ public class TaskRepositoryLabelProvider implements ILabelProvider {
public Image getImage(Object object) {
if (object instanceof AbstractRepositoryConnector) {
AbstractRepositoryConnector repositoryConnector = (AbstractRepositoryConnector) object;
- Image image = TasksUiPlugin.getDefault().getBrandingIcon(repositoryConnector.getRepositoryType());
+ Image image = TasksUiPlugin.getDefault().getBrandingIcon(repositoryConnector.getConnectorKind());
if (image != null) {
return image;
} else {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/AbstractRepositoryClientWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/AbstractRepositoryClientWizard.java
index 240a77154..3b68627d6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/AbstractRepositoryClientWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/AbstractRepositoryClientWizard.java
@@ -67,7 +67,7 @@ public abstract class AbstractRepositoryClientWizard extends Wizard implements I
connector = connectors.toArray(new AbstractRepositoryConnector[1])[0];
}
setRepositoryConnector(connector);
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(connector.getRepositoryType());
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(connector.getConnectorKind());
AbstractRepositorySettingsPage nextPage = connectorUi.getSettingsPage();
setRepositorySettingsPage(nextPage);
nextPage.setWizard(this);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizard.java
index 9fa669be2..5247a358a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizard.java
@@ -33,7 +33,7 @@ public class ContextAttachWizard extends Wizard {
private ContextAttachWizardPage wizardPage;
public ContextAttachWizard(AbstractTask task) {
- repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getRepositoryKind(),
+ repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getConnectorKind(),
task.getRepositoryUrl());
this.task = task;
setWindowTitle(ContextRetrieveWizard.TITLE);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizardPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizardPage.java
index 647a88bfd..812fa9947 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizardPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextAttachWizardPage.java
@@ -68,7 +68,7 @@ public class ContextAttachWizardPage extends WizardPage {
setControl(composite);
- if(task.getSyncState() != RepositoryTaskSyncState.SYNCHRONIZED) {
+ if(task.getSynchronizationState() != RepositoryTaskSyncState.SYNCHRONIZED) {
setErrorMessage("Task must be synchronized before attaching context");
complete = false;
getWizard().getContainer().updateButtons();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizard.java
index b3c3977ee..9733529a9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizard.java
@@ -37,7 +37,7 @@ public class ContextRetrieveWizard extends Wizard {
private ContextRetrieveWizardPage wizardPage;
public ContextRetrieveWizard(AbstractTask task) {
- repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getRepositoryKind(),
+ repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getConnectorKind(),
task.getRepositoryUrl());
this.task = task;
setWindowTitle(TITLE);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizardPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizardPage.java
index ef8779643..643efcf2f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizardPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/ContextRetrieveWizardPage.java
@@ -114,8 +114,11 @@ public class ContextRetrieveWizardPage extends WizardPage {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
repository.getKind());
- List<RepositoryAttachment> contextAttachments = new ArrayList<RepositoryAttachment>(
- connector.getContextAttachments(repository, task));
+ List<RepositoryAttachment> contextAttachments = new ArrayList<RepositoryAttachment>();
+ if (connector.getAttachmentHandler() != null) {
+ contextAttachments = new ArrayList<RepositoryAttachment>(connector.getAttachmentHandler()
+ .getContextAttachments(repository, task));
+ }
Collections.sort(contextAttachments, new Comparator<RepositoryAttachment>() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewAttachmentWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewAttachmentWizard.java
index b5240c30c..577dea5a5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewAttachmentWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewAttachmentWizard.java
@@ -32,9 +32,9 @@ import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil;
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiConstants;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
import org.eclipse.mylyn.tasks.core.LocalAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -122,7 +122,7 @@ public class NewAttachmentWizard extends Wizard {
// upload the attachment
final AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
repository.getKind());
- final IAttachmentHandler attachmentHandler = connector.getAttachmentHandler();
+ final AbstractAttachmentHandler attachmentHandler = connector.getAttachmentHandler();
if (attachmentHandler == null) {
return false;
}
@@ -137,7 +137,7 @@ public class NewAttachmentWizard extends Wizard {
}
monitor.beginTask("Attaching file...", 2);
task.setSubmitting(true);
- task.setSyncState(RepositoryTaskSyncState.OUTGOING);
+ task.setSynchronizationState(RepositoryTaskSyncState.OUTGOING);
if (InputAttachmentSourcePage.CLIPBOARD_LABEL.equals(path)) {
String contents = inputPage.getClipboardContents();
@@ -159,8 +159,8 @@ public class NewAttachmentWizard extends Wizard {
throw new OperationCanceledException();
}
- if (attachContext) {
- connector.attachContext(repository, task, "", new SubProgressMonitor(monitor, 1));
+ if (attachContext && connector.getAttachmentHandler() != null) {
+ connector.getAttachmentHandler().attachContext(repository, task, "", new SubProgressMonitor(monitor, 1));
}
} catch (CoreException e) {
throw new InvocationTargetException(e);
@@ -194,7 +194,7 @@ public class NewAttachmentWizard extends Wizard {
} catch (InvocationTargetException e1) {
task.setSubmitting(false);
- task.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
+ task.setSynchronizationState(RepositoryTaskSyncState.SYNCHRONIZED);
if (e1.getCause() != null && e1.getCause() instanceof CoreException) {
handleSubmitError((CoreException) e1.getCause());
@@ -204,7 +204,7 @@ public class NewAttachmentWizard extends Wizard {
return false;
} catch (InterruptedException e1) {
task.setSubmitting(false);
- task.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
+ task.setSynchronizationState(RepositoryTaskSyncState.SYNCHRONIZED);
}
return true;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryClientPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryClientPage.java
index d3d9196cb..efebafa0a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryClientPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryClientPage.java
@@ -116,7 +116,7 @@ public class SelectRepositoryClientPage extends WizardPage {
public IWizardPage getNextPage() {
if (isPageComplete()) {
AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(
- wizard.getRepositoryConnector().getRepositoryType());
+ wizard.getRepositoryConnector().getConnectorKind());
AbstractRepositorySettingsPage nextPage = connectorUi.getSettingsPage();
wizard.setRepositorySettingsPage(nextPage);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryPage.java
index abd334343..68940b9cb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/SelectRepositoryPage.java
@@ -96,7 +96,7 @@ public abstract class SelectRepositoryPage extends WizardSelectionPage {
List<TaskRepository> repositories = new ArrayList<TaskRepository>();
TaskRepositoryManager repositoryManager = TasksUiPlugin.getRepositoryManager();
for (AbstractRepositoryConnector connector : repositoryManager.getRepositoryConnectors()) {
- Set<TaskRepository> connectorRepositories = repositoryManager.getRepositories(connector.getRepositoryType());
+ Set<TaskRepository> connectorRepositories = repositoryManager.getRepositories(connector.getConnectorKind());
for (TaskRepository repository : connectorRepositories) {
if (taskRepositoryFilter.accept(repository, connector)) {
repositories.add(repository);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
index 9ba534fe1..0bdbe45dc 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
@@ -191,7 +191,7 @@ public abstract class AbstractRepositoryConnectorUi {
public boolean openRepositoryTask(String repositoryUrl, String id) {
TaskRepositoryManager repositoryManager = TasksUiPlugin.getRepositoryManager();
AbstractRepositoryConnector connector = repositoryManager.getRepositoryConnector(getRepositoryType());
- String taskUrl = connector.getTaskWebUrl(repositoryUrl, id);
+ String taskUrl = connector.getTaskUrl(repositoryUrl, id);
if (taskUrl == null) {
return false;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/ContextUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/ContextUiUtil.java
index ef864f511..400d26e7d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/ContextUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/ContextUiUtil.java
@@ -19,6 +19,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiConstants;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
@@ -48,7 +49,12 @@ public class ContextUiUtil {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- result[0] = connector.retrieveContext(repository, task, attachment, directory, monitor);
+ if (connector.getAttachmentHandler() != null) {
+ result[0] = connector.getAttachmentHandler().retrieveContext(repository, task, attachment,
+ directory, monitor);
+ } else {
+ result[0] = false;
+ }
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
@@ -58,16 +64,15 @@ public class ContextUiUtil {
if (!result[0]) {
MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- ITasksUiConstants.TITLE_DIALOG,
- AbstractRepositoryConnector.MESSAGE_ATTACHMENTS_NOT_SUPPORTED + connector.getLabel());
+ ITasksUiConstants.TITLE_DIALOG, AbstractAttachmentHandler.MESSAGE_ATTACHMENTS_NOT_SUPPORTED
+ + connector.getLabel());
} else {
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(task, false);
TasksUiPlugin.getTaskListManager().activateTask(task);
}
} catch (InvocationTargetException e) {
if (e.getCause() instanceof CoreException) {
- StatusManager.displayStatus(ITasksUiConstants.TITLE_DIALOG, ((CoreException) e.getCause())
- .getStatus());
+ StatusManager.displayStatus(ITasksUiConstants.TITLE_DIALOG, ((CoreException) e.getCause()).getStatus());
} else {
StatusManager.fail(e, "Unexpected error while attaching context", true);
}
@@ -88,7 +93,12 @@ public class ContextUiUtil {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- result[0] = connector.attachContext(repository, task, comment, monitor);
+ if (connector.getAttachmentHandler() != null) {
+ result[0] = connector.getAttachmentHandler().attachContext(repository, task, comment,
+ monitor);
+ } else {
+ result[0] = false;
+ }
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
@@ -98,12 +108,15 @@ public class ContextUiUtil {
if (!result[0]) {
MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- ITasksUiConstants.TITLE_DIALOG, AbstractRepositoryConnector.MESSAGE_ATTACHMENTS_NOT_SUPPORTED
+ ITasksUiConstants.TITLE_DIALOG, AbstractAttachmentHandler.MESSAGE_ATTACHMENTS_NOT_SUPPORTED
+ connector.getLabel());
} else {
- task.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
- IWorkbenchSite site = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .getActivePart().getSite();
+ task.setSynchronizationState(RepositoryTaskSyncState.SYNCHRONIZED);
+ IWorkbenchSite site = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow()
+ .getActivePage()
+ .getActivePart()
+ .getSite();
if (site instanceof IViewSite) {
IStatusLineManager statusLineManager = ((IViewSite) site).getActionBars().getStatusLineManager();
statusLineManager.setMessage(TasksUiImages.getImage(TasksUiImages.TASKLIST),
@@ -113,8 +126,7 @@ public class ContextUiUtil {
}
} catch (InvocationTargetException e) {
if (e.getCause() instanceof CoreException) {
- StatusManager.displayStatus(ITasksUiConstants.TITLE_DIALOG, ((CoreException) e.getCause())
- .getStatus());
+ StatusManager.displayStatus(ITasksUiConstants.TITLE_DIALOG, ((CoreException) e.getCause()).getStatus());
} else {
StatusManager.fail(e, "Unexpected error while attaching context", true);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java
index 2bc4d2494..4afe0b434 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java
@@ -72,7 +72,7 @@ public class RepositorySynchronizationManager {
synchronizeJob.addJobChangeListener(listener);
}
for (AbstractTask repositoryTask : repositoryTasks) {
- repositoryTask.setCurrentlySynchronizing(true);
+ repositoryTask.setSynchronizing(true);
}
if (!forceSyncExecForTesting) {
synchronizeJob.schedule();
@@ -107,7 +107,7 @@ public class RepositorySynchronizationManager {
long delay, boolean userForcedSync) {
TaskList taskList = TasksUiPlugin.getTaskListManager().getTaskList();
for (AbstractRepositoryQuery repositoryQuery : repositoryQueries) {
- repositoryQuery.setCurrentlySynchronizing(true);
+ repositoryQuery.setSynchronizing(true);
// TasksUiPlugin.getTaskListManager().getTaskList().notifyContainerUpdated(repositoryQuery);
}
taskList.notifyContainersUpdated(repositoryQueries);
@@ -153,7 +153,7 @@ public class RepositorySynchronizationManager {
* attributes that have changed during edit session
*/
public synchronized void saveOutgoing(AbstractTask repositoryTask, Set<RepositoryTaskAttribute> modifiedAttributes) {
- repositoryTask.setSyncState(RepositoryTaskSyncState.OUTGOING);
+ repositoryTask.setSynchronizationState(RepositoryTaskSyncState.OUTGOING);
TasksUiPlugin.getDefault().getTaskDataManager().saveEdits(repositoryTask.getRepositoryUrl(),
repositoryTask.getTaskId(), Collections.unmodifiableSet(modifiedAttributes));
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, false);
@@ -166,8 +166,8 @@ public class RepositorySynchronizationManager {
*/
public synchronized boolean saveIncoming(final AbstractTask repositoryTask, final RepositoryTaskData newTaskData,
boolean forceSync) {
- final RepositoryTaskSyncState startState = repositoryTask.getSyncState();
- RepositoryTaskSyncState status = repositoryTask.getSyncState();
+ final RepositoryTaskSyncState startState = repositoryTask.getSynchronizationState();
+ RepositoryTaskSyncState status = repositoryTask.getSynchronizationState();
if (newTaskData == null) {
StatusManager.log("Download of " + repositoryTask.getSummary() + " from "
@@ -222,8 +222,8 @@ public class RepositorySynchronizationManager {
break;
}
}
- repositoryTask.setSyncState(status);
- return startState != repositoryTask.getSyncState();
+ repositoryTask.setSynchronizationState(status);
+ return startState != repositoryTask.getSynchronizationState();
}
public void saveOffline(AbstractTask task, RepositoryTaskData taskData) {
@@ -232,12 +232,12 @@ public class RepositorySynchronizationManager {
/** public for testing purposes */
public boolean checkHasIncoming(AbstractTask repositoryTask, RepositoryTaskData newData) {
- String lastModified = repositoryTask.getLastSyncDateStamp();
+ String lastModified = repositoryTask.getLastReadTimeStamp();
RepositoryTaskAttribute modifiedDateAttribute = newData.getAttribute(RepositoryTaskAttribute.DATE_MODIFIED);
if (lastModified != null && modifiedDateAttribute != null && modifiedDateAttribute.getValue() != null) {
if (lastModified.trim().compareTo(modifiedDateAttribute.getValue().trim()) == 0
- && repositoryTask.getSyncState() != RepositoryTaskSyncState.INCOMING) {
+ && repositoryTask.getSynchronizationState() != RepositoryTaskSyncState.INCOMING) {
// Only set to synchronized state if not in incoming state.
// Case of incoming->sync handled by markRead upon opening
// or a forced synchronization on the task only.
@@ -260,22 +260,22 @@ public class RepositorySynchronizationManager {
RepositoryTaskData taskData = TasksUiPlugin.getDefault().getTaskDataManager().getNewTaskData(
repositoryTask.getRepositoryUrl(), repositoryTask.getTaskId());
- if (read && repositoryTask.getSyncState().equals(RepositoryTaskSyncState.INCOMING)) {
+ if (read && repositoryTask.getSynchronizationState().equals(RepositoryTaskSyncState.INCOMING)) {
if (taskData != null && taskData.getLastModified() != null) {
- repositoryTask.setLastSyncDateStamp(taskData.getLastModified());
+ repositoryTask.setLastReadTimeStamp(taskData.getLastModified());
dataManager.setOldTaskData(taskData);
}
- repositoryTask.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
+ repositoryTask.setSynchronizationState(RepositoryTaskSyncState.SYNCHRONIZED);
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, false);
- } else if (read && repositoryTask.getSyncState().equals(RepositoryTaskSyncState.CONFLICT)) {
+ } else if (read && repositoryTask.getSynchronizationState().equals(RepositoryTaskSyncState.CONFLICT)) {
if (taskData != null && taskData.getLastModified() != null) {
- repositoryTask.setLastSyncDateStamp(taskData.getLastModified());
+ repositoryTask.setLastReadTimeStamp(taskData.getLastModified());
}
- repositoryTask.setSyncState(RepositoryTaskSyncState.OUTGOING);
+ repositoryTask.setSynchronizationState(RepositoryTaskSyncState.OUTGOING);
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, false);
- } else if (read && repositoryTask.getSyncState().equals(RepositoryTaskSyncState.SYNCHRONIZED)) {
+ } else if (read && repositoryTask.getSynchronizationState().equals(RepositoryTaskSyncState.SYNCHRONIZED)) {
if (taskData != null && taskData.getLastModified() != null) {
- repositoryTask.setLastSyncDateStamp(taskData.getLastModified());
+ repositoryTask.setLastReadTimeStamp(taskData.getLastModified());
// By setting old every time (and not setting upon submission)
// we see our changes
// If condition is enabled and we save old in OUTGOING handler
@@ -286,26 +286,26 @@ public class RepositorySynchronizationManager {
// == null) {
dataManager.setOldTaskData(taskData);
// }
- } else if (repositoryTask.getLastSyncDateStamp() == null && repositoryTask.isLocal()) {
+ } else if (repositoryTask.getLastReadTimeStamp() == null && repositoryTask.isLocal()) {
// fall back for cases where the stamp is missing, set bogus date
- repositoryTask.setLastSyncDateStamp(LocalTask.SYNC_DATE_NOW);
+ repositoryTask.setLastReadTimeStamp(LocalTask.SYNC_DATE_NOW);
}
- } else if (!read && repositoryTask.getSyncState().equals(RepositoryTaskSyncState.SYNCHRONIZED)) {
- repositoryTask.setSyncState(RepositoryTaskSyncState.INCOMING);
+ } else if (!read && repositoryTask.getSynchronizationState().equals(RepositoryTaskSyncState.SYNCHRONIZED)) {
+ repositoryTask.setSynchronizationState(RepositoryTaskSyncState.INCOMING);
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, false);
}
// for repositories that don't support task data or if no task data is available
if (read && taskData == null) {
- repositoryTask.setLastSyncDateStamp(LocalTask.SYNC_DATE_NOW);
+ repositoryTask.setLastReadTimeStamp(LocalTask.SYNC_DATE_NOW);
}
}
public void discardOutgoing(AbstractTask repositoryTask) {
TaskDataManager dataManager = TasksUiPlugin.getDefault().getTaskDataManager();
dataManager.discardEdits(repositoryTask.getRepositoryUrl(), repositoryTask.getTaskId());
- repositoryTask.setSyncState(RepositoryTaskSyncState.SYNCHRONIZED);
+ repositoryTask.setSynchronizationState(RepositoryTaskSyncState.SYNCHRONIZED);
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, true);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
index 24b576bb0..b700bf3d8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
@@ -112,12 +112,12 @@ class SynchronizeQueryJob extends Job {
// synchronize queries, tasks changed within query are added to set of tasks to be synchronized
int n = 0;
for (AbstractRepositoryQuery repositoryQuery : queries) {
- repositoryQuery.setStatus(null);
+ repositoryQuery.setSynchronizationStatus(null);
monitor.setTaskName("Synchronizing " + ++n + "/" + queries.size() + ": " + repositoryQuery.getSummary());
synchronizeQuery(repositoryQuery, new SubProgressMonitor(monitor, 10));
- repositoryQuery.setCurrentlySynchronizing(false);
+ repositoryQuery.setSynchronizing(false);
taskList.notifyContainersUpdated(Collections.singleton(repositoryQuery));
}
@@ -126,7 +126,7 @@ class SynchronizeQueryJob extends Job {
for (AbstractTask task : allTasks) {
if (task.isStale()) {
tasksToBeSynchronized.add(task);
- task.setCurrentlySynchronizing(true);
+ task.setSynchronizing(true);
}
}
}
@@ -155,8 +155,8 @@ class SynchronizeQueryJob extends Job {
private void updateQueryStatus(final IStatus status) {
for (AbstractRepositoryQuery repositoryQuery : queries) {
- repositoryQuery.setStatus(status);
- repositoryQuery.setCurrentlySynchronizing(false);
+ repositoryQuery.setSynchronizationStatus(status);
+ repositoryQuery.setSynchronizing(false);
}
taskList.notifyContainersUpdated(queries);
@@ -189,27 +189,27 @@ class SynchronizeQueryJob extends Job {
if (task != null) {
// update the existing task from the query hit
boolean changed = connector.updateTaskFromQueryHit(repository, task, hit);
- if (changed && !task.isStale() && task.getSyncState() == RepositoryTaskSyncState.SYNCHRONIZED) {
+ if (changed && !task.isStale() && task.getSynchronizationState() == RepositoryTaskSyncState.SYNCHRONIZED) {
// set incoming marker for web tasks
- task.setSyncState(RepositoryTaskSyncState.INCOMING);
+ task.setSynchronizationState(RepositoryTaskSyncState.INCOMING);
}
} else {
// new tasks are marked stale by default
task = hit;
task.setStale(true);
- task.setSyncState(RepositoryTaskSyncState.INCOMING);
+ task.setSynchronizationState(RepositoryTaskSyncState.INCOMING);
}
taskList.addTask(task, repositoryQuery);
if (synchronizeChangedTasks && task.isStale()) {
tasksToBeSynchronized.add(task);
- task.setCurrentlySynchronizing(true);
+ task.setSynchronizing(true);
}
}
- repositoryQuery.setLastRefreshTimeStamp(DateUtil.getFormattedDate(new Date(), "MMM d, H:mm:ss"));
+ repositoryQuery.setLastSynchronizedStamp(DateUtil.getFormattedDate(new Date(), "MMM d, H:mm:ss"));
} else {
- repositoryQuery.setStatus(resultingStatus);
+ repositoryQuery.setSynchronizationStatus(resultingStatus);
if (isForced()) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java
index f7de50831..ca49d4531 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeTaskJob.java
@@ -94,10 +94,10 @@ class SynchronizeTaskJob extends Job {
if (taskDataHandler != null && taskDataHandler.canGetMultiTaskData()) {
// Multi synch supported...
TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
- repositoryTask.getRepositoryKind(), repositoryTask.getRepositoryUrl());
+ repositoryTask.getConnectorKind(), repositoryTask.getRepositoryUrl());
if (repository == null) {
- repositoryTask.setStatus(new Status(IStatus.ERROR, TasksUiPlugin.PLUGIN_ID, 0,
+ repositoryTask.setSynchronizationStatus(new Status(IStatus.ERROR, TasksUiPlugin.PLUGIN_ID, 0,
"Associated repository could not be found. Ensure proper repository configuration of "
+ repositoryTask.getRepositoryUrl() + " in "
+ TasksUiPlugin.LABEL_VIEW_REPOSITORIES + ".", null));
@@ -109,9 +109,9 @@ class SynchronizeTaskJob extends Job {
tasks = new HashSet<AbstractTask>();
repToTasks.put(repository, tasks);
}
- repositoryTask.setStatus(null);
+ repositoryTask.setSynchronizationStatus(null);
tasks.add(repositoryTask);
- repositoryTask.setCurrentlySynchronizing(true);
+ repositoryTask.setSynchronizing(true);
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, false);
} else {
// Single synch supported...
@@ -122,7 +122,7 @@ class SynchronizeTaskJob extends Job {
if (monitor.isCanceled()) {
for (final AbstractTask repositoryTask : repositoryTasks) {
- repositoryTask.setCurrentlySynchronizing(false);
+ repositoryTask.setSynchronizing(false);
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, false);
}
@@ -161,10 +161,10 @@ class SynchronizeTaskJob extends Job {
private void synchronizeTask(IProgressMonitor monitor, AbstractTask task) {
monitor.subTask(task.getSummary());
- task.setStatus(null);
+ task.setSynchronizationStatus(null);
final TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
- task.getRepositoryKind(), task.getRepositoryUrl());
+ task.getConnectorKind(), task.getRepositoryUrl());
try {
if (repository == null) {
throw new CoreException(new Status(IStatus.ERROR, TasksUiPlugin.PLUGIN_ID, 0,
@@ -205,9 +205,9 @@ class SynchronizeTaskJob extends Job {
*/
private void updateStatus(TaskRepository repository, AbstractTask task, IStatus status) {
if (!forced && repository != null && repository.isOffline()) {
- task.setCurrentlySynchronizing(false);
+ task.setSynchronizing(false);
} else {
- task.setStatus(status);
+ task.setSynchronizationStatus(status);
}
}
@@ -256,9 +256,9 @@ class SynchronizeTaskJob extends Job {
throws CoreException {
connector.updateTaskFromRepository(repository, task, new SubProgressMonitor(monitor, 1));
task.setStale(false);
- task.setCurrentlySynchronizing(false);
- if (task.getSyncState() == RepositoryTaskSyncState.INCOMING
- || task.getSyncState() == RepositoryTaskSyncState.CONFLICT) {
+ task.setSynchronizing(false);
+ if (task.getSynchronizationState() == RepositoryTaskSyncState.INCOMING
+ || task.getSynchronizationState() == RepositoryTaskSyncState.CONFLICT) {
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(task, true);
} else {
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(task, false);
@@ -287,10 +287,10 @@ class SynchronizeTaskJob extends Job {
TasksUiPlugin.getTaskListManager().setDueDate(repositoryTask, repositoryTask.getDueDate());
}
- repositoryTask.setCurrentlySynchronizing(false);
+ repositoryTask.setSynchronizing(false);
repositoryTask.setStale(false);
- if (repositoryTask.getSyncState() == RepositoryTaskSyncState.INCOMING
- || repositoryTask.getSyncState() == RepositoryTaskSyncState.CONFLICT) {
+ if (repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.INCOMING
+ || repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.CONFLICT) {
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, true);
} else {
TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(repositoryTask, false);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java
index 3bbdd1756..339095c92 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java
@@ -930,7 +930,7 @@ public class TaskListManager implements IPropertyChangeListener {
if (task instanceof AbstractTask) {
AbstractTask repositoryTask = (AbstractTask) task;
TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
- repositoryTask.getRepositoryKind(), repositoryTask.getRepositoryUrl());
+ repositoryTask.getConnectorKind(), repositoryTask.getRepositoryUrl());
if (repository != null && repositoryTask.getOwner() != null) {
return repositoryTask.getOwner().equals(repository.getUserName());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java
index e8a4b46ae..19b2ca315 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java
@@ -264,7 +264,7 @@ public class TasksUiPlugin extends AbstractUIPlugin implements IStartup {
Collection<AbstractTask> allTasks = TasksUiPlugin.getTaskListManager().getTaskList().getAllTasks();
Set<ITaskListNotification> reminders = new HashSet<ITaskListNotification>();
for (AbstractTask task : allTasks) {
- if (!task.isCompleted() && task.getScheduledForDate() != null && !task.hasBeenReminded()
+ if (!task.isCompleted() && task.getScheduledForDate() != null && !task.isReminded()
&& task.getScheduledForDate().compareTo(currentDate) < 0) {
reminders.add(new TaskListNotificationReminder(task));
task.setReminded(true);
@@ -287,7 +287,7 @@ public class TasksUiPlugin extends AbstractUIPlugin implements IStartup {
for (AbstractTask repositoryTask : TasksUiPlugin.getTaskListManager()
.getTaskList()
.getRepositoryTasks(repository.getUrl())) {
- if ((repositoryTask.getLastSyncDateStamp() == null || repositoryTask.getSyncState() == RepositoryTaskSyncState.INCOMING)
+ if ((repositoryTask.getLastReadTimeStamp() == null || repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.INCOMING)
&& repositoryTask.isNotified() == false) {
TaskListNotificationIncoming notification = getIncommingNotification(connector,
repositoryTask);
@@ -500,9 +500,9 @@ public class TasksUiPlugin extends AbstractUIPlugin implements IStartup {
if (template.addAutomatically) {
try {
TaskRepository taskRepository = taskRepositoryManager.getRepository(
- connector.getRepositoryType(), template.repositoryUrl);
+ connector.getConnectorKind(), template.repositoryUrl);
if (taskRepository == null) {
- taskRepository = new TaskRepository(connector.getRepositoryType(), template.repositoryUrl,
+ taskRepository = new TaskRepository(connector.getConnectorKind(), template.repositoryUrl,
template.version);
taskRepository.setRepositoryLabel(template.label);
taskRepository.setAnonymous(true);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
index 5a54d6b6d..6d0d5fbbe 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
@@ -182,7 +182,7 @@ public class TasksUiUtil {
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
.getConnectorForRepositoryTaskUrl(fullUrl);
if (connector != null) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(connector.getRepositoryType());
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(connector.getConnectorKind());
if (repositoryUrl != null && taskId != null) {
opened = connectorUi.openRepositoryTask(repositoryUrl, taskId);
} else {
@@ -215,7 +215,7 @@ public class TasksUiUtil {
} else if (task instanceof AbstractTask) {
final AbstractTask repositoryTask = (AbstractTask) task;
- String repositoryKind = repositoryTask.getRepositoryKind();
+ String repositoryKind = repositoryTask.getConnectorKind();
final AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
.getRepositoryConnector(repositoryKind);
@@ -268,7 +268,7 @@ public class TasksUiUtil {
String taskEditorId = TaskEditor.ID_EDITOR;
if (task instanceof AbstractTask) {
AbstractTask repositoryTask = (AbstractTask) task;
- AbstractRepositoryConnectorUi repositoryUi = TasksUiPlugin.getRepositoryUi(repositoryTask.getRepositoryKind());
+ AbstractRepositoryConnectorUi repositoryUi = TasksUiPlugin.getRepositoryUi(repositoryTask.getConnectorKind());
String customTaskEditorId = repositoryUi.getTaskEditorId(repositoryTask);
if (customTaskEditorId != null) {
taskEditorId = customTaskEditorId;
@@ -337,7 +337,7 @@ public class TasksUiUtil {
// Synchronization must happen after marked
// read.
AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
- .getRepositoryConnector(repositoryTask.getRepositoryKind());
+ .getRepositoryConnector(repositoryTask.getConnectorKind());
if (connector != null) {
TasksUiPlugin.getSynchronizationManager().synchronize(connector,
repositoryTask, false, null);
@@ -377,8 +377,8 @@ public class TasksUiUtil {
*/
private static boolean refreshIfOpen(AbstractTask task, IEditorInput editorInput) {
if (task instanceof AbstractTask) {
- if (((AbstractTask) task).getSyncState() == RepositoryTaskSyncState.INCOMING
- || ((AbstractTask) task).getSyncState() == RepositoryTaskSyncState.CONFLICT) {
+ if (((AbstractTask) task).getSynchronizationState() == RepositoryTaskSyncState.INCOMING
+ || ((AbstractTask) task).getSynchronizationState() == RepositoryTaskSyncState.CONFLICT) {
for (TaskEditor editor : getActiveRepositoryTaskEditors()) {
if (editor.getEditorInput().equals(editorInput)) {
editor.refreshEditorContents();
@@ -492,7 +492,7 @@ public class TasksUiUtil {
} else if (element instanceof AbstractTask) {
AbstractTask task = (AbstractTask) element;
return TasksUiPlugin.getRepositoryManager()
- .getRepository(task.getRepositoryKind(), task.getRepositoryUrl());
+ .getRepository(task.getConnectorKind(), task.getRepositoryUrl());
} else if (element instanceof IResource) {
IResource resource = (IResource) element;
return TasksUiPlugin.getDefault().getRepositoryForResource(resource, true);
@@ -505,7 +505,7 @@ public class TasksUiUtil {
AbstractTask task = (AbstractTask) adaptable.getAdapter(AbstractTask.class);
if (task instanceof AbstractTask) {
AbstractTask rtask = (AbstractTask) task;
- return TasksUiPlugin.getRepositoryManager().getRepository(rtask.getRepositoryKind(),
+ return TasksUiPlugin.getRepositoryManager().getRepository(rtask.getConnectorKind(),
rtask.getRepositoryUrl());
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
index d2f8df6bd..0d6bd89c5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
@@ -320,8 +320,8 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
if (taskToRefresh != null) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
- if (repositoryTask.getSyncState() == RepositoryTaskSyncState.INCOMING
- || repositoryTask.getSyncState() == RepositoryTaskSyncState.CONFLICT) {
+ if (repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.INCOMING
+ || repositoryTask.getSynchronizationState() == RepositoryTaskSyncState.CONFLICT) {
// MessageDialog.openInformation(AbstractTaskEditor.this.getSite().getShell(),
// "Changed - " + repositoryTask.getSummary(),
// "Editor will Test with new incoming
@@ -1428,7 +1428,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
return;
}
if (AbstractRepositoryTaskEditor.this.isDirty
- || ((AbstractTask) task).getSyncState().equals(RepositoryTaskSyncState.OUTGOING)) {
+ || ((AbstractTask) task).getSynchronizationState().equals(RepositoryTaskSyncState.OUTGOING)) {
MessageDialog.openInformation(attachmentsComposite.getShell(),
"Task not synchronized or dirty editor",
"Commit edits or synchronize task before adding attachments.");
@@ -1459,7 +1459,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
return;
}
if (AbstractRepositoryTaskEditor.this.isDirty
- || ((AbstractTask) task).getSyncState().equals(RepositoryTaskSyncState.OUTGOING)) {
+ || ((AbstractTask) task).getSynchronizationState().equals(RepositoryTaskSyncState.OUTGOING)) {
MessageDialog.openInformation(attachmentsComposite.getShell(),
"Task not synchronized or dirty editor",
"Commit edits or synchronize task before deleting attachments.");
@@ -1758,7 +1758,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
final ExpandableComposite expandableComposite = toolkit.createExpandableComposite(addCommentsComposite,
ExpandableComposite.TREE_NODE | ExpandableComposite.LEFT_TEXT_CLIENT_ALIGNMENT);
- if ((repositoryTask != null && repositoryTask.getLastSyncDateStamp() == null)
+ if ((repositoryTask != null && repositoryTask.getLastReadTimeStamp() == null)
|| editorInput.getOldTaskData() == null) {
// hit or lost task data, expose all comments
expandableComposite.setExpanded(true);
@@ -2713,8 +2713,8 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
// Synchronization accounting...
if (modifiedTask != null) {
// Attach context if required
- if (attachContext) {
- connector.attachContext(repository, modifiedTask, "", new SubProgressMonitor(monitor, 1));
+ if (attachContext && connector.getAttachmentHandler() != null) {
+ connector.getAttachmentHandler().attachContext(repository, modifiedTask, "", new SubProgressMonitor(monitor, 1));
}
modifiedTask.setSubmitting(true);
@@ -2748,7 +2748,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
TasksUiUtil.openRepositoryTask(repository.getUrl(), taskData.getId(),
- connector.getTaskWebUrl(taskData.getRepositoryUrl(), taskData.getId()));
+ connector.getTaskUrl(taskData.getRepositoryUrl(), taskData.getId()));
}
});
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttachmentTableLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttachmentTableLabelProvider.java
index 93f4b1ff7..ddc8d7325 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttachmentTableLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttachmentTableLabelProvider.java
@@ -16,7 +16,7 @@ import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.mylyn.internal.tasks.ui.TaskListColorsAndFonts;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
@@ -45,8 +45,8 @@ public class AttachmentTableLabelProvider extends DecoratingLabelProvider implem
public Image getColumnImage(Object element, int columnIndex) {
RepositoryAttachment attachment = (RepositoryAttachment) element;
if (columnIndex == 0) {
- if (AbstractRepositoryConnector.MYLAR_CONTEXT_DESCRIPTION.equals(attachment.getDescription())
- || AbstractRepositoryConnector.MYLAR_CONTEXT_DESCRIPTION_LEGACY.equals(attachment.getDescription())) {
+ if (AbstractAttachmentHandler.MYLAR_CONTEXT_DESCRIPTION.equals(attachment.getDescription())
+ || AbstractAttachmentHandler.MYLAR_CONTEXT_DESCRIPTION_LEGACY.equals(attachment.getDescription())) {
return TasksUiImages.getImage(TasksUiImages.CONTEXT_TRANSFER);
} else if (attachment.isPatch()) {
return TasksUiImages.getImage(TasksUiImages.ATTACHMENT_PATCH);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
index 9fa08a4ab..9003517d1 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
@@ -391,14 +391,14 @@ public final class TaskEditor extends SharedHeaderFormEditor implements IBusyEdi
if (task instanceof LocalTask) {
getHeaderForm().getForm().setText("Task: " + task.getSummary());
} else {
- setFormHeaderImage(((AbstractTask) task).getRepositoryKind());
+ setFormHeaderImage(((AbstractTask) task).getConnectorKind());
setFormHeaderLabel((AbstractTask) task);
return;
}
} else if (input instanceof RepositoryTaskEditorInput) {
AbstractTask task = ((RepositoryTaskEditorInput) input).getRepositoryTask();
if (task != null && task instanceof AbstractTask) {
- setFormHeaderImage(((AbstractTask) task).getRepositoryKind());
+ setFormHeaderImage(((AbstractTask) task).getConnectorKind());
setFormHeaderLabel((AbstractTask) task);
return;
} else {
@@ -470,7 +470,7 @@ public final class TaskEditor extends SharedHeaderFormEditor implements IBusyEdi
private void setFormHeaderLabel(AbstractTask repositoryTask) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(repositoryTask.getRepositoryKind());
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(repositoryTask.getConnectorKind());
String kindLabel = "";
if (connectorUi != null) {
kindLabel = connectorUi.getTaskKindLabel(repositoryTask);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java
index 804e5c960..767b92b73 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java
@@ -105,7 +105,7 @@ public class TaskHyperlinkDetector extends AbstractHyperlinkDetector {
private TaskRepository guessRepository(String text) {
TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
for (AbstractRepositoryConnector c : manager.getRepositoryConnectors()) {
- for (TaskRepository repository : manager.getRepositories(c.getRepositoryType())) {
+ for (TaskRepository repository : manager.getRepositories(c.getConnectorKind())) {
String[] ids = c.getTaskIdsFromComment(repository, text);
if (ids != null && ids.length > 0 && ids[0].length() > 0) {
return repository;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
index 7497caf25..b61552799 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
@@ -590,7 +590,7 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage {
// repository = createTaskRepository();
// }
if (repository != null) {
- String accountCreationUrl = TasksUiPlugin.getRepositoryUi(connector.getRepositoryType())
+ String accountCreationUrl = TasksUiPlugin.getRepositoryUi(connector.getConnectorKind())
.getAccountCreationUrl(repository);
if (accountCreationUrl != null) {
TasksUiUtil.openUrl(accountCreationUrl, false);
@@ -609,7 +609,7 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage {
repository = createTaskRepository();
}
if (repository != null) {
- String accountManagementUrl = TasksUiPlugin.getRepositoryUi(connector.getRepositoryType())
+ String accountManagementUrl = TasksUiPlugin.getRepositoryUi(connector.getConnectorKind())
.getAccountManagementUrl(repository);
if (accountManagementUrl != null) {
TasksUiUtil.openUrl(accountManagementUrl, false);
@@ -887,12 +887,12 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage {
void updateHyperlinks() {
if (getServerUrl() != null && getServerUrl().length() > 0) {
TaskRepository repository = createTaskRepository();
- String accountCreationUrl = TasksUiPlugin.getRepositoryUi(connector.getRepositoryType())
+ String accountCreationUrl = TasksUiPlugin.getRepositoryUi(connector.getConnectorKind())
.getAccountCreationUrl(repository);
createAccountHyperlink.setEnabled(accountCreationUrl != null);
createAccountHyperlink.setVisible(accountCreationUrl != null);
- String accountManagementUrl = TasksUiPlugin.getRepositoryUi(connector.getRepositoryType())
+ String accountManagementUrl = TasksUiPlugin.getRepositoryUi(connector.getConnectorKind())
.getAccountManagementUrl(repository);
manageAccountHyperlink.setEnabled(accountManagementUrl != null);
manageAccountHyperlink.setVisible(accountManagementUrl != null);
@@ -1105,7 +1105,7 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage {
// getVersion(),
// getCharacterEncoding(), getTimeZoneId());
- TaskRepository repository = new TaskRepository(connector.getRepositoryType(), getServerUrl(), getVersion(),
+ TaskRepository repository = new TaskRepository(connector.getConnectorKind(), getServerUrl(), getVersion(),
getCharacterEncoding(), "");
repository.setRepositoryLabel(getRepositoryLabel());
repository.setAuthenticationCredentials(getUserName(), getPassword());
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttributeFactory.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttributeFactory.java
index 0a85600e2..957a76096 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttributeFactory.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttributeFactory.java
@@ -123,7 +123,7 @@ public class TracAttributeFactory extends AbstractAttributeFactory {
}
@Override
- public boolean getIsHidden(String key) {
+ public boolean isHidden(String key) {
if (isInternalAttribute(key)) {
return true;
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java
index c808c8494..8c398972c 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java
@@ -27,12 +27,12 @@ import org.eclipse.mylyn.internal.trac.core.TracTask.Kind;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
import org.eclipse.mylyn.internal.trac.core.util.TracUtils;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
-import org.eclipse.mylyn.tasks.core.ITaskCollector;
import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler;
+import org.eclipse.mylyn.tasks.core.ITaskCollector;
import org.eclipse.mylyn.tasks.core.RepositoryOperation;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute;
@@ -72,7 +72,7 @@ public class TracRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getRepositoryType() {
+ public String getConnectorKind() {
return TracCorePlugin.REPOSITORY_KIND;
}
@@ -94,12 +94,12 @@ public class TracRepositoryConnector extends AbstractRepositoryConnector {
}
@Override
- public String getTaskWebUrl(String repositoryUrl, String taskId) {
+ public String getTaskUrl(String repositoryUrl, String taskId) {
return repositoryUrl + ITracClient.TICKET_URL + taskId;
}
@Override
- public IAttachmentHandler getAttachmentHandler() {
+ public AbstractAttachmentHandler getAttachmentHandler() {
return attachmentHandler;
}
@@ -234,7 +234,7 @@ public class TracRepositoryConnector extends AbstractRepositoryConnector {
repositoryTask.setPriority(TracTask.getMylarPriority(taskData.getAttributeValue(Attribute.PRIORITY
.getTracKey())));
Kind kind = TracTask.Kind.fromType(taskData.getAttributeValue(Attribute.TYPE.getTracKey()));
- repositoryTask.setKind((kind != null) ? kind.toString() : null);
+ repositoryTask.setTaskKind((kind != null) ? kind.toString() : null);
// TODO: Completion Date
}
}
@@ -270,7 +270,7 @@ public class TracRepositoryConnector extends AbstractRepositoryConnector {
task.setPriority(TracTask.getMylarPriority(ticket.getValue(Key.PRIORITY)));
if (ticket.getValue(Key.TYPE) != null) {
Kind kind = TracTask.Kind.fromType(ticket.getValue(Key.TYPE));
- task.setKind((kind != null) ? kind.toString() : ticket.getValue(Key.TYPE));
+ task.setTaskKind((kind != null) ? kind.toString() : ticket.getValue(Key.TYPE));
}
if (ticket.getCreated() != null) {
task.setCreationDate(ticket.getCreated());
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTask.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTask.java
index 6ed7aec81..a5a3b7cab 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTask.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTask.java
@@ -140,7 +140,7 @@ public class TracTask extends AbstractTask {
}
@Override
- public String getRepositoryKind() {
+ public String getConnectorKind() {
return TracCorePlugin.REPOSITORY_KIND;
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
index 40866b31c..4c98481e5 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
@@ -29,9 +29,9 @@ import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.internal.trac.core.TracTask;
import org.eclipse.mylyn.internal.trac.core.ITracClient.Version;
+import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.FileAttachment;
-import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
@@ -50,7 +50,7 @@ public class TracAttachmentHandlerTest extends TestCase {
private TracRepositoryConnector connector;
- private IAttachmentHandler attachmentHandler;
+ private AbstractAttachmentHandler attachmentHandler;
private TestData data;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
index 2327845d9..2375d2364 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
@@ -97,7 +97,7 @@ public class TracRepositoryConnectorTest extends TestCase {
manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
AbstractRepositoryConnector abstractConnector = manager.getRepositoryConnector(kind);
- assertEquals(abstractConnector.getRepositoryType(), kind);
+ assertEquals(abstractConnector.getConnectorKind(), kind);
connector = (TracRepositoryConnector) abstractConnector;
TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
@@ -314,7 +314,7 @@ public class TracRepositoryConnectorTest extends TestCase {
sourceContextFile.createNewFile();
sourceContextFile.deleteOnExit();
- assertTrue(connector.attachContext(repository, task, "", new NullProgressMonitor()));
+ assertTrue(connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor()));
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
// TODO attachment may have been overridden therefore size may not have changed
@@ -333,7 +333,7 @@ public class TracRepositoryConnectorTest extends TestCase {
sourceContextFile.deleteOnExit();
try {
- connector.attachContext(repository, task, "", new NullProgressMonitor());
+ connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor());
fail("expected CoreException"); // operation should not be supported
} catch (CoreException e) {
}
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java
index c334e00b5..027a0be18 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java
@@ -117,15 +117,15 @@ public class TracRepositoryUi extends AbstractRepositoryConnectorUi {
List<AbstractTaskContainer> legendItems = new ArrayList<AbstractTaskContainer>();
TracTask defect = new TracTask("", Kind.DEFECT.name(), Kind.DEFECT.toString());
- defect.setKind(Kind.DEFECT.toString());
+ defect.setTaskKind(Kind.DEFECT.toString());
legendItems.add(defect);
TracTask enhancement = new TracTask("", Kind.ENHANCEMENT.name(), Kind.ENHANCEMENT.toString());
- enhancement.setKind(Kind.ENHANCEMENT.toString());
+ enhancement.setTaskKind(Kind.ENHANCEMENT.toString());
legendItems.add(enhancement);
TracTask task = new TracTask("", Kind.TASK.name(), Kind.TASK.toString());
- task.setKind(Kind.TASK.toString());
+ task.setTaskKind(Kind.TASK.toString());
legendItems.add(task);
return legendItems;

Back to the top