1 8 package com.mountainminds.eclemma.internal.ui.launching; 9 10 import org.eclipse.core.runtime.CoreException; 11 import org.eclipse.core.runtime.IStatus; 12 import org.eclipse.debug.core.IStatusHandler; 13 import org.eclipse.debug.ui.DebugUITools; 14 import org.eclipse.jface.dialogs.IDialogConstants; 15 import org.eclipse.jface.dialogs.MessageDialog; 16 import org.eclipse.jface.viewers.StructuredSelection; 17 import org.eclipse.swt.widgets.Shell; 18 19 import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 20 import com.mountainminds.eclemma.internal.ui.UIMessages; 21 22 30 public class NoInstrumentedClassesHandler implements IStatusHandler { 31 32 public Object handleStatus(IStatus status, final Object source) 33 throws CoreException { 34 35 final Shell parent = EclEmmaUIPlugin.getInstance().getShell(); 36 String title = UIMessages.NoInstrumentedClassesError_title; 37 String message = UIMessages.NoInstrumentedClassesError_message; 38 39 MessageDialog d = new MessageDialog(parent, title, null, message, MessageDialog.ERROR, 40 new String [] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); 41 if (d.open() == 0) { 42 parent.getDisplay().asyncExec(new Runnable () { 43 public void run() { 44 DebugUITools.openLaunchConfigurationDialogOnGroup(parent, 45 new StructuredSelection(source), EclEmmaUIPlugin.ID_COVERAGE_LAUNCH_GROUP); 46 } 47 }); 48 } 49 return Boolean.FALSE; 50 } 51 52 } 53 | Popular Tags |