1 11 package org.eclipse.debug.internal.ui.commands.actions; 12 13 import org.eclipse.core.runtime.IStatus; 14 import org.eclipse.debug.internal.core.commands.DebugCommandRequest; 15 import org.eclipse.debug.internal.ui.DebugUIMessages; 16 import org.eclipse.debug.internal.ui.DebugUIPlugin; 17 import org.eclipse.jface.dialogs.MessageDialog; 18 19 25 public class ExecuteActionRequest extends DebugCommandRequest { 26 27 private ICommandParticipant fParticipant = null; 28 29 public ExecuteActionRequest(Object [] elements) { 30 super(elements); 31 } 32 33 public void done() { 34 if (fParticipant != null) { 35 fParticipant.requestDone(this); 36 fParticipant = null; 37 } 38 final IStatus status = getStatus(); 39 if (status != null) { 40 switch (status.getSeverity()) { 41 case IStatus.ERROR: 42 DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable () { 43 public void run() { 44 MessageDialog.openError(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()); 45 } 46 }); 47 break; 48 case IStatus.WARNING: 49 DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable () { 50 public void run() { 51 MessageDialog.openWarning(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()); 52 } 53 }); 54 break; 55 case IStatus.INFO: 56 DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable () { 57 public void run() { 58 MessageDialog.openInformation(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()); 59 } 60 }); 61 break; 62 } 63 } 64 } 65 66 public void setCommandParticipant(ICommandParticipant participant) { 67 fParticipant = participant; 68 } 69 70 } 71 | Popular Tags |