Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-05-25 23:38:11 -0400
committerspingel2010-05-25 23:38:11 -0400
commit2c56cb95293d0eae3f83cfdaaa44d89b5a5ada4f (patch)
treee402038be2163d3ea5b741545bb7dc91cceb87b2 /org.eclipse.mylyn.tasks.ui
parent09e54670ab62dff9004277c72de09dc6eace994a (diff)
downloadorg.eclipse.mylyn.tasks-2c56cb95293d0eae3f83cfdaaa44d89b5a5ada4f.tar.gz
org.eclipse.mylyn.tasks-2c56cb95293d0eae3f83cfdaaa44d89b5a5ada4f.tar.xz
org.eclipse.mylyn.tasks-2c56cb95293d0eae3f83cfdaaa44d89b5a5ada4f.zip
REOPENED - bug 304910: [api] recognize comment#number link on bug editor without bug number too
https://bugs.eclipse.org/bugs/show_bug.cgi?id=304910
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java62
1 files changed, 61 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java
index 4aaa0d54c..0272c4571 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java
@@ -38,7 +38,7 @@ public final class TaskHyperlink implements IHyperlink {
private final String taskId;
- Object selection;
+ private Object selection;
public TaskHyperlink(IRegion region, TaskRepository repository, String taskId) {
this.region = region;
@@ -114,4 +114,64 @@ public final class TaskHyperlink implements IHyperlink {
this.selection = selection;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((region == null) ? 0 : region.hashCode());
+ result = prime * result + ((repository == null) ? 0 : repository.hashCode());
+ result = prime * result + ((selection == null) ? 0 : selection.hashCode());
+ result = prime * result + ((taskId == null) ? 0 : taskId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TaskHyperlink other = (TaskHyperlink) obj;
+ if (region == null) {
+ if (other.region != null) {
+ return false;
+ }
+ } else if (!region.equals(other.region)) {
+ return false;
+ }
+ if (repository == null) {
+ if (other.repository != null) {
+ return false;
+ }
+ } else if (!repository.equals(other.repository)) {
+ return false;
+ }
+ if (selection == null) {
+ if (other.selection != null) {
+ return false;
+ }
+ } else if (!selection.equals(other.selection)) {
+ return false;
+ }
+ if (taskId == null) {
+ if (other.taskId != null) {
+ return false;
+ }
+ } else if (!taskId.equals(other.taskId)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "TaskHyperlink [region=" + region + ", repository=" + repository + ", selection=" + selection //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + ", taskId=" + taskId + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
}

Back to the top