From 5662034d089fa640ad23b7a1ee39d57dad80a9b7 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Tue, 20 Jul 2004 21:34:50 +0000 Subject: [PATCH] Cleanup. --- debug/org.eclipse.cdt.debug.ui/ChangeLog | 6 ++++ .../debug/internal/ui/ErrorStatusHandler.java | 36 ++++++++----------- .../debug/internal/ui/InfoStatusHandler.java | 28 ++++++--------- .../internal/ui/QuestionStatusHandler.java | 26 ++++++-------- 4 files changed, 42 insertions(+), 54 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index e0142ce135d..ee4506e389d 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,9 @@ +2004-07-20 Mikhail Khodjaiants + Cleanup. + * ErrorStatusHandler.java + * InfoStatusHandler.java + * QuestionStatusHandler.java + 2004-07-16 Mikhail Khodjaiants Cleanup. * CDTDebugModelPresentation.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 8da3763a2a9..a123cda044e 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 @@ -14,35 +14,29 @@ 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.IDebugElement; import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.jface.dialogs.ErrorDialog; /** - * - * Enter type comment. - * - * @since Sep 25, 2002 + * Displays the error dialog. */ -public class ErrorStatusHandler implements IStatusHandler -{ +public class ErrorStatusHandler implements IStatusHandler { /* (non-Javadoc) - * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object) + * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object) */ - 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 ); - } - } ); + public Object handleStatus( final IStatus status, Object source ) throws CoreException { + if ( status != null && source != null && source instanceof IDebugElement ) { + IDebugTarget target = ((IDebugElement)source).getDebugTarget(); + final String title = target.getName(); + CDebugUIPlugin.getStandardDisplay().asyncExec( new Runnable() { + + public void run() { + ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title, null, status ); + } + } ); } return null; } -} +} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java index cbb818d53a3..d8714d9803d 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java @@ -18,30 +18,24 @@ import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.jface.dialogs.MessageDialog; /** - * - * Enter type comment. - * - * @since Sep 25, 2002 + * Displays the information dialog. */ public class InfoStatusHandler implements IStatusHandler { - /* - * (non-Javadoc) - * - * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object) + /* (non-Javadoc) + * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object) */ - public Object handleStatus( IStatus status, Object source ) - throws CoreException { + public Object handleStatus( IStatus status, Object source ) throws CoreException { if ( status != null && source != null && source instanceof IDebugTarget ) { final String title = ((IDebugTarget)source).getName(); final String message = status.getMessage(); - CDebugUIPlugin.getStandardDisplay().asyncExec( - new Runnable() { - public void run() { - MessageDialog.openInformation( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); - } - } ); + CDebugUIPlugin.getStandardDisplay().asyncExec( new Runnable() { + + public void run() { + MessageDialog.openInformation( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); + } + } ); } return null; } -} +} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java index 7d79d31dc50..8658d899525 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java @@ -18,31 +18,25 @@ import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.jface.dialogs.MessageDialog; /** - * - * Enter type comment. - * - * @since Sep 25, 2002 + * Displays the confirmation dialog. */ public class QuestionStatusHandler implements IStatusHandler { - /* - * (non-Javadoc) - * - * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object) + /* (non-Javadoc) + * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object) */ public Object handleStatus( IStatus status, Object source ) throws CoreException { - final boolean result[] = new boolean[1]; if ( status != null && source != null && source instanceof IDebugTarget ) { final String title = ((IDebugTarget)source).getName(); final String message = status.getMessage(); - CDebugUIPlugin.getStandardDisplay().syncExec( - new Runnable() { - public void run() { - result[0] = MessageDialog.openQuestion( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); - } - } ); + CDebugUIPlugin.getStandardDisplay().syncExec( new Runnable() { + + public void run() { + result[0] = MessageDialog.openQuestion( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); + } + } ); } return new Boolean( result[0] ); } -} +} \ No newline at end of file