2323import org .eclipse .core .resources .IResource ;
2424import org .eclipse .core .runtime .CoreException ;
2525import org .eclipse .debug .core .DebugPlugin ;
26+ import org .eclipse .debug .core .ILaunch ;
2627import org .eclipse .debug .core .ILaunchConfiguration ;
2728import org .eclipse .debug .core .ILaunchConfigurationType ;
2829import org .eclipse .debug .core .ILaunchConfigurationWorkingCopy ;
@@ -347,8 +348,12 @@ protected void fillMenu(Menu menu) {
347348
348349 // Add favorites
349350 int accelerator = 1 ;
351+ ILaunch [] launches = DebugPlugin .getDefault ().getLaunchManager ().getLaunches ();
350352 for (ILaunchConfiguration launch : favoriteList ) {
351353 LaunchAction action = new LaunchAction (launch , getMode ());
354+ if (checkIfLaunchActive (launch , launches )) {
355+ action .setText (action .getText () + " \u2699 " ); //$NON-NLS-1$
356+ }
352357 addToMenu (menu , action , accelerator );
353358 accelerator ++;
354359 }
@@ -361,6 +366,9 @@ protected void fillMenu(Menu menu) {
361366 // Add history launches next
362367 for (ILaunchConfiguration launch : historyList ) {
363368 LaunchAction action = new LaunchAction (launch , getMode ());
369+ if (checkIfLaunchActive (launch , launches )) {
370+ action .setText (action .getText () + " \u2699 " ); //$NON-NLS-1$
371+ }
364372 addToMenu (menu , action , accelerator );
365373 accelerator ++;
366374 }
@@ -373,6 +381,24 @@ protected void fillMenu(Menu menu) {
373381 }
374382 }
375383
384+ /**
385+ * Returns whether the given launch configuration has been launched and active
386+ * now.
387+ *
388+ * @param launchConfiguration the launch configuration
389+ * @param launches the current active launches
390+ * @return {@code true} if a matching launch exists, {@code false} otherwise
391+ */
392+ private boolean checkIfLaunchActive (ILaunchConfiguration launchConfiguration , ILaunch [] launches ) {
393+ for (ILaunch launch : launches ) {
394+ ILaunchConfiguration activeLaunch = launch .getLaunchConfiguration ();
395+ if (activeLaunch != null && activeLaunch .equals (launchConfiguration ) && !launch .isTerminated ()) {
396+ return true ;
397+ }
398+ }
399+ return false ;
400+ }
401+
376402 /**
377403 * Adds a separator to the given menu
378404 *
0 commit comments