Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-07 22:46:14 -0400
committermkersten2007-06-07 22:46:14 -0400
commit8724cdcfd3f1901f2daa614ba905b4b4ac61e4ed (patch)
tree2049ceb51efb0762fc84760e05702d05eff0830e
parentc903b2a2c43c7964e6ec36fbbd4561dffba1b355 (diff)
downloadorg.eclipse.mylyn.tasks-8724cdcfd3f1901f2daa614ba905b4b4ac61e4ed.tar.gz
org.eclipse.mylyn.tasks-8724cdcfd3f1901f2daa614ba905b4b4ac61e4ed.tar.xz
org.eclipse.mylyn.tasks-8724cdcfd3f1901f2daa614ba905b4b4ac61e4ed.zip
NEW - bug 191406: rename Mylar project to Mylyn
https://bugs.eclipse.org/bugs/show_bug.cgi?id=191406
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java43
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java20
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryReportFactory.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java8
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IMylarStatusConstants.java45
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarStatus.java92
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java119
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryAwareStatusHandler.java9
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewAttachmentWizard.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java13
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/NewTaskWizard.java11
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java5
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracCorePlugin.java10
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracStatus.java3
21 files changed, 187 insertions, 241 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java
index 08016e67b..58301253c 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java
@@ -19,9 +19,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
/**
@@ -42,7 +42,7 @@ public class BugzillaAttachmentHandler extends AbstractAttachmentHandler {
return client.getAttachmentData(attachment.getId());
} catch (IOException e) {
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.IO_ERROR, repository.getUrl(), e));
+ RepositoryStatus.ERROR_IO, repository.getUrl(), e));
}
}
@@ -54,7 +54,7 @@ public class BugzillaAttachmentHandler extends AbstractAttachmentHandler {
client.postAttachment(bugId, comment, attachment);
} catch (IOException e) {
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.IO_ERROR, repository.getUrl(), e));
+ RepositoryStatus.ERROR_IO, repository.getUrl(), e));
}
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 99d2ba399..fe2842bc7 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -57,7 +57,6 @@ import org.eclipse.mylyn.core.net.HtmlStreamTokenizer.Token;
import org.eclipse.mylyn.internal.bugzilla.core.history.BugzillaTaskHistoryParser;
import org.eclipse.mylyn.internal.bugzilla.core.history.TaskHistory;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.QueryHitCollector;
import org.eclipse.mylyn.tasks.core.RepositoryOperation;
@@ -245,7 +244,7 @@ public class BugzillaClient {
} catch (IOException e) {
getMethod.releaseConnection();
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.IO_ERROR, repositoryUrl.toString(), e));
+ RepositoryStatus.ERROR_IO, repositoryUrl.toString(), e));
}
if (code == HttpURLConnection.HTTP_OK) {
@@ -262,20 +261,20 @@ public class BugzillaClient {
getMethod.getResponseBody();
getMethod.releaseConnection();
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(),
+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(),
"Proxy authentication required"));
} else {
getMethod.getResponseBody();
getMethod.releaseConnection();
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.NETWORK_ERROR, "Http error: " + HttpStatus.getStatusText(code)));
+ RepositoryStatus.ERROR_NETWORK, "Http error: " + HttpStatus.getStatusText(code)));
// throw new IOException("HttpClient connection error response
// code: " + code);
}
}
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.INTERNAL_ERROR, "All connection attempts to " + repositoryUrl.toString()
+ RepositoryStatus.ERROR_INTERNAL, "All connection attempts to " + repositoryUrl.toString()
+ " failed. Please verify connection and authentication information."));
}
@@ -306,12 +305,12 @@ public class BugzillaClient {
}
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.NETWORK_ERROR, repositoryUrl.toString(), "Logout unsuccessful."));
+ RepositoryStatus.ERROR_NETWORK, repositoryUrl.toString(), "Logout unsuccessful."));
} catch (ParseException e) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString()
+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString()
+ "."));
} finally {
if (method != null) {
@@ -324,7 +323,7 @@ public class BugzillaClient {
if (!hasAuthenticationCredentials()) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(),
+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(),
"Authentication credentials missing."));
}
@@ -354,7 +353,7 @@ public class BugzillaClient {
if (code == HttpURLConnection.HTTP_UNAUTHORIZED || code == HttpURLConnection.HTTP_FORBIDDEN) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(),
+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(),
"HTTP authentication failed."));
}
if (hasAuthenticationCredentials()) {
@@ -373,7 +372,7 @@ public class BugzillaClient {
responseReader.close();
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(),
+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(),
IBugzillaConstants.INVALID_CREDENTIALS));
}
}
@@ -384,12 +383,12 @@ public class BugzillaClient {
} catch (ParseException e) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString()
+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString()
+ "."));
} catch (IOException e) {
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.IO_ERROR, repositoryUrl.toString(), e));
+ RepositoryStatus.ERROR_IO, repositoryUrl.toString(), e));
} finally {
if (postMethod != null) {
postMethod.releaseConnection();
@@ -651,7 +650,7 @@ public class BugzillaClient {
} else {
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.NETWORK_ERROR, repositoryUrl.toString(), "Http error: "
+ RepositoryStatus.ERROR_NETWORK, repositoryUrl.toString(), "Http error: "
+ HttpStatus.getStatusText(status)));
// throw new IOException("Communication error occurred during
// upload. \n\n"
@@ -796,7 +795,7 @@ public class BugzillaClient {
} catch (ParseException e) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString()
+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString()
+ "."));
} finally {
if (method != null) {
@@ -970,19 +969,19 @@ public class BugzillaClient {
|| title.indexOf("check e-mail") != -1) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(), title));
+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(), title));
} else if (title.indexOf(IBugzillaConstants.ERROR_MIDAIR_COLLISION) != -1) {
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_COLLISION, repositoryUrl.toString()));
+ RepositoryStatus.REPOSITORY_COLLISION, repositoryUrl.toString()));
} else if (title.indexOf(IBugzillaConstants.ERROR_COMMENT_REQUIRED) != -1) {
throw new CoreException(new BugzillaStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_COMMENT_REQD));
+ RepositoryStatus.REPOSITORY_COMMENT_REQUIRED));
} else if (title.indexOf(IBugzillaConstants.LOGGED_OUT) != -1) {
authenticated = false;
// throw new
// BugzillaException(IBugzillaConstants.LOGGED_OUT);
throw new CoreException(new BugzillaStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.LOGGED_OUT_OF_REPOSITORY,
+ RepositoryStatus.REPOSITORY_LOGGED_OUT,
"You have been logged out. Please retry operation."));
} else if (title.indexOf(IBugzillaConstants.CHANGES_SUBMITTED) != -1) {
return;
@@ -992,13 +991,13 @@ public class BugzillaClient {
}
throw new CoreException(RepositoryStatus.createHtmlStatus(repositoryUrl.toString(), IStatus.INFO,
- BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.REPOSITORY_ERROR,
+ BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_REPOSITORY,
"A repository error has occurred.", body));
} catch (ParseException e) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString()
+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString()
+ "."));
} finally {
in.close();
@@ -1022,12 +1021,12 @@ public class BugzillaClient {
} catch (LoginException e) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(),
+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(),
IBugzillaConstants.INVALID_CREDENTIALS));
} catch (ParseException e) {
authenticated = false;
throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from "
+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from "
+ repositoryUrl.toString() + "."));
}
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java
index ac0e96888..b81571dda 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java
@@ -12,13 +12,13 @@
package org.eclipse.mylyn.internal.bugzilla.core;
import org.eclipse.core.runtime.Status;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TasksMessages;
/**
* @author Rob Elves
*/
-public class BugzillaStatus extends Status implements IMylarStatusConstants {
+public class BugzillaStatus extends Status {
private String errorMessage;
@@ -58,14 +58,14 @@ public class BugzillaStatus extends Status implements IMylarStatusConstants {
public String getMessage() {
switch (getCode()) {
- case REPOSITORY_LOGIN_ERROR:
+ case RepositoryStatus.ERROR_REPOSITORY_LOGIN:
return TasksMessages
.bind(TasksMessages.repository_login_failure, this.getRepositoryUrl(), this.errorMessage);
- case REPOSITORY_NOT_FOUND:
+ case RepositoryStatus.ERROR_REPOSITORY_NOT_FOUND:
return TasksMessages.bind(TasksMessages.repository_not_found, this.errorMessage);
- case REPOSITORY_ERROR:
+ case RepositoryStatus.ERROR_REPOSITORY:
return TasksMessages.bind(TasksMessages.repository_error, this.getRepositoryUrl(), this.errorMessage);
- case IO_ERROR:
+ case RepositoryStatus.ERROR_IO:
String string1 = "Unknown IO error occurred";
String string2 = "No message provided";
if(getException() != null) {
@@ -74,13 +74,13 @@ public class BugzillaStatus extends Status implements IMylarStatusConstants {
}
Object[] strings = { getRepositoryUrl(), string1, string2 };
return TasksMessages.bind(TasksMessages.io_error, strings);
- case INTERNAL_ERROR:
+ case RepositoryStatus.ERROR_INTERNAL:
return TasksMessages.bind(TasksMessages.internal_error, this.errorMessage);
- case OPERATION_CANCELLED:
+ case RepositoryStatus.OPERATION_CANCELLED:
return TasksMessages.bind(TasksMessages.operation_cancelled, this.errorMessage);
- case REPOSITORY_COLLISION:
+ case RepositoryStatus.REPOSITORY_COLLISION:
return TasksMessages.bind(TasksMessages.repository_collision, this.errorMessage);
- case REPOSITORY_COMMENT_REQD:
+ case RepositoryStatus.REPOSITORY_COMMENT_REQUIRED:
if (errorMessage == null) {
return TasksMessages.repository_comment_reqd;
} else {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
index ddf9b4852..5fb080fde 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
@@ -23,9 +23,9 @@ import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_OPER
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_RESOLUTION;
import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.ITaskDataHandler;
import org.eclipse.mylyn.tasks.core.RepositoryOperation;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -77,7 +77,7 @@ public class BugzillaTaskDataHandler implements ITaskDataHandler {
taskData = client.getTaskData(bugId);
} catch (CoreException e) {
// TODO: Move retry handling into client
- if (e.getStatus().getCode() == IMylarStatusConstants.REPOSITORY_LOGIN_ERROR) {
+ if (e.getStatus().getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN) {
taskData = client.getTaskData(bugId);
} else {
throw e;
@@ -99,7 +99,7 @@ public class BugzillaTaskDataHandler implements ITaskDataHandler {
} catch (IOException e) {
throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.IO_ERROR, repository.getUrl(), e));
+ RepositoryStatus.ERROR_IO, repository.getUrl(), e));
}
}
@@ -111,7 +111,7 @@ public class BugzillaTaskDataHandler implements ITaskDataHandler {
return client.postTaskData(taskData);
} catch (CoreException e) {
// TODO: Move retry handling into client
- if (e.getStatus().getCode() == IMylarStatusConstants.REPOSITORY_LOGIN_ERROR) {
+ if (e.getStatus().getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN) {
return client.postTaskData(taskData);
} else {
throw e;
@@ -121,7 +121,7 @@ public class BugzillaTaskDataHandler implements ITaskDataHandler {
} catch (IOException e) {
throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.IO_ERROR, repository.getUrl(), e));
+ RepositoryStatus.ERROR_IO, repository.getUrl(), e));
}
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java
index db203939d..ea28f402c 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java
@@ -18,7 +18,7 @@ import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
/**
@@ -44,12 +44,12 @@ public class MultiBugReportFactory extends AbstractReportFactory {
if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTFOUND)
|| errorResponse.equals(IBugzillaConstants.XML_ERROR_INVALIDBUGID)) {
throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_ERROR, "",
+ RepositoryStatus.ERROR_REPOSITORY, "",
IBugzillaConstants.ERROR_MSG_INVALID_BUG_ID));
}
if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTPERMITTED)) {
throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_ERROR, "",
+ RepositoryStatus.ERROR_REPOSITORY, "",
IBugzillaConstants.ERROR_MSG_OP_NOT_PERMITTED));
}
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryReportFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryReportFactory.java
index 2c751ee50..cc69fb097 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryReportFactory.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryReportFactory.java
@@ -17,7 +17,7 @@ import java.util.Locale;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
/**
@@ -43,12 +43,12 @@ public class RepositoryReportFactory extends AbstractReportFactory {
if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTFOUND)
|| errorResponse.equals(IBugzillaConstants.XML_ERROR_INVALIDBUGID)) {
throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_ERROR, bugReport.getRepositoryUrl(),
+ RepositoryStatus.ERROR_REPOSITORY, bugReport.getRepositoryUrl(),
IBugzillaConstants.ERROR_MSG_INVALID_BUG_ID));
}
if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTPERMITTED)) {
throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_ERROR, bugReport.getRepositoryUrl(),
+ RepositoryStatus.ERROR_REPOSITORY, bugReport.getRepositoryUrl(),
IBugzillaConstants.ERROR_MSG_OP_NOT_PERMITTED));
}
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
index 0c2ea1408..44a638f55 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
@@ -29,7 +29,7 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaStatus;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTemplate;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
@@ -346,15 +346,15 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
private void displayError(final String serverUrl, Throwable e) {
IStatus status;
if (e instanceof MalformedURLException) {
- status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.NETWORK_ERROR,
+ status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_NETWORK,
"Server URL is invalid.");
} else if (e instanceof CoreException) {
status = ((CoreException) e).getStatus();
} else if (e instanceof IOException) {
- status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.IO_ERROR,
+ status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_IO,
serverUrl, e.getMessage());
} else {
- status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.NETWORK_ERROR,
+ status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_NETWORK,
serverUrl, e.getMessage());
}
MylarStatusHandler.displayStatus("Validation failed", status);
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 bd7623704..0e8b2e272 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
@@ -338,8 +338,8 @@ public abstract class AbstractRepositoryConnector {
}
}
} catch (FileNotFoundException e) {
- throw new CoreException(new MylarStatus(IStatus.ERROR, "org.eclipse.mylyn.tasks.core",
- IMylarStatusConstants.INTERNAL_ERROR, "Could not create context file", e));
+ throw new CoreException(new RepositoryStatus(IStatus.ERROR, "org.eclipse.mylyn.tasks.core",
+ RepositoryStatus.ERROR_INTERNAL, "Could not create context file", e));
}
return true;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IMylarStatusConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IMylarStatusConstants.java
deleted file mode 100644
index a31b84499..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IMylarStatusConstants.java
+++ /dev/null
@@ -1,45 +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;
-
-/**
- * @author Rob Elves
- * @author Steffen Pingel
- */
-public interface IMylarStatusConstants {
-
- /**
- * requires construction with repositoryUrl and error message
- */
- public final static int REPOSITORY_ERROR = 1;
-
- public final static int REPOSITORY_LOGIN_ERROR = 3;
-
- public final static int REPOSITORY_NOT_FOUND = 4;
-
- public final static int IO_ERROR = 5;
-
- public final static int REPOSITORY_COLLISION = 6;
-
- public final static int INTERNAL_ERROR = 7;
-
- public final static int OPERATION_CANCELLED = 8;
-
- public final static int REPOSITORY_COMMENT_REQD = 9;
-
- public final static int LOGGED_OUT_OF_REPOSITORY = 10;
-
- public final static int NETWORK_ERROR = 11;
-
- public final static int PERMISSION_DENIED_ERROR = 12;
-
-}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java
index ec229497c..71a1b73ae 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java
@@ -32,7 +32,5 @@ public interface IRepositoryConstants {
public static final String PROPERTY_DELIM = ":";
public static final String KIND_UNKNOWN = "<unknown>";
-
-// public static final String PROPERTY_MIGRATION060 = "migration060";
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarStatus.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarStatus.java
deleted file mode 100644
index d5ac05ed0..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarStatus.java
+++ /dev/null
@@ -1,92 +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 org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-/**
- * @author Rob Elves
- * @author Steffen Pingel
- */
-public class MylarStatus extends Status implements IMylarStatusConstants {
-
- private String htmlMessage;
-
- /**
- * Constructs a status object with a message.
- */
- public MylarStatus(int severity, String pluginId, int code, String message) {
- super(severity, pluginId, code, message, null);
- }
-
- /**
- * Constructs a status object with a message and an exception. that caused
- * the error.
- */
- public MylarStatus(int severity, String pluginId, int code, String message, Throwable e) {
- super(severity, pluginId, code, message, e);
- }
-
- /**
- * Returns the message that is relevant to the code of this status.
- */
- public String getMessage() {
- String message = super.getMessage();
- if (message != null && !"".equals(message)) {
- return message;
- }
-
- Throwable exception = getException();
- if (exception != null) {
- if (exception.getMessage() != null) {
- return exception.getMessage();
- }
- return exception.toString();
- }
-
- return "";
- }
-
- @Override
- protected void setMessage(String message) {
- super.setMessage((message != null) ? message : "");
- }
-
- protected void setHtmlMessage(String htmlMessage) {
- this.htmlMessage = htmlMessage;
- }
-
- public String getHtmlMessage() {
- return htmlMessage;
- }
-
- public boolean isHtmlMessage() {
- return htmlMessage != null;
- }
-
- public static MylarStatus createInternalError(String pluginId, String message, Throwable t) {
- return new MylarStatus(IStatus.ERROR, pluginId, IMylarStatusConstants.INTERNAL_ERROR, message, t);
- }
-
- public static MylarStatus createHtmlStatus(int severity, String pluginId, int code, String message,
- String htmlMessage) {
- if (htmlMessage == null) {
- throw new IllegalArgumentException("htmlMessage must not be null");
- }
-
- MylarStatus status = new MylarStatus(severity, pluginId, code, message);
- status.setHtmlMessage(htmlMessage);
- return status;
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java
index 498252d27..4f512f2d6 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java
@@ -11,6 +11,7 @@
package org.eclipse.mylyn.tasks.core;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
@@ -18,10 +19,37 @@ import org.eclipse.osgi.util.NLS;
* @author Rob Elves
* @author Steffen Pingel
*/
-public class RepositoryStatus extends MylarStatus {
+public class RepositoryStatus extends Status {
- private String repositoryUrl;
+ public final static int ERROR_IO = 5;
+ public final static int ERROR_NETWORK = 11;
+
+ public final static int ERROR_PERMISSION_DENIED = 12;
+
+ /**
+ * requires construction with repositoryUrl and error message
+ */
+ public final static int ERROR_REPOSITORY = 1;
+
+ public final static int ERROR_REPOSITORY_LOGIN = 3;
+
+ public final static int ERROR_REPOSITORY_NOT_FOUND = 4;
+
+ public final static int OPERATION_CANCELLED = 8;
+
+ public final static int REPOSITORY_COLLISION = 6;
+
+ public final static int REPOSITORY_COMMENT_REQUIRED = 9;
+
+ public final static int REPOSITORY_LOGGED_OUT = 10;
+
+ public final static int ERROR_INTERNAL = 7;
+
+ private String htmlMessage;
+
+ protected String repositoryUrl;
+
public RepositoryStatus(TaskRepository repository, int severity, String pluginId, int code, String message) {
this(repository.getUrl(), severity, pluginId, code, message, null);
}
@@ -45,28 +73,96 @@ public class RepositoryStatus extends MylarStatus {
this.repositoryUrl = repositoryUrl;
}
+ /**
+ * Constructs a status object with a message.
+ */
+ public RepositoryStatus(int severity, String pluginId, int code, String message) {
+ super(severity, pluginId, code, message, null);
+ }
+
+ /**
+ * Constructs a status object with a message and an exception. that caused the error.
+ */
+ public RepositoryStatus(int severity, String pluginId, int code, String message, Throwable e) {
+ super(severity, pluginId, code, message, e);
+ }
+
+ /**
+ * Returns the message that is relevant to the code of this status.
+ */
+ public String getMessage() {
+ String message = super.getMessage();
+ if (message != null && !"".equals(message)) {
+ return message;
+ }
+
+ Throwable exception = getException();
+ if (exception != null) {
+ if (exception.getMessage() != null) {
+ return exception.getMessage();
+ }
+ return exception.toString();
+ }
+
+ return "";
+ }
+
+ @Override
+ protected void setMessage(String message) {
+ super.setMessage((message != null) ? message : "");
+ }
+
+ protected void setHtmlMessage(String htmlMessage) {
+ this.htmlMessage = htmlMessage;
+ }
+
+ public String getHtmlMessage() {
+ return htmlMessage;
+ }
+
+ public boolean isHtmlMessage() {
+ return htmlMessage != null;
+ }
+
public String getRepositoryUrl() {
return repositoryUrl;
}
+ public static RepositoryStatus createInternalError(String pluginId, String message, Throwable t) {
+ return new RepositoryStatus(IStatus.ERROR, pluginId, RepositoryStatus.ERROR_INTERNAL, message, t);
+ }
+
+ public static RepositoryStatus createHtmlStatus(int severity, String pluginId, int code, String message,
+ String htmlMessage) {
+ if (htmlMessage == null) {
+ throw new IllegalArgumentException("htmlMessage must not be null");
+ }
+
+ RepositoryStatus status = new RepositoryStatus(severity, pluginId, code, message);
+ status.setHtmlMessage(htmlMessage);
+ return status;
+ }
+
public static RepositoryStatus createStatus(TaskRepository repository, int severity, String pluginId, String message) {
return createStatus(repository.getUrl(), severity, pluginId, message);
}
public static RepositoryStatus createStatus(String repositoryUrl, int severity, String pluginId, String message) {
- return new RepositoryStatus(repositoryUrl, severity, pluginId, IMylarStatusConstants.REPOSITORY_ERROR, message);
+ return new RepositoryStatus(repositoryUrl, severity, pluginId, RepositoryStatus.ERROR_REPOSITORY,
+ message);
}
public static RepositoryStatus createLoginError(String repositoryUrl, String pluginId) {
return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId,
- IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, NLS.bind(
+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, NLS.bind(
"Unable to login to {0}. Please validate credentials via Task Repositories view.",
repositoryUrl));
}
public static RepositoryStatus createNotFoundError(String repositoryUrl, String pluginId) {
- return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId, IMylarStatusConstants.REPOSITORY_NOT_FOUND,
- NLS.bind("Repository {0} could not be found.", repositoryUrl));
+ return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId,
+ RepositoryStatus.ERROR_REPOSITORY_NOT_FOUND, NLS.bind("Repository {0} could not be found.",
+ repositoryUrl));
}
public static RepositoryStatus createCollisionError(String repositoryUrl, String pluginId) {
@@ -74,16 +170,15 @@ public class RepositoryStatus extends MylarStatus {
repositoryUrl,
Status.ERROR,
pluginId,
- IMylarStatusConstants.REPOSITORY_COLLISION,
- NLS
- .bind(
- "Mid-air collision occurred while submitting to {0}.\n\nSynchronize task and re-submit changes.",
- repositoryUrl));
+ RepositoryStatus.REPOSITORY_COLLISION,
+ NLS.bind(
+ "Mid-air collision occurred while submitting to {0}.\n\nSynchronize task and re-submit changes.",
+ repositoryUrl));
}
public static RepositoryStatus createCommentRequiredError(String repositoryUrl, String pluginId) {
return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId,
- IMylarStatusConstants.REPOSITORY_COMMENT_REQD,
+ RepositoryStatus.REPOSITORY_COMMENT_REQUIRED,
"You have to specify a new comment when making this change. Please comment on the reason for this change.");
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryAwareStatusHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryAwareStatusHandler.java
index 739b26703..0d31e8550 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryAwareStatusHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryAwareStatusHandler.java
@@ -16,8 +16,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.mylyn.core.IStatusHandler;
import org.eclipse.mylyn.core.MylarStatusHandler;
import org.eclipse.mylyn.internal.tasks.ui.util.WebBrowserDialog;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
-import org.eclipse.mylyn.tasks.core.MylarStatus;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
@@ -53,7 +52,7 @@ public class RepositoryAwareStatusHandler implements IStatusHandler {
public void displayStatus(final String title, final IStatus status) {
- if (status.getCode() == IMylarStatusConstants.INTERNAL_ERROR) {
+ if (status.getCode() == RepositoryStatus.ERROR_INTERNAL) {
MylarStatusHandler.log(status);
fail(status, true);
return;
@@ -69,9 +68,9 @@ public class RepositoryAwareStatusHandler implements IStatusHandler {
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
}
- if (status instanceof MylarStatus && ((MylarStatus) status).isHtmlMessage()) {
+ if (status instanceof RepositoryStatus && ((RepositoryStatus) status).isHtmlMessage()) {
WebBrowserDialog.openAcceptAgreement(shell, title, status.getMessage(),
- ((MylarStatus) status).getHtmlMessage());
+ ((RepositoryStatus) status).getHtmlMessage());
return;
}
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 cc1c4ea78..d555ea1a7 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
@@ -18,9 +18,8 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.core.MylarStatusHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
-import org.eclipse.mylyn.tasks.core.MylarStatus;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
import org.eclipse.swt.dnd.Clipboard;
@@ -49,7 +48,7 @@ public class CopyAttachmentToClipboardJob extends Job {
attachment.getRepositoryKind());
IAttachmentHandler handler = connector.getAttachmentHandler();
if (handler == null) {
- return new MylarStatus(IStatus.INFO, TasksUiPlugin.PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR,
+ 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/views/TaskListToolTipHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java
index 4c9616bf8..7482a3547 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
@@ -30,7 +30,7 @@ import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.DateRangeContainer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.MylarStatus;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask.RepositoryTaskSyncState;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -255,7 +255,7 @@ public class TaskListToolTipHandler {
}
if (query.getStatus() != null) {
tooltip += "\n" + "Last Error: " + query.getStatus().getMessage();
- if (query.getStatus() instanceof MylarStatus && ((MylarStatus) query.getStatus()).isHtmlMessage()) {
+ if (query.getStatus() instanceof RepositoryStatus && ((RepositoryStatus) query.getStatus()).isHtmlMessage()) {
tooltip += " Please synchronize manually for full error message.";
}
tooltip += "\n";
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 89eb2ff60..7fe55f3ed 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
@@ -35,10 +35,9 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.LocalAttachment;
-import org.eclipse.mylyn.tasks.core.MylarStatus;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask.RepositoryTaskSyncState;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -144,7 +143,7 @@ public class NewAttachmentWizard extends Wizard {
if (InputAttachmentSourcePage.CLIPBOARD_LABEL.equals(path)) {
String contents = inputPage.getClipboardContents();
if (contents == null) {
- throw new InvocationTargetException(new CoreException(new MylarStatus(IStatus.ERROR, TasksUiPlugin.PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR, "Clipboard is empty", null)));
+ throw new InvocationTargetException(new CoreException(new RepositoryStatus(IStatus.ERROR, TasksUiPlugin.PLUGIN_ID, RepositoryStatus.ERROR_INTERNAL, "Clipboard is empty", null)));
}
attachment.setContent(contents.getBytes());
attachment.setFilename(CLIPBOARD_FILENAME);
@@ -244,7 +243,7 @@ public class NewAttachmentWizard extends Wizard {
}
private void handleSubmitError(final CoreException exception) {
- if (exception.getStatus().getCode() == IMylarStatusConstants.REPOSITORY_LOGIN_ERROR) {
+ if (exception.getStatus().getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN) {
if (TasksUiUtil.openEditRepositoryWizard(repository) == MessageDialog.OK) {
// performFinish();
}
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 f15db3265..a7dc0e5f9 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
@@ -81,13 +81,12 @@ import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.IAttachmentHandler;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskDataHandler;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
-import org.eclipse.mylyn.tasks.core.MylarStatus;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryOperation;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.TaskComment;
@@ -2722,8 +2721,8 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
} else {
// null taskId, assume task could not be created...
throw new CoreException(
- new MylarStatus(IStatus.ERROR, TasksUiPlugin.PLUGIN_ID,
- IMylarStatusConstants.INTERNAL_ERROR,
+ new RepositoryStatus(IStatus.ERROR, TasksUiPlugin.PLUGIN_ID,
+ RepositoryStatus.ERROR_INTERNAL,
"Task could not be created. No additional information was provided by the connector."));
}
} else {
@@ -2906,16 +2905,16 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
if (form != null && !form.isDisposed()) {
- if (exception.getStatus().getCode() == IMylarStatusConstants.IO_ERROR) {
+ if (exception.getStatus().getCode() == RepositoryStatus.ERROR_IO) {
parentEditor.setMessage(ERROR_NOCONNECTIVITY, IMessageProvider.ERROR);
MylarStatusHandler.log(exception.getStatus());
- } else if (exception.getStatus().getCode() == IMylarStatusConstants.REPOSITORY_COMMENT_REQD) {
+ } else if (exception.getStatus().getCode() == RepositoryStatus.REPOSITORY_COMMENT_REQUIRED) {
MylarStatusHandler.displayStatus("Comment required", exception.getStatus());
if (!isDisposed && newCommentTextViewer != null
&& !newCommentTextViewer.getControl().isDisposed()) {
newCommentTextViewer.getControl().setFocus();
}
- } else if (exception.getStatus().getCode() == IMylarStatusConstants.REPOSITORY_LOGIN_ERROR) {
+ } else if (exception.getStatus().getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN) {
if (TasksUiUtil.openEditRepositoryWizard(repository) == MessageDialog.OK) {
submitToRepository();
return;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/NewTaskWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/NewTaskWizard.java
index 3d13de861..1fe1aa6ac 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/NewTaskWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/NewTaskWizard.java
@@ -19,9 +19,8 @@ import org.eclipse.jface.wizard.Wizard;
import org.eclipse.mylyn.core.MylarStatusHandler;
import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.ITaskDataHandler;
-import org.eclipse.mylyn.tasks.core.MylarStatus;
+import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -64,8 +63,8 @@ public class NewTaskWizard extends Wizard implements INewWizard {
final ITaskDataHandler taskDataHandler = (ITaskDataHandler) connector.getTaskDataHandler();
if (taskDataHandler == null) {
- MylarStatusHandler.displayStatus("Error creating new task", new MylarStatus(IStatus.ERROR,
- TasksUiPlugin.PLUGIN_ID, IMylarStatusConstants.REPOSITORY_ERROR, "The selected repository does not support creating new tasks."));
+ MylarStatusHandler.displayStatus("Error creating new task", new RepositoryStatus(IStatus.ERROR,
+ TasksUiPlugin.PLUGIN_ID, RepositoryStatus.ERROR_REPOSITORY, "The selected repository does not support creating new tasks."));
return false;
}
@@ -80,8 +79,8 @@ public class NewTaskWizard extends Wizard implements INewWizard {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
if (!taskDataHandler.initializeTaskData(taskRepository, taskData, monitor)) {
- throw new CoreException(new MylarStatus(IStatus.ERROR,
- TasksUiPlugin.PLUGIN_ID, IMylarStatusConstants.REPOSITORY_ERROR, "The selected repository does not support creating new tasks.")); }
+ throw new CoreException(new RepositoryStatus(IStatus.ERROR,
+ TasksUiPlugin.PLUGIN_ID, RepositoryStatus.ERROR_REPOSITORY, "The selected repository does not support creating new tasks.")); }
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java
index 779a57b9a..e1e469bd4 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java
@@ -19,7 +19,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
import org.eclipse.mylyn.tasks.core.AbstractAttachmentHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
@@ -42,7 +41,7 @@ public class TracAttachmentHandler extends AbstractAttachmentHandler {
String filename = attachment.getAttributeValue(RepositoryTaskAttribute.ATTACHMENT_FILENAME);
if (filename == null) {
throw new CoreException(new RepositoryStatus(repository.getUrl(), IStatus.ERROR, TracCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_ERROR, "Attachment download from " + repository.getUrl()
+ RepositoryStatus.ERROR_REPOSITORY, "Attachment download from " + repository.getUrl()
+ " failed, missing attachment filename."));
}
@@ -59,7 +58,7 @@ public class TracAttachmentHandler extends AbstractAttachmentHandler {
String comment, IProgressMonitor monitor) throws CoreException {
if (!TracRepositoryConnector.hasAttachmentSupport(repository, task)) {
throw new CoreException(new RepositoryStatus(repository.getUrl(), IStatus.INFO, TracCorePlugin.PLUGIN_ID,
- IMylarStatusConstants.REPOSITORY_ERROR,
+ RepositoryStatus.ERROR_REPOSITORY,
"Attachments are not supported by this repository access type"));
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracCorePlugin.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracCorePlugin.java
index f21db049c..30e53105b 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracCorePlugin.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracCorePlugin.java
@@ -17,8 +17,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
-import org.eclipse.mylyn.tasks.core.MylarStatus;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.osgi.framework.BundleContext;
@@ -101,13 +99,13 @@ public class TracCorePlugin extends Plugin {
if (message == null) {
message = "I/O error has occured";
}
- return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.IO_ERROR, message, e);
+ return new RepositoryStatus(Status.ERROR, PLUGIN_ID, RepositoryStatus.ERROR_IO, message, e);
} else if (e instanceof ClassCastException) {
- return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.IO_ERROR, "Unexpected server response: " + e.getMessage(), e);
+ return new RepositoryStatus(Status.ERROR, PLUGIN_ID, RepositoryStatus.ERROR_IO, "Unexpected server response: " + e.getMessage(), e);
} else if (e instanceof MalformedURLException) {
- return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.IO_ERROR, "Repository URL is invalid", e);
+ return new RepositoryStatus(Status.ERROR, PLUGIN_ID, RepositoryStatus.ERROR_IO, "Repository URL is invalid", e);
} else {
- return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR, "Unexpected error", e);
+ return new RepositoryStatus(Status.ERROR, PLUGIN_ID, RepositoryStatus.ERROR_INTERNAL, "Unexpected error", e);
}
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracStatus.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracStatus.java
index 14c056a5b..029321469 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracStatus.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracStatus.java
@@ -12,7 +12,6 @@
package org.eclipse.mylyn.internal.trac.core;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.mylyn.tasks.core.IMylarStatusConstants;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
/**
@@ -21,7 +20,7 @@ import org.eclipse.mylyn.tasks.core.RepositoryStatus;
public class TracStatus {
public static IStatus createPermissionDeniedError(String repositoryUrl, String pluginId) {
- return new RepositoryStatus(repositoryUrl, IStatus.ERROR, TracCorePlugin.PLUGIN_ID, IMylarStatusConstants.PERMISSION_DENIED_ERROR, "Permission denied.");
+ return new RepositoryStatus(repositoryUrl, IStatus.ERROR, TracCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_PERMISSION_DENIED, "Permission denied.");
}
}

Back to the top