1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00
This commit is contained in:
Mikhail Khodjaiants 2004-07-20 21:34:50 +00:00
parent 9c3c70be24
commit 5662034d08
4 changed files with 42 additions and 54 deletions

View file

@ -1,3 +1,9 @@
2004-07-20 Mikhail Khodjaiants
Cleanup.
* ErrorStatusHandler.java
* InfoStatusHandler.java
* QuestionStatusHandler.java
2004-07-16 Mikhail Khodjaiants
Cleanup.
* CDTDebugModelPresentation.java

View file

@ -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;
}
}
}

View file

@ -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;
}
}
}

View file

@ -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] );
}
}
}