1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 08:46:02 +02:00

Bug 481523 - Open project properties from launch config page

- also removed deprecated fields from CAbstractMainTab

Change-Id: I217f2ade868756edb331de60894846e7f5ec5cc2
This commit is contained in:
Alena Laskavaia 2015-11-05 10:55:42 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 75aa6665a0
commit 63aa4b3376
5 changed files with 48 additions and 38 deletions

View file

@ -841,6 +841,9 @@ implements
}
protected void handleResize(boolean visible) {
if (!getShell().isVisible()) {
return; // do not resize shell before its open, it will screw up shell positioning
}
if (visible && !isNewOpening) return; // do not duplicate
if (visible)
isNewOpening = false;

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.launch; singleton:=true
Bundle-Version: 7.3.0.qualifier
Bundle-Version: 9.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
<version>7.3.0-SNAPSHOT</version>
<version>9.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.launch</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -88,7 +88,7 @@ CMainTab_Choose_program_to_run=Choose a &program to run:
CMainTab_Choose_program_to_run_from_NAME=Choose a program to run from {0}:
CMainTab_UseTerminal=Connect process input && output to a terminal.
CMainTab_Program_invalid_proj_path=Program specification is not a valid project-relative path.
CMainTab_Build_Config=Build configuration:
CMainTab_Build_Config=Build Configuration:
CMainTab_Use_Active=Use Active
CMainTab_Use_Automatic=Select Automatically
CMainTab_Build_Config_Active_tooltip=Use active build configuration

View file

@ -38,6 +38,8 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
@ -56,9 +58,11 @@ import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.internal.dialogs.PropertyDialog;
/**
* @since 6.1
@ -75,19 +79,6 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
* @since 6.0
*/
protected Combo fBuildConfigCombo;
/**
* @since 7.0
* @deprecated This control won't be used anymore, combo will have addition item: Select Automatically
* */
protected Button fBuildConfigAuto;
/**
* Indicates whether the user has clicked on the build config auto button Prevents causing a delta to the underlying launch
* configuration if the user hasn't touched this setting.
*
* @since 7.0
* @deprecated
*/
protected boolean fBuildConfigAutoChanged;
/** @since 6.1 */
protected Button fDisableBuildButton;
/** @since 6.1 */
@ -280,7 +271,6 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
if (projDes != null) {
// Populate and select config
ICConfigurationDescription[] configurations = projDes.getConfigurations();
for (int i = 0; i < configurations.length; i++) {
String configName = configurations[i].getName();
String id = configurations[i].getId();
@ -306,8 +296,14 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = colspan;
comboComp.setLayoutData(gd);
Label dlabel = new Label(comboComp, SWT.NONE);
dlabel.setText(LaunchMessages.CMainTab_Build_Config);
Link dlabel = new Link(comboComp, SWT.NONE);
dlabel.setText("<a>" + LaunchMessages.CMainTab_Build_Config + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
dlabel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
openBuildConfigProperties();
}
});
fBuildConfigCombo = new Combo(comboComp, SWT.READ_ONLY | SWT.DROP_DOWN);
fBuildConfigCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fBuildConfigCombo.addSelectionListener(new SelectionListener() {
@ -321,13 +317,23 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
updateLaunchConfigurationDialog();
}
});
fBuildConfigAuto = new Button(comboComp, SWT.CHECK);
GridData gd1 = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
gd1.heightHint = 0;
gd1.horizontalSpan = 2;
fBuildConfigAuto.setLayoutData(gd1);
fBuildConfigAuto.setVisible(false);
fBuildConfigAuto.setText(LaunchMessages.CMainTab_Build_Config_Auto);
}
/**
* @since 9.0
*/
protected void openBuildConfigProperties() {
IStructuredSelection sel;
ICProject cProject = getCProject();
if (cProject != null)
sel = new StructuredSelection(cProject.getProject());
else
sel = new StructuredSelection();
Shell shell = getShell();
String propertyPageId = "org.eclipse.cdt.managedbuilder.ui.properties.Page_head_build";//$NON-NLS-1$
PropertyDialog dialog = PropertyDialog.createDialogOn(shell, propertyPageId, sel);
if (dialog != null)
dialog.open();
}
/** @since 6.1 */
@ -406,7 +412,8 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
fEnableBuildButton.setSelection(buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED);
if (fWorkspaceSettingsButton != null)
fWorkspaceSettingsButton
.setSelection(buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING);
.setSelection(
buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING);
}
/**
@ -566,7 +573,7 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
*/
protected boolean isAutoConfigSupported() {
// original behavior was if this button is null it won't be shown and "supported"
return fBuildConfigAuto != null;
return true;
}
protected void updateProjectFromConfig(ILaunchConfiguration config) {
@ -616,7 +623,7 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
String tooltip = EMPTY_STRING;
if (configId != null) {
if (configId.equals(AUTO_CONFIG)) {
tooltip = LaunchMessages.CMainTab_Build_Config_Auto_tooltip;
tooltip = LaunchMessages.CMainTab_Build_Config_Auto_tooltip;
} else if (configId.equals(EMPTY_STRING)) {
tooltip = LaunchMessages.CMainTab_Build_Config_Active_tooltip;
}