4242import org .eclipse .debug .core .ILaunchConfiguration ;
4343import org .eclipse .debug .core .ILaunchConfigurationWorkingCopy ;
4444import org .eclipse .jdt .core .IJavaProject ;
45+ import org .eclipse .jface .dialogs .IDialogConstants ;
4546import org .eclipse .jface .dialogs .MessageDialog ;
4647import org .eclipse .jface .util .Util ;
4748import org .eclipse .jface .viewers .CheckStateChangedEvent ;
6768import org .eclipse .pde .internal .ui .PDEPluginImages ;
6869import org .eclipse .pde .internal .ui .PDEUIMessages ;
6970import org .eclipse .pde .internal .ui .SWTFactory ;
71+ import org .eclipse .pde .internal .ui .dialogs .PluginSelectionDialog ;
7072import org .eclipse .pde .internal .ui .elements .NamedElement ;
7173import org .eclipse .pde .internal .ui .shared .CachedCheckboxTreeViewer ;
7274import org .eclipse .pde .internal .ui .shared .FilteredCheckboxTree ;
@@ -435,14 +437,21 @@ public void createControl(Composite parent, int span, int indent) {
435437 label .setLayoutData (gd );
436438
437439 if (fTab instanceof PluginsTab ) {
438- fAutoValidate = createButton (parent , span - 1 , indent , PDEUIMessages .PluginsTabToolBar_auto_validate_plugins );
440+ fAutoValidate = createButton (parent , span - 2 , indent ,
441+ PDEUIMessages .PluginsTabToolBar_auto_validate_plugins );
439442 } else if (fTab instanceof BundlesTab ) {
440- fAutoValidate = createButton (parent , span - 1 , indent , PDEUIMessages .PluginsTabToolBar_auto_validate_bundles );
443+ fAutoValidate = createButton (parent , span - 2 , indent ,
444+ PDEUIMessages .PluginsTabToolBar_auto_validate_bundles );
441445 } else {
442- fAutoValidate = createButton (parent , span - 1 , indent ,
446+ fAutoValidate = createButton (parent , span - 2 , indent ,
443447 NLS .bind (PDEUIMessages .PluginsTabToolBar_auto_validate ,
444448 fTab .getName ().replace ("&" , "" ).toLowerCase (Locale .ENGLISH ))); //$NON-NLS-1$ //$NON-NLS-2$
445449 }
450+ Button fShowPlugin = new Button (parent , SWT .PUSH );
451+ fShowPlugin .setLayoutData (new GridData (GridData .HORIZONTAL_ALIGN_END ));
452+ fShowPlugin .setText (PDEUIMessages .PluginsTabToolBar_show_launch_bundles );
453+ fShowPlugin .addSelectionListener (
454+ SelectionListener .widgetSelectedAdapter (e -> handleShowPluginsPressed (fLaunchConfig )));
446455
447456 fValidateButton = new Button (parent , SWT .PUSH );
448457 fValidateButton .setLayoutData (new GridData (GridData .HORIZONTAL_ALIGN_END ));
@@ -460,6 +469,32 @@ public void createControl(Composite parent, int span, int indent) {
460469 fValidateButton .addSelectionListener (fListener );
461470 }
462471
472+ // Dialog to Show the launch bundles
473+ static void handleShowPluginsPressed (ILaunchConfiguration launchConfig ) {
474+ Set <IPluginModelBase > models ;
475+ try {
476+ models = BundleLauncherHelper .getMergedBundleMap (launchConfig , false ).keySet ();
477+ PluginSelectionDialog dialog = new PluginSelectionDialog (PDEPlugin .getActiveWorkbenchShell (),
478+ models .toArray (IPluginModelBase []::new ), true ) {
479+ @ Override
480+ protected void createButtonsForButtonBar (Composite parent ) {
481+ createButton (parent , IDialogConstants .CANCEL_ID , IDialogConstants .CLOSE_LABEL , false );
482+ }
483+
484+ @ Override
485+ protected void handleDoubleClick () {
486+ // disable super-class behavior
487+ }
488+ };
489+ // Overriding the super-class title
490+ dialog .setTitle (PDEUIMessages .LaunchPluginDialog_title );
491+ dialog .create ();
492+ dialog .open ();
493+ } catch (CoreException e ) {
494+ PDEPlugin .log (e );
495+ }
496+ }
497+
463498 private Button createButton (Composite parent , int span , int indent , String text ) {
464499 Button button = new Button (parent , SWT .CHECK );
465500 button .setText (text );
0 commit comments