Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-08 02:46:14 +0000
committermkersten2007-06-08 02:46:14 +0000
commit8724cdcfd3f1901f2daa614ba905b4b4ac61e4ed (patch)
tree2049ceb51efb0762fc84760e05702d05eff0830e /org.eclipse.mylyn.tasks.core
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
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-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
5 files changed, 109 insertions, 153 deletions
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.");
}

Back to the top