1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fixed build location

added build location browser dialog
added help ids.
This commit is contained in:
David Inglis 2003-09-23 14:04:58 +00:00
parent 3e361ae186
commit e72e820aa8
4 changed files with 46 additions and 4 deletions

View file

@ -24,6 +24,7 @@ import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.model.ICModelMarker; import org.eclipse.cdt.core.model.ICModelMarker;
import org.eclipse.cdt.core.resources.ACBuilder; import org.eclipse.cdt.core.resources.ACBuilder;
import org.eclipse.cdt.core.resources.IConsole; import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
@ -110,8 +111,14 @@ public class MakeBuilder extends ACBuilder {
// remove all markers for this project // remove all markers for this project
removeAllMarkers(currProject); removeAllMarkers(currProject);
IPath workingDirectory = info.getBuildLocation(); IPath workingDirectory = null;
if (workingDirectory.isEmpty()) { if (!info.getBuildLocation().isEmpty()) {
IResource res = currProject.getParent().findMember(info.getBuildLocation());
if ( res instanceof IContainer && res.exists()) {
workingDirectory = res.getLocation();
}
}
if ( workingDirectory == null) {
workingDirectory = currProject.getLocation(); workingDirectory = currProject.getLocation();
} }
String[] targets = getTargets(kind, info); String[] targets = getTargets(kind, info);

View file

@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.make.ui;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
public interface IMakeHelpContextIds {
public static final String PREFIX = MakeUIPlugin.getUniqueIdentifier() + ".";
public static final String MAKE_PATH_SYMBOL_SETTINGS = PREFIX + "cdt_paths_symbols_page";
public static final String MAKE_BUILDER_SETTINGS = PREFIX + "cdt_make_builder_page";
}

View file

@ -18,6 +18,7 @@ import org.eclipse.cdt.internal.ui.util.SWTUtil;
import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.MakeScannerInfo; import org.eclipse.cdt.make.core.MakeScannerInfo;
import org.eclipse.cdt.make.core.MakeScannerProvider; import org.eclipse.cdt.make.core.MakeScannerProvider;
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage; import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage;
import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.cdt.utils.ui.controls.ControlFactory;
@ -38,6 +39,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.help.WorkbenchHelp;
public class BuildPathInfoBlock extends AbstractCOptionPage { public class BuildPathInfoBlock extends AbstractCOptionPage {
@ -386,6 +388,9 @@ public class BuildPathInfoBlock extends AbstractCOptionPage {
Composite composite = ControlFactory.createComposite(parent, tabColumns); Composite composite = ControlFactory.createComposite(parent, tabColumns);
composite.setFont(font); composite.setFont(font);
GridData gd; GridData gd;
setControl(composite);
WorkbenchHelp.setHelp(getControl(), IMakeHelpContextIds.MAKE_PATH_SYMBOL_SETTINGS);
// Create a label for the include paths control // Create a label for the include paths control
Label paths = ControlFactory.createLabel(composite, CUIPlugin.getResourceString(PATHS)); Label paths = ControlFactory.createLabel(composite, CUIPlugin.getResourceString(PATHS));
@ -416,7 +421,6 @@ public class BuildPathInfoBlock extends AbstractCOptionPage {
enablePathButtons(); enablePathButtons();
symbolList.select(0); symbolList.select(0);
enableSymbolButtons(); enableSymbolButtons();
setControl(composite);
} }
private String[] getPathListContents() { private String[] getPathListContents() {

View file

@ -8,6 +8,7 @@ package org.eclipse.cdt.make.ui.dialogs;
import org.eclipse.cdt.make.core.IMakeBuilderInfo; import org.eclipse.cdt.make.core.IMakeBuilderInfo;
import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage; import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage;
import org.eclipse.cdt.ui.dialogs.ICOptionContainer; import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.cdt.utils.ui.controls.ControlFactory;
@ -30,6 +31,8 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.help.WorkbenchHelp;
public class SettingsBlock extends AbstractCOptionPage { public class SettingsBlock extends AbstractCOptionPage {
@ -220,9 +223,15 @@ public class SettingsBlock extends AbstractCOptionPage {
browse.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE)); browse.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE));
browse.addSelectionListener(new SelectionAdapter() { browse.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), getContainer().getProject(), true, "Selection Locations to build from.");
if ( dialog.open() == ContainerSelectionDialog.OK ) {
Object[] selection = dialog.getResult();
if (selection.length > 0) {
buildLocation.setText(((IPath)selection[0]).toOSString());
}
}
} }
}); });
browse.setEnabled(false);
buildLocation.setText(fBuildInfo.getBuildLocation().toOSString()); buildLocation.setText(fBuildInfo.getBuildLocation().toOSString());
} }
@ -230,6 +239,8 @@ public class SettingsBlock extends AbstractCOptionPage {
Composite composite = ControlFactory.createComposite(parent, 1); Composite composite = ControlFactory.createComposite(parent, 1);
setControl(composite); setControl(composite);
WorkbenchHelp.setHelp(getControl(), IMakeHelpContextIds.MAKE_BUILDER_SETTINGS);
if (fBuildInfo == null) { if (fBuildInfo == null) {
ControlFactory.createEmptySpace(composite); ControlFactory.createEmptySpace(composite);
ControlFactory.createLabel(composite, "Missing builder information on project."); ControlFactory.createLabel(composite, "Missing builder information on project.");