Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-07-14 11:23:50 -0400
committersminto2005-07-14 11:23:50 -0400
commit6942ddd0abbfabcb46aeef28c4049a3421ba53d1 (patch)
tree55af7bb0da89d7c36b3be63804c1e7115fdfafb9 /org.eclipse.mylyn.tasks.ui
parente6b07416584fd75c0644fe9112c2e23b4ef5ed76 (diff)
downloadorg.eclipse.mylyn.tasks-6942ddd0abbfabcb46aeef28c4049a3421ba53d1.tar.gz
org.eclipse.mylyn.tasks-6942ddd0abbfabcb46aeef28c4049a3421ba53d1.tar.xz
org.eclipse.mylyn.tasks-6942ddd0abbfabcb46aeef28c4049a3421ba53d1.zip
Added null checks for the bugzilla contributer in the tasklist
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/DeleteAction.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/MarkTaskCompleteAction.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java6
5 files changed, 11 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
index 4e9d73527..aa8bb368b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
@@ -225,7 +225,7 @@ public class TaskListExternalizer {
if (externalizer.canReadTask(child)) {
// TODO add the tasks properly
ITask newTask = externalizer.readTask(child, tlist, null, null);
- if(MylarTasksPlugin.getDefault().getContributor().acceptsItem(newTask)){
+ if(MylarTasksPlugin.getDefault().getContributor() != null && MylarTasksPlugin.getDefault().getContributor().acceptsItem(newTask)){
newTask = MylarTasksPlugin.getDefault().getContributor().taskAdded(newTask);
}
tlist.addRootTask(newTask);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/DeleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/DeleteAction.java
index f32af1e81..9a1ec4d6d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/DeleteAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/DeleteAction.java
@@ -47,7 +47,8 @@ public class DeleteAction extends Action {
Object selectedObject = ((IStructuredSelection) this.view.getViewer()
.getSelection()).getFirstElement();
if(selectedObject instanceof ITaskListElement &&
- MylarTasksPlugin.getDefault().getContributor().acceptsItem((ITaskListElement)selectedObject)){
+ MylarTasksPlugin.getDefault().getContributor() != null &&
+ MylarTasksPlugin.getDefault().getContributor().acceptsItem((ITaskListElement)selectedObject)){
MylarTasksPlugin.getDefault().getContributor().itemDeleted((ITaskListElement)selectedObject);
}else if (selectedObject instanceof ITask) {
ITask task = (ITask) selectedObject;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/MarkTaskCompleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/MarkTaskCompleteAction.java
index 69af53c3b..4048cebbc 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/MarkTaskCompleteAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/MarkTaskCompleteAction.java
@@ -41,7 +41,8 @@ public class MarkTaskCompleteAction extends Action {
// MylarPlugin.getDefault().actionObserved(this);
Object selectedObject = ((IStructuredSelection)this.view.getViewer().getSelection()).getFirstElement();
if(selectedObject instanceof ITask &&
- MylarTasksPlugin.getDefault().getContributor().acceptsItem((ITaskListElement)selectedObject)){
+ MylarTasksPlugin.getDefault().getContributor() != null &&
+ MylarTasksPlugin.getDefault().getContributor().acceptsItem((ITaskListElement)selectedObject)){
MylarTasksPlugin.getDefault().getContributor().taskCompleted((ITask)selectedObject);
}else if (selectedObject instanceof Task){
((Task)selectedObject).setCompleted(true);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java
index 42b00c81f..d6dc88b9a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/OpenTaskEditorAction.java
@@ -42,7 +42,8 @@ public class OpenTaskEditorAction extends Action {
Object obj = ((IStructuredSelection)selection).getFirstElement();
if (obj instanceof ITaskListElement) {
ITaskListElement element = (ITaskListElement)obj;
- if(MylarTasksPlugin.getDefault().getContributor().acceptsItem(element)){
+ if(MylarTasksPlugin.getDefault().getContributor() != null &&
+ MylarTasksPlugin.getDefault().getContributor().acceptsItem(element)){
MylarTasksPlugin.getDefault().getContributor().itemOpened(element);
} else{
if(element instanceof Task){
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
index 803dba4d7..7c47a26ad 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
@@ -784,7 +784,8 @@ public class TaskListView extends ViewPart {
viewer.setSelection(null);
viewer.refresh();
return true;
- } else if(selectedObject instanceof ITaskListElement &&
+ } else if(selectedObject instanceof ITaskListElement &&
+ MylarTasksPlugin.getDefault().getContributor() != null &&
MylarTasksPlugin.getDefault().getContributor().acceptsItem((ITaskListElement)selectedObject) &&
getCurrentTarget() instanceof TaskCategory){
@@ -996,7 +997,8 @@ public class TaskListView extends ViewPart {
}
public void closeTaskEditors(ITask task, IWorkbenchPage page) throws LoginException, IOException{
- if(MylarTasksPlugin.getDefault().getContributor().acceptsItem(task)){
+ if(MylarTasksPlugin.getDefault().getContributor() != null &&
+ MylarTasksPlugin.getDefault().getContributor().acceptsItem(task)){
MylarTasksPlugin.getDefault().getContributor().taskClosed(task, page);
} else if (task instanceof Task) {
IEditorInput input = new TaskEditorInput((Task) task);

Back to the top