Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-08-17 18:58:33 -0400
committersminto2005-08-17 18:58:33 -0400
commitda0d334bedfaa2bc9dc9a728c728e578bff649d3 (patch)
treec019ae0cf704794741ac8cc498c3dd00768021e1
parent470d766e5073f0b4f0861e9be6599624c5020c2b (diff)
downloadorg.eclipse.mylyn.tasks-da0d334bedfaa2bc9dc9a728c728e578bff649d3.tar.gz
org.eclipse.mylyn.tasks-da0d334bedfaa2bc9dc9a728c728e578bff649d3.tar.xz
org.eclipse.mylyn.tasks-da0d334bedfaa2bc9dc9a728c728e578bff649d3.zip
fixed Bug #107175: offline report exception
Bug #107168: Show in browser link improvmemnts
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java25
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java6
5 files changed, 32 insertions, 14 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java
index 9700564be..35e744b98 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java
@@ -225,7 +225,7 @@ public class BugzillaUITools {
}
}
- public static void openUrl(String url) {
+ public static void openUrl(String title, String tooltip, String url) {
try {
IWebBrowser b = null;
int flags = 0;
@@ -241,8 +241,8 @@ public class BugzillaUITools {
| WorkbenchBrowserSupport.NAVIGATION_BAR;
}
b = WorkbenchBrowserSupport.getInstance().createBrowser(
- flags, "org.eclipse.mylar.tasklist", "Task",
- "tasktooltip");
+ flags, "org.eclipse.mylar.tasklist", title,
+ tooltip);
b.openURL(new URL(url));
} catch (PartInitException e) {
MessageDialog.openError( Display.getDefault().getActiveShell(),
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java
index ca99c9e1a..d6d790516 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java
@@ -89,6 +89,8 @@ public class OfflineView extends ViewPart {
private static TableViewer viewer;
+ private static OfflineReportsViewContentProvider contentProvider = new OfflineReportsViewContentProvider();
+
private String[] columnHeaders = {
"Bug",
"Summary",
@@ -142,7 +144,7 @@ public class OfflineView extends ViewPart {
gd.verticalSpan = 20;
viewer.getTable().setLayoutData(gd);
- viewer.setContentProvider(new OfflineReportsViewContentProvider());
+ viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(new OfflineReportsViewLabelProvider());
viewer.setInput(BugzillaPlugin.getDefault().getOfflineReports().elements());
@@ -428,9 +430,14 @@ public class OfflineView extends ViewPart {
/**
* Refreshes the view.
*/
- public static void add() {
- if (viewer != null)
+ public static void refreshView() {
+ if(viewer != null && !viewer.getControl().isDisposed()){
+ if(viewer.getContentProvider() == null)
+ viewer.setContentProvider(contentProvider);
+ if(viewer.getContentProvider() == null)
+ return;
viewer.setInput(viewer.getInput());
+ }
}
/**
@@ -480,7 +487,7 @@ public class OfflineView extends ViewPart {
file.sort(OfflineReportsFile.lastSel);
}
OfflineView.checkWindow();
- OfflineView.add();
+ OfflineView.refreshView();
}
public static List<IBugzillaBug> getOfflineBugs(){
@@ -498,8 +505,14 @@ public class OfflineView extends ViewPart {
ArrayList<IBugzillaBug> bugList = new ArrayList<IBugzillaBug>();
bugList.add(bug);
BugzillaPlugin.getDefault().getOfflineReports().remove(bugList);
- if(viewer != null)
+
+ if(viewer != null && !viewer.getControl().isDisposed()){
+ if(viewer.getContentProvider() == null)
+ viewer.setContentProvider(contentProvider);
+ if(viewer.getContentProvider() == null)
+ return;
viewer.setInput(viewer.getInput());
+ }
}
/**
@@ -601,7 +614,7 @@ public class OfflineView extends ViewPart {
viewer.refresh();
}
- private class OfflineReportsViewContentProvider implements IStructuredContentProvider {
+ private static class OfflineReportsViewContentProvider implements IStructuredContentProvider {
private List results;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
index 403150a5b..4870b87fa 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
@@ -1212,7 +1212,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
public void mouseUp(MouseEvent e) {}
public void mouseDown(MouseEvent e) {
- BugzillaUITools.openUrl(BugzillaRepository.getBugUrlWithoutLogin(bugzillaInput.getBug().getId()));
+ BugzillaUITools.openUrl(getTitle(), getTitleToolTip(), BugzillaRepository.getBugUrlWithoutLogin(bugzillaInput.getBug().getId()));
}
});
} else{
@@ -1279,7 +1279,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
changeDirtyStatus(false);
OfflineView.saveOffline(getBug());
OfflineView.checkWindow();
- OfflineView.add();
+ OfflineView.refreshView();
}
/**
@@ -1586,6 +1586,8 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
// get the position of the text in the composite
pos = 0;
Control s = selectionComposite;
+ if(s.isDisposed())
+ return;
s.setEnabled(true);
s.setFocus();
s.forceFocus();
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
index c154a88d6..27ffd2ef0 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
@@ -336,7 +336,8 @@ public class BugzillaTask extends Task {
return;
}
} else if (mode == MylarTasklistPlugin.ReportOpenMode.INTERNAL_BROWSER) {
- BugzillaUITools.openUrl(getBugUrl());
+ String title = "Bug #" + BugzillaTask.getBugId(getHandle());
+ BugzillaUITools.openUrl(title, title, getBugUrl());
}
}
});
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java
index 4748f5ccc..ad6da1180 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java
@@ -97,7 +97,8 @@ public class BugzillaTaskHandler implements ITaskHandler {
if (mode == MylarTasklistPlugin.ReportOpenMode.EDITOR) {
t.openTaskInEditor();
} else if (mode == MylarTasklistPlugin.ReportOpenMode.INTERNAL_BROWSER) {
- BugzillaUITools.openUrl(t.getBugUrl());
+ String title = "Bug #" + BugzillaTask.getBugId(t.getHandle());
+ BugzillaUITools.openUrl(title, title, t.getBugUrl());
} else {
// not supported
}
@@ -125,7 +126,8 @@ public class BugzillaTaskHandler implements ITaskHandler {
viewBugs.schedule();
}
} else if (mode == MylarTasklistPlugin.ReportOpenMode.INTERNAL_BROWSER) {
- BugzillaUITools.openUrl(hit.getBugUrl());
+ String title = "Bug #" + BugzillaTask.getBugId(hit.getHandle());
+ BugzillaUITools.openUrl(title, title, hit.getBugUrl());
} else {
// not supported
}

Back to the top