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 2004-07-16 Mikhail Khodjaiants
Cleanup. Cleanup.
* CDTDebugModelPresentation.java * 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.CoreException;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.IStatusHandler; import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.ErrorDialog;
/** /**
* * Displays the error dialog.
* Enter type comment.
*
* @since Sep 25, 2002
*/ */
public class ErrorStatusHandler implements IStatusHandler public class ErrorStatusHandler implements IStatusHandler {
{
/* (non-Javadoc) /* (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 public Object handleStatus( final IStatus status, Object source ) throws CoreException {
{ if ( status != null && source != null && source instanceof IDebugElement ) {
if ( status != null && source != null && source instanceof IDebugTarget ) IDebugTarget target = ((IDebugElement)source).getDebugTarget();
{ final String title = target.getName();
final String title = ((IDebugTarget)source).getName(); CDebugUIPlugin.getStandardDisplay().asyncExec( new Runnable() {
CDebugUIPlugin.getStandardDisplay().asyncExec(
new Runnable() public void run() {
{ ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title, null, status );
public void run() }
{ } );
ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title, null, status );
}
} );
} }
return null; return null;
} }
} }

View file

@ -18,30 +18,24 @@ import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
/** /**
* * Displays the information dialog.
* Enter type comment.
*
* @since Sep 25, 2002
*/ */
public class InfoStatusHandler implements IStatusHandler { public class InfoStatusHandler implements IStatusHandler {
/* /* (non-Javadoc)
* (non-Javadoc) * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object)
*/ */
public Object handleStatus( IStatus status, Object source ) public Object handleStatus( IStatus status, Object source ) throws CoreException {
throws CoreException {
if ( status != null && source != null && source instanceof IDebugTarget ) { if ( status != null && source != null && source instanceof IDebugTarget ) {
final String title = ((IDebugTarget)source).getName(); final String title = ((IDebugTarget)source).getName();
final String message = status.getMessage(); final String message = status.getMessage();
CDebugUIPlugin.getStandardDisplay().asyncExec( CDebugUIPlugin.getStandardDisplay().asyncExec( new Runnable() {
new Runnable() {
public void run() { public void run() {
MessageDialog.openInformation( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); MessageDialog.openInformation( CDebugUIPlugin.getActiveWorkbenchShell(), title, message );
} }
} ); } );
} }
return null; return null;
} }
} }

View file

@ -18,31 +18,25 @@ import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
/** /**
* * Displays the confirmation dialog.
* Enter type comment.
*
* @since Sep 25, 2002
*/ */
public class QuestionStatusHandler implements IStatusHandler { public class QuestionStatusHandler implements IStatusHandler {
/* /* (non-Javadoc)
* (non-Javadoc) * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object)
*/ */
public Object handleStatus( IStatus status, Object source ) throws CoreException { public Object handleStatus( IStatus status, Object source ) throws CoreException {
final boolean result[] = new boolean[1]; final boolean result[] = new boolean[1];
if ( status != null && source != null && source instanceof IDebugTarget ) { if ( status != null && source != null && source instanceof IDebugTarget ) {
final String title = ((IDebugTarget)source).getName(); final String title = ((IDebugTarget)source).getName();
final String message = status.getMessage(); final String message = status.getMessage();
CDebugUIPlugin.getStandardDisplay().syncExec( CDebugUIPlugin.getStandardDisplay().syncExec( new Runnable() {
new Runnable() {
public void run() { public void run() {
result[0] = MessageDialog.openQuestion( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); result[0] = MessageDialog.openQuestion( CDebugUIPlugin.getActiveWorkbenchShell(), title, message );
} }
} ); } );
} }
return new Boolean( result[0] ); return new Boolean( result[0] );
} }
} }