# HG changeset patch # User ryall # Date 1249929435 18000 # Node ID c400a1d2216ab1709b25022449e43b7e8bf0e675 # Parent ff389f2cc4aab335d6bf4a77fe53a14cb619183d Sync with changes in public CDT. diff -r ff389f2cc4aa -r c400a1d2216a cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java Mon Aug 10 13:11:33 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java Mon Aug 10 13:37:15 2009 -0500 @@ -139,7 +139,8 @@ /** * Used in conjunction with build before launch settings in the main tab. */ - private boolean buildForLaunchCalled; + private boolean workspaceBuildBeforeLaunch; + abstract public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException; @@ -600,7 +601,7 @@ @Override public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - buildForLaunchCalled = true; + workspaceBuildBeforeLaunch = true; // check the build before launch setting and honor it int buildBeforeLaunchValue = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, @@ -684,7 +685,7 @@ @Override public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - if (!buildForLaunchCalled) { + if (!workspaceBuildBeforeLaunch) { // buildForLaunch was not called which means that the workspace pref is disabled. see if the user enabled the // launch specific setting in the main tab. if so, we do call buildBeforeLaunch here. if (ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED == configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, @@ -807,7 +808,7 @@ monitor = new NullProgressMonitor(); } - buildForLaunchCalled = false; + workspaceBuildBeforeLaunch = false; int scale = 1000; int totalWork = 2 * scale; diff -r ff389f2cc4aa -r c400a1d2216a cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java Mon Aug 10 13:11:33 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java Mon Aug 10 13:37:15 2009 -0500 @@ -118,9 +118,13 @@ */ protected Combo fBuildConfigCombo; // Build option UI widgets + /** @since 6.1 */ protected Button fDisableBuildButton; + /** @since 6.1 */ protected Button fEnableBuildButton; + /** @since 6.1 */ protected Button fWorkspaceSettingsButton; + /** @since 6.1 */ protected Link fWorkpsaceSettingsLink; private final boolean fWantsTerminalOption; @@ -170,10 +174,9 @@ comp.setLayout(topLayout); createVerticalSpacer(comp, 1); + createExeFileGroup(comp, 1); createProjectGroup(comp, 1); - createBuildConfigCombo(comp, 1); createBuildOptionGroup(comp, 1); - createExeFileGroup(comp, 1); createVerticalSpacer(comp, 1); if (fSpecifyCoreFile) { createCoreFileGroup(comp, 1); @@ -329,6 +332,7 @@ }); } + /** @since 6.1 */ protected void createBuildOptionGroup(final Composite parent, int colSpan) { Group buildGroup = new Group(parent, SWT.NONE); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); @@ -340,7 +344,31 @@ gridLayout.makeColumnsEqualWidth= true; buildGroup.setLayoutData(gridData); buildGroup.setLayout(gridLayout); - buildGroup.setText("Build (if required) before launching"); //$NON-NLS-1$ + buildGroup.setText(LaunchMessages.getString("CMainTab.Build_options")); //$NON-NLS-1$ + + createBuildConfigCombo(buildGroup, 2); + + fWorkspaceSettingsButton = new Button(buildGroup, SWT.RADIO); + fWorkspaceSettingsButton.setText(LaunchMessages.getString("CMainTab.Workspace_settings_button_label")); //$NON-NLS-1$ + fWorkspaceSettingsButton.setToolTipText(LaunchMessages.getString("CMainTab.Workspace_settings_button_tooltip")); //$NON-NLS-1$ + fWorkspaceSettingsButton.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent evt) { + updateLaunchConfigurationDialog(); + } + }); + + fWorkpsaceSettingsLink = new Link(buildGroup, SWT.NONE); //$NON-NLS-1$ + fWorkpsaceSettingsLink.setText(LaunchMessages.getString("CMainTab.Workspace_settings_link_label")); //$NON-NLS-1$ + fWorkpsaceSettingsLink.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + PreferencesUtil.createPreferenceDialogOn( + parent.getShell(), + LaunchMessages.getString("CMainTab.Workspace_settings_page_id"), //$NON-NLS-1$ + null, + null).open(); + } + }); fDisableBuildButton = new Button(buildGroup, SWT.RADIO); fDisableBuildButton.setText(LaunchMessages.getString("CMainTab.Disable_build_button_label")); //$NON-NLS-1$ @@ -365,28 +393,6 @@ }); new Label(buildGroup, SWT.NONE); - - fWorkspaceSettingsButton = new Button(buildGroup, SWT.RADIO); - fWorkspaceSettingsButton.setText(LaunchMessages.getString("CMainTab.Workspace_settings_button_label")); //$NON-NLS-1$ - fWorkspaceSettingsButton.setToolTipText(LaunchMessages.getString("CMainTab.Workspace_settings_button_tooltip")); //$NON-NLS-1$ - fWorkspaceSettingsButton.addSelectionListener(new SelectionAdapter() { - - public void widgetSelected(SelectionEvent evt) { - updateLaunchConfigurationDialog(); - } - }); - - fWorkpsaceSettingsLink = new Link(buildGroup, SWT.NONE); //$NON-NLS-1$ - fWorkpsaceSettingsLink.setText(LaunchMessages.getString("CMainTab.Workspace_settings_link_label")); //$NON-NLS-1$ - fWorkpsaceSettingsLink.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - PreferencesUtil.createPreferenceDialogOn( - parent.getShell(), - LaunchMessages.getString("CMainTab.Workspace_settings_page_id"), //$NON-NLS-1$ - null, - null).open(); - } - }); } /** @since 6.0 */ protected void createCoreFileGroup(Composite parent, int colSpan) { @@ -514,10 +520,11 @@ } catch (CoreException ce) { LaunchUIPlugin.log(ce); } - fProgText.setText(coreName); + fCoreText.setText(coreName); } } + /** @since 6.1 */ protected void updateBuildOptionFromConfig(ILaunchConfiguration config) { int buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING; try {