mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Restore CoreBuildMainTab
Some checks failed
Build and Test / build (push) Has been cancelled
Code Cleanliness Checks / build (push) Has been cancelled
License vetting status check / call-license-check (push) Has been cancelled
Some checks failed
Build and Test / build (push) Has been cancelled
Code Cleanliness Checks / build (push) Has been cancelled
License vetting status check / call-license-check (push) Has been cancelled
* Restored class CoreBuildMainTab, because it is used by others. Created a new class CoreBuildMainTab2. * Initialize CMainTab2.fDontCheckProgram.
This commit is contained in:
parent
5639ba9ff9
commit
9e9be4a5e2
4 changed files with 114 additions and 32 deletions
|
@ -11,7 +11,7 @@
|
||||||
package org.eclipse.cdt.launch.internal.corebuild;
|
package org.eclipse.cdt.launch.internal.corebuild;
|
||||||
|
|
||||||
import org.eclipse.cdt.launch.ui.CArgumentsTab;
|
import org.eclipse.cdt.launch.ui.CArgumentsTab;
|
||||||
import org.eclipse.cdt.launch.ui.corebuild.CoreBuildMainTab;
|
import org.eclipse.cdt.launch.ui.corebuild.CoreBuildMainTab2;
|
||||||
import org.eclipse.cdt.launch.ui.corebuild.CoreBuildTab;
|
import org.eclipse.cdt.launch.ui.corebuild.CoreBuildTab;
|
||||||
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
|
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
|
||||||
import org.eclipse.debug.ui.EnvironmentTab;
|
import org.eclipse.debug.ui.EnvironmentTab;
|
||||||
|
@ -22,7 +22,7 @@ public class LocalLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
|
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
|
||||||
ILaunchConfigurationTab mainTab = new CoreBuildMainTab();
|
ILaunchConfigurationTab mainTab = new CoreBuildMainTab2();
|
||||||
ILaunchConfigurationTab buildTab = new CoreBuildTab();
|
ILaunchConfigurationTab buildTab = new CoreBuildTab();
|
||||||
ILaunchConfigurationTab argumentsTab = new CArgumentsTab();
|
ILaunchConfigurationTab argumentsTab = new CArgumentsTab();
|
||||||
ILaunchConfigurationTab environmentTab = new EnvironmentTab();
|
ILaunchConfigurationTab environmentTab = new EnvironmentTab();
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class CMainTab2 extends CAbstractMainTab {
|
||||||
*/
|
*/
|
||||||
protected Combo fCoreTypeCombo;
|
protected Combo fCoreTypeCombo;
|
||||||
|
|
||||||
private boolean fDontCheckProgram;
|
private boolean fDontCheckProgram = false;
|
||||||
private final boolean fSpecifyCoreFile;
|
private final boolean fSpecifyCoreFile;
|
||||||
private final boolean fIncludeBuildSettings;
|
private final boolean fIncludeBuildSettings;
|
||||||
|
|
||||||
|
|
|
@ -10,51 +10,73 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.launch.ui.corebuild;
|
package org.eclipse.cdt.launch.ui.corebuild;
|
||||||
|
|
||||||
import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
|
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
|
||||||
import org.eclipse.cdt.launch.ui.CMainTab2;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
|
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||||
|
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
||||||
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 9.1
|
* @since 9.1
|
||||||
*/
|
*/
|
||||||
public class CoreBuildMainTab extends CMainTab2 {
|
public class CoreBuildMainTab extends AbstractLaunchConfigurationTab {
|
||||||
|
|
||||||
|
private Text projectName;
|
||||||
|
|
||||||
/*
|
|
||||||
* A Core Build launch configuration is created immediately upon the Core Build project creation.
|
|
||||||
* It cannot be created by hand and it is not duplicatable and can't be renamed.
|
|
||||||
* The launch configuration is tied to the project. The project name may not be changed.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void createProjectGroup(Composite parent, int colSpan) {
|
public void createControl(Composite parent) {
|
||||||
super.createProjectGroup(parent, colSpan);
|
Composite comp = new Composite(parent, SWT.NONE);
|
||||||
fProjText.setEnabled(false);
|
comp.setLayout(new GridLayout());
|
||||||
fProjButton.setVisible(false);
|
|
||||||
|
Label label = new Label(comp, SWT.NONE);
|
||||||
|
label.setText("This launch configuration was automatically created.");
|
||||||
|
label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
|
||||||
|
|
||||||
|
label = new Label(comp, SWT.NONE);
|
||||||
|
label.setText("Project:");
|
||||||
|
|
||||||
|
projectName = new Text(comp, SWT.READ_ONLY | SWT.BORDER);
|
||||||
|
projectName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
|
||||||
|
|
||||||
|
setControl(comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createExeFileGroup(Composite parent, int colSpan) {
|
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
|
||||||
super.createExeFileGroup(parent, colSpan);
|
// none
|
||||||
fProgText.setMessage(LaunchMessages.CoreBuildMainTab_Keep_empty_for_auto_selection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* For Core Build projects the build configuration is hidden and it is selected
|
|
||||||
* via the LaunchBar Launch Mode. We remove the BuildConfigCombo.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBuildConfigCombo(Composite parent, int colspan) {
|
public void initializeFrom(ILaunchConfiguration configuration) {
|
||||||
fBuildConfigCombo = null;
|
try {
|
||||||
|
for (IResource resource : configuration.getMappedResources()) {
|
||||||
|
if (resource instanceof IProject) {
|
||||||
|
projectName.setText(resource.getName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
LaunchUIPlugin.log(e.getStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Don't check the program name if it is empty. When the program name is empty the default
|
|
||||||
* CoreBuild binary is used.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(ILaunchConfiguration config) {
|
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
|
||||||
String programName = fProgText.getText().trim();
|
// TODO Auto-generated method stub
|
||||||
setDontCheckProgram(programName.isEmpty());
|
|
||||||
return super.isValid(config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "Main";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2024 Intel corporation and others.
|
||||||
|
*
|
||||||
|
* This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* https://www.eclipse.org/legal/epl-2.0/
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: EPL-2.0
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.launch.ui.corebuild;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
|
||||||
|
import org.eclipse.cdt.launch.ui.CMainTab2;
|
||||||
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 10.4
|
||||||
|
*/
|
||||||
|
public class CoreBuildMainTab2 extends CMainTab2 {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A Core Build launch configuration is created immediately upon the Core Build project creation.
|
||||||
|
* It cannot be created by hand and it is not duplicatable and can't be renamed.
|
||||||
|
* The launch configuration is tied to the project. The project name may not be changed.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void createProjectGroup(Composite parent, int colSpan) {
|
||||||
|
super.createProjectGroup(parent, colSpan);
|
||||||
|
fProjText.setEnabled(false);
|
||||||
|
fProjButton.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createExeFileGroup(Composite parent, int colSpan) {
|
||||||
|
super.createExeFileGroup(parent, colSpan);
|
||||||
|
fProgText.setMessage(LaunchMessages.CoreBuildMainTab_Keep_empty_for_auto_selection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For Core Build projects the build configuration is hidden and it is selected
|
||||||
|
* via the LaunchBar Launch Mode. We remove the BuildConfigCombo.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void createBuildConfigCombo(Composite parent, int colspan) {
|
||||||
|
fBuildConfigCombo = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't check the program name if it is empty. When the program name is empty the default
|
||||||
|
* CoreBuild binary is used.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isValid(ILaunchConfiguration config) {
|
||||||
|
String programName = fProgText.getText().trim();
|
||||||
|
setDontCheckProgram(programName.isEmpty());
|
||||||
|
return super.isValid(config);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue