1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +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,31 +14,25 @@ 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()
{
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 );
}
} );

View file

@ -18,25 +18,19 @@ 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() {
CDebugUIPlugin.getStandardDisplay().asyncExec( new Runnable() {
public void run() {
MessageDialog.openInformation( CDebugUIPlugin.getActiveWorkbenchShell(), title, message );
}

View file

@ -18,26 +18,20 @@ 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() {
CDebugUIPlugin.getStandardDisplay().syncExec( new Runnable() {
public void run() {
result[0] = MessageDialog.openQuestion( CDebugUIPlugin.getActiveWorkbenchShell(), title, message );
}