|
55 | 55 | import org.eclipse.swt.layout.GridData; |
56 | 56 | import org.eclipse.swt.layout.GridLayout; |
57 | 57 | import org.eclipse.swt.widgets.Button; |
| 58 | +import org.eclipse.swt.widgets.Combo; |
58 | 59 | import org.eclipse.swt.widgets.Composite; |
59 | 60 | import org.eclipse.swt.widgets.Control; |
60 | 61 | import org.eclipse.swt.widgets.Group; |
@@ -125,6 +126,20 @@ private final class DefaultJUnitWorkspaceBlock extends BaseBlock { |
125 | 126 | public void createControl(Composite parent) { |
126 | 127 | Group group = SWTFactory.createGroup(parent, PDEUIMessages.MainPreferencePage_junitWorkspaceGroup, 2, 1, |
127 | 128 | GridData.FILL_HORIZONTAL); |
| 129 | + SWTFactory.createLabel(group, PDEUIMessages.PluginsTab_launchWith, 1); |
| 130 | + fJunitLaunchWithCombo = SWTFactory.createCombo(group, SWT.READ_ONLY | SWT.BORDER, 1, |
| 131 | + GridData.HORIZONTAL_ALIGN_BEGINNING, |
| 132 | + new String[] { PDEUIMessages.MainPreferencePage_optionTestPlugin, PDEUIMessages.PluginsTab_allPlugins }); |
| 133 | + SWTFactory.createLabel(group, "", 1); //$NON-NLS-1$ |
| 134 | + Composite options = SWTFactory.createComposite(group, 1, 1, GridData.FILL_HORIZONTAL, 0, 0); |
| 135 | + fJunitAutoIncludeRequirementsButton = SWTFactory.createCheckButton(options, |
| 136 | + PDEUIMessages.AdvancedLauncherTab_autoIncludeRequirements_plugins, null, true, 1); |
| 137 | + fJunitIncludeOptionalButton = SWTFactory.createCheckButton(options, |
| 138 | + PDEUIMessages.AdvancedLauncherTab_includeOptional_plugins, null, true, 1); |
| 139 | + fJunitAddWorkspaceButton = SWTFactory.createCheckButton(options, |
| 140 | + PDEUIMessages.AdvancedLauncherTab_addNew_plugins, null, false, 1); |
| 141 | + fJunitAutoValidate = SWTFactory.createCheckButton(options, |
| 142 | + PDEUIMessages.PluginsTabToolBar_auto_validate_plugins, null, true, 1); |
128 | 143 | Composite radios = SWTFactory.createComposite(group, 2, 2, GridData.FILL_HORIZONTAL, 0, 0); |
129 | 144 |
|
130 | 145 | fJUnitWorkspaceLocationRadio = new Button(radios, SWT.RADIO); |
@@ -184,6 +199,12 @@ protected boolean isFile() { |
184 | 199 |
|
185 | 200 | private Text fTestPluginPatternText; |
186 | 201 |
|
| 202 | + private Combo fJunitLaunchWithCombo; |
| 203 | + private Button fJunitAutoIncludeRequirementsButton; |
| 204 | + private Button fJunitIncludeOptionalButton; |
| 205 | + private Button fJunitAddWorkspaceButton; |
| 206 | + private Button fJunitAutoValidate; |
| 207 | + |
187 | 208 | public MainPreferencePage() { |
188 | 209 | setPreferenceStore(PDEPlugin.getDefault().getPreferenceStore()); |
189 | 210 | setDescription(PDEUIMessages.Preferences_MainPage_Description); |
@@ -328,7 +349,16 @@ protected Control createContents(Composite parent) { |
328 | 349 | .getBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_WORKSPACE_LOCATION_IS_CONTAINER); |
329 | 350 | fJUnitWorkspaceLocationRadio.setSelection(!jUnitLocationIsContainer); |
330 | 351 | fJUnitWorkspacesContainerRadio.setSelection(jUnitLocationIsContainer); |
331 | | - |
| 352 | + fJunitLaunchWithCombo.select(ILaunchingPreferenceConstants.VALUE_JUNIT_LAUNCH_WITH_TESTPLUGIN |
| 353 | + .equals(launchingStore.getString(ILaunchingPreferenceConstants.PROP_JUNIT_LAUNCH_WITH)) ? 0 : 1); |
| 354 | + fJunitAutoIncludeRequirementsButton |
| 355 | + .setSelection(launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_AUTO_INCLUDE)); |
| 356 | + fJunitIncludeOptionalButton |
| 357 | + .setSelection(launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_INCLUDE_OPTIONAL)); |
| 358 | + fJunitAddWorkspaceButton.setSelection( |
| 359 | + launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_ADD_NEW_WORKSPACE_PLUGINS)); |
| 360 | + fJunitAutoValidate |
| 361 | + .setSelection(launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_VALIDATE_LAUNCH)); |
332 | 362 | Group bundlePoolGp = SWTFactory.createGroup(composite, PDEUIMessages.MainPreferencePage_BundlePoolPrefsGroup, 2, |
333 | 363 | 1, GridData.FILL_HORIZONTAL); |
334 | 364 | WidgetFactory.label(SWT.WRAP) |
@@ -487,6 +517,18 @@ public boolean performOk() { |
487 | 517 | fJUnitWorkspaceLocation.getText()); |
488 | 518 | launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_JUNIT_WORKSPACE_LOCATION_IS_CONTAINER, |
489 | 519 | fJUnitWorkspacesContainerRadio.getSelection()); |
| 520 | + launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_JUNIT_LAUNCH_WITH, |
| 521 | + fJunitLaunchWithCombo.getSelectionIndex() == 0 |
| 522 | + ? ILaunchingPreferenceConstants.VALUE_JUNIT_LAUNCH_WITH_TESTPLUGIN |
| 523 | + : ILaunchingPreferenceConstants.VALUE_JUNIT_LAUNCH_WITH_ALL); |
| 524 | + launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_JUNIT_ADD_NEW_WORKSPACE_PLUGINS, |
| 525 | + fJunitAddWorkspaceButton.getSelection()); |
| 526 | + launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_JUNIT_AUTO_INCLUDE, |
| 527 | + fJunitAutoIncludeRequirementsButton.getSelection()); |
| 528 | + launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_JUNIT_INCLUDE_OPTIONAL, |
| 529 | + fJunitIncludeOptionalButton.getSelection()); |
| 530 | + launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_JUNIT_VALIDATE_LAUNCH, |
| 531 | + fJunitAutoValidate.getSelection()); |
490 | 532 | try { |
491 | 533 | launchingStore.flush(); |
492 | 534 | } catch (BackingStoreException e) { |
@@ -537,6 +579,16 @@ protected void performDefaults() { |
537 | 579 | fJUnitWorkspacesContainerRadio.setSelection(jUnitLocationIsContainer); |
538 | 580 | fJUnitWorkspaceLocation |
539 | 581 | .setText(launchingStore.getDefaultString(ILaunchingPreferenceConstants.PROP_JUNIT_WORKSPACE_LOCATION)); |
| 582 | + fJunitLaunchWithCombo.select(ILaunchingPreferenceConstants.VALUE_JUNIT_LAUNCH_WITH_TESTPLUGIN |
| 583 | + .equals(launchingStore.getDefaultString(ILaunchingPreferenceConstants.PROP_JUNIT_LAUNCH_WITH)) ? 0 : 1); |
| 584 | + fJunitAutoIncludeRequirementsButton |
| 585 | + .setSelection(launchingStore.getDefaultBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_AUTO_INCLUDE)); |
| 586 | + fJunitIncludeOptionalButton.setSelection( |
| 587 | + launchingStore.getDefaultBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_INCLUDE_OPTIONAL)); |
| 588 | + fJunitAddWorkspaceButton.setSelection( |
| 589 | + launchingStore.getDefaultBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_ADD_NEW_WORKSPACE_PLUGINS)); |
| 590 | + fJunitAutoValidate.setSelection( |
| 591 | + launchingStore.getDefaultBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_VALIDATE_LAUNCH)); |
540 | 592 | } |
541 | 593 |
|
542 | 594 | @Override |
|
0 commit comments