From 188b679f0a02e535d1a001e9456ac00a3c4a23b9 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Mon, 9 Dec 2002 00:50:15 +0000 Subject: [PATCH] Implementation of the status handler for core errors. --- debug/org.eclipse.cdt.debug.ui/ChangeLog | 4 ++++ .../debug/internal/ui/ErrorStatusHandler.java | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index 143e706cbfe..2e58206aab0 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,7 @@ +2002-12-08 Mikhail Khodjaiants + Implementation of the status handler for core errors. + * ErrorStatusHandler.java + 2002-12-04 Mikhail Khodjaiants Small fix for the Registers view. * RegistersView.java diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java index 4e20be4818a..417a4f57999 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java @@ -5,9 +5,12 @@ */ package org.eclipse.cdt.debug.internal.ui; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.debug.core.IStatusHandler; +import org.eclipse.debug.core.model.IDebugTarget; +import org.eclipse.jface.dialogs.ErrorDialog; /** * @@ -21,8 +24,20 @@ public class ErrorStatusHandler implements IStatusHandler /* (non-Javadoc) * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object) */ - public Object handleStatus( IStatus status, Object source ) throws CoreException + public Object handleStatus( final IStatus status, Object source ) throws CoreException { + if ( status != null && source != null && source instanceof IDebugTarget ) + { + final String title = ((IDebugTarget)source).getName(); + CDebugUIPlugin.getStandardDisplay().asyncExec( + new Runnable() + { + public void run() + { + ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title, null, status ); + } + } ); + } return null; } }