Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-12-10 20:55:30 -0500
committerSteffen Pingel2011-12-10 20:55:30 -0500
commiteab9f4cb11e643ea6eaab443eb353c855f321900 (patch)
treea3aaccf6131f5c4f28fc3480098a260a65d6d8d0 /org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks
parentfd1bb2f5eadf1964c6be0023e5611cfca6d47c72 (diff)
downloadorg.eclipse.mylyn.tasks-eab9f4cb11e643ea6eaab443eb353c855f321900.tar.gz
org.eclipse.mylyn.tasks-eab9f4cb11e643ea6eaab443eb353c855f321900.tar.xz
org.eclipse.mylyn.tasks-eab9f4cb11e643ea6eaab443eb353c855f321900.zip
NEW - bug 364632: remove invocations to StatusHandler.fail()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=364632
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java33
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/BrowserFormPage.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/NewTaskWizard.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/RepositoryQueryWizard.java9
5 files changed, 30 insertions, 30 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
index 70e8c785a..3876fa2e8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
@@ -51,6 +51,7 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.statushandlers.StatusManager;
/**
* @noextend This class is not intended to be subclassed by clients.
@@ -175,8 +176,9 @@ public class TasksUiUtil {
try {
return page.openEditor(input, editorId);
} catch (PartInitException e) {
- StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Open for editor failed: " + input //$NON-NLS-1$
- + ", taskId: " + editorId, e)); //$NON-NLS-1$
+ StatusManager.getManager().handle(
+ new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Open for editor failed: " + input //$NON-NLS-1$
+ + ", taskId: " + editorId, e), StatusManager.SHOW | StatusManager.LOG); //$NON-NLS-1$
}
return null;
}
@@ -190,24 +192,21 @@ public class TasksUiUtil {
return Window.CANCEL;
}
- try {
- EditRepositoryWizard wizard = new EditRepositoryWizard(repository);
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- if (shell != null && !shell.isDisposed()) {
- WizardDialog dialog = new TaskRepositoryWizardDialog(shell, wizard);
- dialog.create();
- dialog.setBlockOnOpen(true);
- if (dialog.open() == Window.CANCEL) {
- return Window.CANCEL;
- }
+ EditRepositoryWizard wizard = new EditRepositoryWizard(repository);
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ if (shell != null && !shell.isDisposed()) {
+ WizardDialog dialog = new TaskRepositoryWizardDialog(shell, wizard);
+ dialog.create();
+ dialog.setBlockOnOpen(true);
+ if (dialog.open() == Window.CANCEL) {
+ return Window.CANCEL;
}
+ }
- if (TaskRepositoriesView.getFromActivePerspective() != null) {
- TaskRepositoriesView.getFromActivePerspective().getViewer().refresh();
- }
- } catch (Exception e) {
- StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, e.getMessage(), e));
+ if (TaskRepositoriesView.getFromActivePerspective() != null) {
+ TaskRepositoriesView.getFromActivePerspective().getViewer().refresh();
}
+
return Window.OK;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/BrowserFormPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/BrowserFormPage.java
index b97f45e99..ba3c2982c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/BrowserFormPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/BrowserFormPage.java
@@ -74,11 +74,9 @@ public class BrowserFormPage extends TaskFormPage {
browserViewer.setURL(url);
}
} catch (SWTError e) {
- // TODO review error handling
- StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not create browser page: " //$NON-NLS-1$
+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not create browser page: " //$NON-NLS-1$
+ e.getMessage(), e));
} catch (RuntimeException e) {
- // TODO review error handling
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not create browser page", e)); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
index b7aa1d4d9..85dfd39d3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
@@ -74,6 +74,7 @@ import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.statushandlers.StatusManager;
/**
* Extend to provide custom repository settings. This page is typically invoked by the user requesting properties via
@@ -1909,8 +1910,10 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit
}
});
} catch (InvocationTargetException e) {
- StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
- Messages.AbstractRepositorySettingsPage_Internal_error_validating_repository, e.getCause()));
+ StatusManager.getManager().handle(
+ new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ Messages.AbstractRepositorySettingsPage_Internal_error_validating_repository, e),
+ StatusManager.SHOW | StatusManager.LOG);
return;
} catch (InterruptedException e) {
// canceled
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 42529c081..b2e42df5c 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
@@ -33,6 +33,7 @@ import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.statushandlers.StatusManager;
/**
* Extend for customizing how new tasks editors are created.
@@ -118,8 +119,10 @@ public class NewTaskWizard extends Wizard implements INewWizard {
TasksUiInternal.displayStatus(Messages.NewTaskWizard_Error_creating_new_task,
((CoreException) e.getCause()).getStatus());
} else {
- StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
- Messages.NewTaskWizard_Error_creating_new_task, e.getCause()));
+ StatusManager.getManager().handle(
+ new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ Messages.NewTaskWizard_Error_creating_new_task, e),
+ StatusManager.SHOW | StatusManager.LOG);
}
return false;
} catch (InterruptedException e) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/RepositoryQueryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/RepositoryQueryWizard.java
index d85a5cbb3..e4e42057c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/RepositoryQueryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/RepositoryQueryWizard.java
@@ -12,11 +12,8 @@
package org.eclipse.mylyn.tasks.ui.wizards;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
@@ -26,6 +23,7 @@ import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
+import org.eclipse.osgi.util.NLS;
/**
* Extend to provide a custom edit query dialog, typically invoked by the user requesting properties on a query node in
@@ -63,9 +61,8 @@ public class RepositoryQueryWizard extends Wizard {
public boolean performFinish() {
IWizardPage currentPage = getContainer().getCurrentPage();
if (!(currentPage instanceof AbstractRepositoryQueryPage)) {
- StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
- "Current wizard page does not extends AbstractRepositoryQueryPage")); //$NON-NLS-1$
- return false;
+ throw new AssertionError(NLS.bind(
+ "Current wizard page ''{0}'' does not extends AbstractRepositoryQueryPage", currentPage.getClass())); //$NON-NLS-1$
}
AbstractRepositoryQueryPage page = (AbstractRepositoryQueryPage) currentPage;

Back to the top