42
42
import org .eclipse .debug .core .ILaunchConfiguration ;
43
43
import org .eclipse .debug .core .ILaunchConfigurationWorkingCopy ;
44
44
import org .eclipse .jdt .core .IJavaProject ;
45
+ import org .eclipse .jface .dialogs .IDialogConstants ;
45
46
import org .eclipse .jface .dialogs .MessageDialog ;
46
47
import org .eclipse .jface .util .Util ;
47
48
import org .eclipse .jface .viewers .CheckStateChangedEvent ;
67
68
import org .eclipse .pde .internal .ui .PDEPluginImages ;
68
69
import org .eclipse .pde .internal .ui .PDEUIMessages ;
69
70
import org .eclipse .pde .internal .ui .SWTFactory ;
71
+ import org .eclipse .pde .internal .ui .dialogs .PluginSelectionDialog ;
70
72
import org .eclipse .pde .internal .ui .elements .NamedElement ;
71
73
import org .eclipse .pde .internal .ui .shared .CachedCheckboxTreeViewer ;
72
74
import org .eclipse .pde .internal .ui .shared .FilteredCheckboxTree ;
@@ -435,14 +437,21 @@ public void createControl(Composite parent, int span, int indent) {
435
437
label .setLayoutData (gd );
436
438
437
439
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 );
439
442
} 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 );
441
445
} else {
442
- fAutoValidate = createButton (parent , span - 1 , indent ,
446
+ fAutoValidate = createButton (parent , span - 2 , indent ,
443
447
NLS .bind (PDEUIMessages .PluginsTabToolBar_auto_validate ,
444
448
fTab .getName ().replace ("&" , "" ).toLowerCase (Locale .ENGLISH ))); //$NON-NLS-1$ //$NON-NLS-2$
445
449
}
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 )));
446
455
447
456
fValidateButton = new Button (parent , SWT .PUSH );
448
457
fValidateButton .setLayoutData (new GridData (GridData .HORIZONTAL_ALIGN_END ));
@@ -460,6 +469,32 @@ public void createControl(Composite parent, int span, int indent) {
460
469
fValidateButton .addSelectionListener (fListener );
461
470
}
462
471
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
+
463
498
private Button createButton (Composite parent , int span , int indent , String text ) {
464
499
Button button = new Button (parent , SWT .CHECK );
465
500
button .setText (text );
0 commit comments