From aba55c1109e192b3cddf30ec4619bd378568f1ff Mon Sep 17 00:00:00 2001 From: Sean Evoy Date: Tue, 17 Feb 2004 14:20:11 +0000 Subject: [PATCH] Fixes for 41590, 44159, 51640, and 51646 --- .../ChangeLog | 36 + .../core/IManagedBuildInfo.java | 16 +- .../cdt/managedbuilder/core/ITarget.java | 29 +- .../core/ManagedBuildManager.java | 46 +- .../internal/core/MakefileGenerator.java | 58 +- .../internal/core/ManagedBuildInfo.java | 53 +- .../internal/core/PluginResources.properties | 12 +- .../managedbuilder/internal/core/Target.java | 65 +- .../ChangeLog | 351 +- .../plugin.properties | 19 + .../plugin.xml | 3167 +++++++++-------- .../internal/ui/PluginResources.properties | 3 +- .../ui/properties/BrowseEntryDialog.java | 356 +- .../BuildOptionListFieldEditor.java | 27 +- .../ui/properties/BuildPropertyPage.java | 8 +- .../ui/properties/ManageConfigDialog.java | 289 +- .../ui/wizards/NewManagedProjectWizard.java | 5 +- 17 files changed, 2526 insertions(+), 2014 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog index 72fbc83ea20..337e2d4c823 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog +++ b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog @@ -1,3 +1,39 @@ +2004-02-17 Sean Evoy + Fix for critical bug 44163. + The managed build info would become confused when the project it was associated + with was renamed. The project still stored the build information in its session + data, but the internal reference to the owner project was not updated in the + build info. Now, when the build info is retrieved from a project, the manager + asks the info to do a sanity test to check the identity of the true owner against + the owner the it thinks it has. If they differ, the build information updates its + owner and the owner of all the targets it maintains for the project. + * src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java + * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java + * src/org/eclipse/cdt/managedbuilder/core/ITarget.java + * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java + + + Fixes for 51646 + Moved the makefile comment character out of the hard-coded strings and into + the makefile generator. + * src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties + * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java + + Fixes for bug 49590: + The target maintains the default extension and the overridden extension. There + is an interface to get and set the extension, but the method to get the default + extension is deprecated. + * src/org/eclipse/cdt/managedbuilder/core/ITarget.java + * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java + + The build information now has a method to get at the extension + * src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java + * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java + + The makefile generator now asks for both the name and the extension when + generating targets and dependencies. + * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java + 2003-10-23 Bogdan Gheorghe Updated the indexManager.perfomConcurrentJob call in MakefileGenerator diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java index fe4b3621b36..b6fa9ab05c7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java @@ -1,9 +1,7 @@ package org.eclipse.cdt.managedbuilder.core; -import java.util.List; - /********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. + * Copyright (c) 2003,2004 Rational Software Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at @@ -11,7 +9,9 @@ import java.util.List; * * Contributors: * IBM Rational Software - Initial API and implementation -***********************************************************************/ + ***********************************************************************/ + +import java.util.List; public interface IManagedBuildInfo { @@ -31,6 +31,14 @@ public interface IManagedBuildInfo { */ public boolean buildsFileType(String srcExt); + + /** + * Answers the file extension for the receivers build goal. + * + * @return + */ + public String getBuildArtifactExtension(); + /** * Returns the name of the artifact to build for the receiver. * diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java index ef7395aba71..ed51ff587f3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. + * Copyright (c) 2003,2004 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 @@ -22,6 +22,7 @@ public interface ITarget extends IBuildObject { public static final String BINARY_PARSER = "binaryParser"; //$NON-NLS-1$ public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$ public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$ + public static final String EXTENSION = "extension"; //$NON-NLS-1$ public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$ public static final String IS_TEST = "isTest"; //$NON-NLS-1$ public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$ @@ -49,6 +50,14 @@ public interface ITarget extends IBuildObject { */ public IConfiguration createConfiguration(String id); + /** + * Answers the extension that should be applied to build artifacts created by + * this target. + * + * @return String + */ + public String getArtifactExtension(); + /** * Get the name of the final build artifact. * @@ -82,6 +91,7 @@ public interface ITarget extends IBuildObject { * created by this target. * * @return String + * @deprecated */ public String getDefaultExtension(); @@ -166,6 +176,14 @@ public interface ITarget extends IBuildObject { * */ public void resetMakeCommand(); + + /** + * Set (override) the extension that should be appended to the build artifact + * for the receiver. + * + * @param extension + */ + public void setArtifactExtension(String extension); /** * Set the name of the artifact that will be produced when the receiver @@ -173,7 +191,7 @@ public interface ITarget extends IBuildObject { * * @param name */ - public void setBuildArtifact(String name); + public void setArtifactName(String name); /** * Sets the make command for the receiver to the value in the argument. @@ -182,4 +200,11 @@ public interface ITarget extends IBuildObject { */ public void setMakeCommand(String command); + /** + * Sets the resource that owns the receiver. + * + * @param resource + */ + public void updateOwner(IResource resource); + } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index 6d39ed13638..45724ad71ff 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -29,7 +29,9 @@ import org.apache.xml.serialize.OutputFormat; import org.apache.xml.serialize.Serializer; import org.apache.xml.serialize.SerializerFactory; import org.eclipse.cdt.core.AbstractCExtension; -import org.eclipse.cdt.core.parser.*; +import org.eclipse.cdt.core.parser.IScannerInfo; +import org.eclipse.cdt.core.parser.IScannerInfoChangeListener; +import org.eclipse.cdt.core.parser.IScannerInfoProvider; import org.eclipse.cdt.managedbuilder.internal.core.Configuration; import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo; import org.eclipse.cdt.managedbuilder.internal.core.Target; @@ -64,8 +66,8 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI private static Map extensionTargetMap; // Listeners interested in build model changes - private static Map buildModelListeners; - + private static Map buildModelListeners; + /** * Returns the list of targets that are defined by this project, * projects referenced by this project, and by the extensions. @@ -99,10 +101,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI return targets; } - /** + /* (non-Javadoc) * @return */ - public static Map getExtensionTargetMap() { + protected static Map getExtensionTargetMap() { if (extensionTargetMap == null) { extensionTargetMap = new HashMap(); } @@ -202,7 +204,8 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI } } - /** + /* (non-Javadoc) + * * @param config * @param option */ @@ -368,8 +371,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI } } - // Private stuff + /** + * @param target + */ public static void addExtensionTarget(Target target) { if (extensionTargets == null) { extensionTargets = new ArrayList(); @@ -379,6 +384,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI getExtensionTargetMap().put(target.getId(), target); } + // Private stuff private static ManagedBuildInfo loadBuildInfo(IProject project) { ManagedBuildInfo buildInfo = null; IFile file = project.getFile(FILE_NAME); @@ -401,6 +407,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI return buildInfo; } + /* (non-Javadoc) + * Since the class does not have a constructor, but all public methods + * call this method first, it is effectively a startup method + */ private static void loadExtensions() { if (extensionTargetsLoaded) return; @@ -459,6 +469,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI ManagedBuildInfo buildInfo = null; try { buildInfo = (ManagedBuildInfo)resource.getSessionProperty(buildInfoProperty); + // Make sure that if a project has build info, that the info is not corrupted + if (buildInfo != null) { + buildInfo.updateOwner(resource); + } } catch (CoreException e) { return buildInfo; } @@ -479,10 +493,27 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI return buildInfo; } + /** + * Answers the build information for the IResource in the + * argument. If the create is true, then a new build information + * repository will be created for the resource. + * + * @param resource + * @param create + * @return IManagedBuildInfo + */ public static IManagedBuildInfo getBuildInfo(IResource resource, boolean create) { return (IManagedBuildInfo) findBuildInfo(resource, create); } + /** + * Answers, but does not create, the managed build information for the + * argument. + * + * @see ManagedBuildManager#getBuildInfo(IResource, boolean) + * @param resource + * @return IManagedBuildInfo + */ public static IManagedBuildInfo getBuildInfo(IResource resource) { return (IManagedBuildInfo) findBuildInfo(resource, false); } @@ -551,5 +582,4 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI map.put(project, list); } } - } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java index aadd19e8233..23d43a6c8fc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java @@ -1,7 +1,7 @@ package org.eclipse.cdt.managedbuilder.internal.core; /********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. + * Copyright (c) 2003,2004 Rational Software Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at @@ -61,18 +61,19 @@ public class MakefileGenerator { private static final String AUTO_DEP = COMMENT + ".autodeps"; //$NON-NLS-1$ // String constants for makefile contents - protected static final String COLON = ":"; + protected static final String COLON = ":"; //$NON-NLS-1$ protected static final String DEPFILE_NAME = "subdir.dep"; //$NON-NLS-1$ - protected static final String DOT = "."; + protected static final String DOT = "."; //$NON-NLS-1$ protected static final String MAKEFILE_NAME = "makefile"; //$NON-NLS-1$ protected static final String MODFILE_NAME = "subdir.mk"; //$NON-NLS-1$ - protected static final String LINEBREAK = "\\"; - protected static final String NEWLINE = System.getProperty("line.separator"); - protected static final String LOGICAL_AND = "&&"; - protected static final String SEPARATOR = "/"; - protected static final String TAB = "\t"; - protected static final String WHITESPACE = " "; - protected static final String WILDCARD = "%"; + protected static final String LINEBREAK = "\\"; //$NON-NLS-1$ + protected static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$ + protected static final String LOGICAL_AND = "&&"; //$NON-NLS-1$ + protected static final String SEPARATOR = "/"; //$NON-NLS-1$ + protected static final String TAB = "\t"; //$NON-NLS-1$ + protected static final String WHITESPACE = " "; //$NON-NLS-1$ + protected static final String WILDCARD = "%"; //$NON-NLS-1$ + protected static final String COMMENT_SYMBOL = "#"; //$NON-NLS-1$ // Local variables needed by generator protected IManagedBuildInfo info; @@ -294,7 +295,7 @@ public class MakefileGenerator { // Get the name of the build target target = info.getBuildArtifactName(); // Get its extension - extension = (new Path(target)).getFileExtension(); + extension = info.getBuildArtifactExtension(); if (extension == null) { extension = new String(); } @@ -316,7 +317,7 @@ public class MakefileGenerator { // Create the buffer to hold the output for the module and a dep calculator StringBuffer buffer = new StringBuffer(); - buffer.append(ManagedBuilderCorePlugin.getResourceString(AUTO_DEP) + NEWLINE); + buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(AUTO_DEP) + NEWLINE); IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); /* @@ -374,7 +375,7 @@ public class MakefileGenerator { buffer.append("RM := "); buffer.append(info.getCleanCommand() + NEWLINE + NEWLINE); - buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); + buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); buffer.append("C_SRCS := " + NEWLINE); buffer.append("CC_SRCS := " + NEWLINE); buffer.append("CXX_SRCS := " + NEWLINE); @@ -409,7 +410,7 @@ public class MakefileGenerator { protected StringBuffer addSubdirectories() { StringBuffer buffer = new StringBuffer(); // Add the comment - buffer.append(ManagedBuilderCorePlugin.getResourceString(MOD_LIST) + NEWLINE); + buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_LIST) + NEWLINE); buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE); // Get all the module names @@ -427,7 +428,7 @@ public class MakefileGenerator { // Now add the makefile instruction to include all the subdirectory makefile fragments buffer.append(NEWLINE); - buffer.append(ManagedBuilderCorePlugin.getResourceString(MOD_INCL) + NEWLINE); + buffer.append(COMMENT_SYMBOL +WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_INCL) + NEWLINE); buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE); buffer.append(NEWLINE + NEWLINE); @@ -460,10 +461,10 @@ public class MakefileGenerator { capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE); cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); - StringBuffer ruleBuffer = new StringBuffer(ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE); + StringBuffer ruleBuffer = new StringBuffer(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE); // Put the comment in - buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); + buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); // Visit the resources in this folder IResource[] resources = module.members(); @@ -531,8 +532,11 @@ public class MakefileGenerator { if (deps.length > 0) { defaultTarget += WHITESPACE + "deps"; } - buffer.append(defaultTarget + WHITESPACE + outputPrefix + target + NEWLINE); - buffer.append(NEWLINE); + buffer.append(defaultTarget + WHITESPACE + outputPrefix + target); + if (extension.length() > 0) { + buffer.append(DOT + extension); + } + buffer.append(NEWLINE + NEWLINE); /* * The build target may depend on other projects in the workspace. These are @@ -555,12 +559,16 @@ public class MakefileGenerator { // Extract the build artifact to add to the dependency list String depTarget = depInfo.getBuildArtifactName(); - String depExt = (new Path(depTarget)).getFileExtension(); + String depExt = depInfo.getBuildArtifactExtension(); String depPrefix = depInfo.getOutputPrefix(depExt); if (depInfo.isDirty()) { depTargets = "clean all"; } - managedProjectOutputs.add(buildDir + SEPARATOR + depPrefix + depTarget); + String dependency = buildDir + SEPARATOR + depPrefix + depTarget; + if (depExt.length() > 0) { + dependency += DOT + depExt; + } + managedProjectOutputs.add(dependency); } buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE); } @@ -573,7 +581,11 @@ public class MakefileGenerator { * targ_.: $(OBJS) [ ... ] * $(BUILD_TOOL) $(FLAGS) $(OUTPUT_FLAG) $@ $(OBJS) $(USER_OBJS) $(LIB_DEPS) */ - buffer.append(outputPrefix + target + COLON + WHITESPACE + "$(OBJS)"); + buffer.append(outputPrefix + target); + if (extension.length() > 0) { + buffer.append(DOT + extension); + } + buffer.append(COLON + WHITESPACE + "$(OBJS)"); Iterator iter = managedProjectOutputs.listIterator(); while (iter.hasNext()) { buffer.append(WHITESPACE + (String)iter.next()); @@ -588,7 +600,7 @@ public class MakefileGenerator { buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE); - buffer.append(ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE); + buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE); buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE); return buffer; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java index 7edafd91490..9046dbeb873 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java @@ -1,7 +1,7 @@ package org.eclipse.cdt.managedbuilder.internal.core; /********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. + * Copyright (c) 2002,2004 Rational Software Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at @@ -74,7 +74,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { } // All the available targets have been read in defaultTarget = (ITarget) targetMap.get(defaultTargetId); - // Now we have a misserable O(N^2) operation (oh well, the data sets are small) + // Now we have a miserable O(N^2) operation (oh well, the data sets are small) ListIterator stringIter = configIds.listIterator(); while (stringIter.hasNext()){ String confId = (String) stringIter.next(); @@ -133,13 +133,29 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { return false; } + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getBuildArtifactExtension() + */ + public String getBuildArtifactExtension() { + String ext = new String(); + ITarget target = getDefaultTarget(); + if (target != null) { + ext = target.getArtifactExtension(); + } + return ext; + } + /* (non-Javadoc) * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getBuildArtifactName() */ public String getBuildArtifactName() { // Get the default target and use its value - String name = getDefaultTarget().getArtifactName(); - return name == null ? new String() : name; + String name = new String(); + ITarget target = getDefaultTarget(); + if (target != null) { + name = target.getArtifactName(); + } + return name; } /* (non-Javadoc) @@ -149,7 +165,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { // Get from the model String command = new String(); ITarget target = getDefaultTarget(); - command = target.getCleanCommand(); + if (target != null) { + command = target.getCleanCommand(); + } return command; } @@ -359,7 +377,12 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { // Return the include paths for the default configuration ArrayList paths = new ArrayList(); IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - IPath root = owner.getLocation().addTrailingSeparator().append(config.getName()); + IPath location = owner.getLocation(); + // If the build info is out of date this might be null + if (location == null) { + location = new Path("."); + } + IPath root = location.addTrailingSeparator().append(config.getName()); ITool[] tools = config.getTools(); for (int i = 0; i < tools.length; i++) { ITool tool = tools[i]; @@ -867,4 +890,22 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { this.isDirty = isDirty; } + /** + * @param resource + */ + public void updateOwner(IResource resource) { + // Check to see if the owner is the same as the argument + if (resource != null) { + if (!owner.equals(resource)) { + owner = resource; + // Do the same for the targets + Iterator iter = targets.listIterator(); + while(iter.hasNext()) { + ITarget target = (ITarget) iter.next(); + target.updateOwner(resource); + } + } + } + } + } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties index 0558db5c999..9da4fb7f9ab 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties @@ -19,9 +19,9 @@ ManagedMakeBuilder.message.creating.markers = Generating markers... ManagedMakeBuilder.message.error = Build error ManagedMakeBuilder.message.error.refresh = Error refreshing project. ManagedMakeBuilder.message.finished = Build complete for project {0} -ManagedMakeBuilder.comment.module.list = # Every subdirectory with source files must be described here -ManagedMakeBuilder.comment.source.list = # Each subdirectory must contribute its source files here -ManagedMakeBuilder.comment.build.rule = # Each subdirectory must supply rules for building sources it contributes -ManagedMakeBuilder.comment.module.make.includes = # Include the makefiles for each source subdirectory -ManagedMakeBuilder.comment.module.dep.includes = # Include automatically-generated dependency list: -ManagedMakeBuilder.comment.autodeps = # Automatically-generated dependency list: +ManagedMakeBuilder.comment.module.list = Every subdirectory with source files must be described here +ManagedMakeBuilder.comment.source.list = Each subdirectory must contribute its source files here +ManagedMakeBuilder.comment.build.rule = Each subdirectory must supply rules for building sources it contributes +ManagedMakeBuilder.comment.module.make.includes = Include the makefiles for each source subdirectory +ManagedMakeBuilder.comment.module.dep.includes = Include automatically-generated dependency list: +ManagedMakeBuilder.comment.autodeps = Automatically-generated dependency list: diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java index 4ad06f66327..6344dd02baf 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java @@ -1,7 +1,7 @@ package org.eclipse.cdt.managedbuilder.internal.core; /********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. + * Copyright (c) 2003,2004 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 @@ -39,6 +39,7 @@ public class Target extends BuildObject implements ITarget { private Map configMap; private List configurations; private String defaultExtension; + private String extension; private boolean isAbstract = false; private boolean isTest = false; private String makeCommand; @@ -77,7 +78,7 @@ public class Target extends BuildObject implements ITarget { setName(parent.getName()); this.artifactName = parent.getArtifactName(); this.binaryParserId = parent.getBinaryParserId(); - this.defaultExtension = parent.getDefaultExtension(); + this.defaultExtension = parent.getArtifactExtension(); this.isTest = parent.isTestTarget(); this.cleanCommand = parent.getCleanCommand(); @@ -193,8 +194,10 @@ public class Target extends BuildObject implements ITarget { // contain what the user entered in the UI). artifactName = element.getAttribute(ARTIFACT_NAME); - // Get the default extension - defaultExtension = element.getAttribute(DEFAULT_EXTENSION); + // Get the overridden extension + if (element.hasAttribute(EXTENSION)) { + extension = element.getAttribute(EXTENSION); + } // parent String parentId = element.getAttribute(PARENT); @@ -261,7 +264,9 @@ public class Target extends BuildObject implements ITarget { element.setAttribute(PARENT, parent.getId()); element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false"); element.setAttribute(ARTIFACT_NAME, getArtifactName()); - element.setAttribute(DEFAULT_EXTENSION, getDefaultExtension()); + if (extension != null) { + element.setAttribute(EXTENSION, extension); + } element.setAttribute(IS_TEST, isTest ? "true" : "false"); element.setAttribute(CLEAN_COMMAND, getCleanCommand()); if (makeCommand != null) { @@ -410,8 +415,9 @@ public class Target extends BuildObject implements ITarget { return emptyConfigs; } + /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#getDefaultExtension() + * @see org.eclipse.cdt.managedbuilder.core.ITarget#getDefaultExtension() */ public String getDefaultExtension() { return defaultExtension == null ? EMPTY_STRING : defaultExtension; @@ -442,6 +448,28 @@ public class Target extends BuildObject implements ITarget { } } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.ITarget#getArtifactExtension() + */ + public String getArtifactExtension() { + // Has the user changed the extension for this target + if (extension != null) { + return extension; + } + // If not, then go through the default extension lookup + if (defaultExtension == null) { + // Ask my parent first + if (parent != null) { + return parent.getArtifactExtension(); + } else { + return EMPTY_STRING; + } + } else { + return defaultExtension; + } + } + /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.ITarget#getBinaryParserId() */ @@ -476,7 +504,7 @@ public class Target extends BuildObject implements ITarget { configurations.add(configuration); configMap.put(configuration.getId(), configuration); } - + /* (non-Javadoc) * @see org.eclipse.cdt.core.build.managed.ITarget#isAbstract() */ @@ -506,9 +534,18 @@ public class Target extends BuildObject implements ITarget { } /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#setBuildArtifact(java.lang.String) + * @see org.eclipse.cdt.managedbuilder.core.ITarget#setArtifactExtension(java.lang.String) */ - public void setBuildArtifact(String name) { + public void setArtifactExtension(String extension) { + if (extension != null) { + this.extension = extension; + } + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.core.build.managed.ITarget#setArtifactName(java.lang.String) + */ + public void setArtifactName(String name) { if (name != null) { artifactName = name; } @@ -523,4 +560,14 @@ public class Target extends BuildObject implements ITarget { } } + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.ITarget#updateOwner(org.eclipse.core.resources.IResource) + */ + public void updateOwner(IResource resource) { + if (!resource.equals(owner)) { + // Set the owner correctly + owner = resource; + } + } + } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog index 3b6c2c858a2..e9890c609da 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog +++ b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog @@ -1,164 +1,189 @@ -2003-11-10 Tanya Wolff - - I18N-Externalized strings from plugin.xml. - I18N-Added keys & strings to plugin.properties. - Fixed an id error in linux c compiler debugger options. - * plugin.xml - * plugin.properties - -2003-11-11 Sean Evoy - Work to implement bugzilla 44841: - Added a scrollbar to the list control inside the custom list field editor. - Also added an Edit button to the field editor to make it easier for keyboard-only - accessibility. - - Work for bugzilla 44451: - Changed the method that prompts user for information so that if the user cancels - with an empty input dialog, the method always returns an empty string. The responsibility - now rests with the caller to test the return value for length > 0 to decide whether or - not to add string to the list. - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java - - Moved string constants from core UI plugin to build UI plugin. These values are duplicated - in the standadrd make UI plugin anyway, so the argument for keeping them in a common - plugin seems pretty weak. This removes another dependency between the builder UI and - common UI plugin. I did have to change the string resource lookup method in a few of - the UI implementation classes that use the constants. - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java - -2003-10-17 Tom Tromey - - Changed -werror to -Werror - * plugin.xml - -2003-10-14 Alain Magloire - - ICOptionPage was added a new method - Preferences getPreferences(); - This is needed to get the preference store when saving - On the plugin. We had the equivalent for project - IProject getProject(); - - * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage - -2003-10-01 Sean Evoy - Fix for bugs 43490 (trivial), 44020, and 43980. - A massive change has occurred in the plugin file. I added new C tools that apply - only to projects with C natures. I also added option overrides in the default - configurations for these new tools. The trivial fix for the new C project wizard - involved changing the icon entry in the plugin file. - * plugin.xml - - In preparation for 44020, each new configuration created is assigned a truly - random ID. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java - - Removed a tooltip that was not being populated properly. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java - -2003-09-30 Sean Evoy - Fix for bug 41826. - - Updated the tool specifications for Win32, Linux, and Solaris so that header - file extension info is available. - * plugin.xml - -2003-09-25 Sean Evoy - For bug (really an enhancement request)43756, I added the word default to a - widget label to try and make it clear that a new configuration will be based - on default values, not user-overridden stuff. It remains to be seen if this - actually helps, but it seems reasonable. - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - - For bug 43220 I now display a widget just for user objects. - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java - - I also reordered the plugin definition for the linker tools, and moved some of - the option labels to the plugin property file. I also added a user object option - to each linker tool definition. - * plugin.properties - * plugin.xml - -2003-09-25 Sean Evoy - This patch contains a lot of changes needed to implement fixes for 42648 and - 43122. - - The properties file has been updated to externalize some of the option labels - to try and address some of the concern about continuity between UIs on - different platforms. - * plugin.properties - - There are changes in the plugin XML file to accomodate showing the targets - only on the correct host platform. Option names have bee replaced with - externalized equivalents where possible. The release and debug configurations - for each configuration now apply "reasonable" defaults for debug and optimization - option. Finally, the Cygwinb tool specification has been brought closer to those - for *nix. - * plugin.xml - - Only targets that correspond to the host platforms are shown in the drop-down - list. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java - -2003-09-23 Sean Evoy - I added a fix for critical bug 43439. The new project wizard is ready to be hooked - up to the help system content on F1. There is a new file with the string constant - the doc project will use to map the widget to a help file. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java - * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java - - In support of the fix for critical bug 43292, I added a new set of widgets to - the ManageConfigDialog implementation. I added new string literals in the properties - file for the plugin. There are obviously new event handlers for the Manage dialog. - It displays the make command for the target, the name of the build artifact, and - a list of current and deleted configurations. There is no way to add new targets. - Users can restore deleted configurations up until they click OK. The client of this - dialog has been changed to properly respond to the changes. The NewConfigurationDialog - now displays an externalized string in the title bar. - * plugin.xml - * plugin.properties - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java - -2003-09-19 Sean Evoy - Removed the binary parser selection tab from the new class wizard. Updated the - page description externalized string. - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java - - Added the hard-coded binary parser info to the defined targets. - * plugin.xml - - Fixed the event handling for add/remove in the list widget for build settings pages. - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java - -2003-09-16 Sean Evoy - Changed the initialization and button status logic so the list buttons are - enabled correctly on start-up and that the fist item in the list (if - any) is selected. Also changed the "Add" event handler to properly enable - the buttons and set the list selection. - - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java - -2003-09-15 Sean Evoy - First submission of code to new project. Moved all the managed - builder-specific UI elements out of the cdt.ui project. This - includes the icons, and externalized strings. - - There are 2 new classes to handle the externalized strings and image - files: - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java - * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java - - The property pages have been modified to use a mix of externalized - strings from the CUIPlugin and ManagedBuilderUIPlugin. The new project - wizard has been reimplemented using the new C project classes added by +2004-2-17 Sean Evoy + Fixes for 51640 + Externalized strings for the target names. + * plugin.properties + * plugin.xml + + Fixes for bug 49590: + The system now makes a distinction between the name of the output and its extension. + The UI for managing the name of the build output now has a field for entering the + extension. The new project wizard does not automatically append the extension to the + name of the build output. + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java + * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java + + Some ground work for C11: + Added a browse button and an area for selecting a path variable to the browse + dialog. However, this is still turned off since it is not fully functional. + * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties + * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java + + Changed the order of the configurations in the manifest so that debug configurations are the default for every project. + * plugin.xml + +2003-11-10 Tanya Wolff + + I18N-Externalized strings from plugin.xml. + I18N-Added keys & strings to plugin.properties. + Fixed an id error in linux c compiler debugger options. + * plugin.xml + * plugin.properties + +2003-11-11 Sean Evoy + Work to implement bugzilla 44841: + Added a scrollbar to the list control inside the custom list field editor. + Also added an Edit button to the field editor to make it easier for keyboard-only + accessibility. + + Work for bugzilla 44451: + Changed the method that prompts user for information so that if the user cancels + with an empty input dialog, the method always returns an empty string. The responsibility + now rests with the caller to test the return value for length > 0 to decide whether or + not to add string to the list. + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java + + Moved string constants from core UI plugin to build UI plugin. These values are duplicated + in the standadrd make UI plugin anyway, so the argument for keeping them in a common + plugin seems pretty weak. This removes another dependency between the builder UI and + common UI plugin. I did have to change the string resource lookup method in a few of + the UI implementation classes that use the constants. + * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties + * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java + +2003-10-17 Tom Tromey + + Changed -werror to -Werror + * plugin.xml + +2003-10-14 Alain Magloire + + ICOptionPage was added a new method + Preferences getPreferences(); + This is needed to get the preference store when saving + On the plugin. We had the equivalent for project + IProject getProject(); + + * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage + +2003-10-01 Sean Evoy + Fix for bugs 43490 (trivial), 44020, and 43980. + A massive change has occurred in the plugin file. I added new C tools that apply + only to projects with C natures. I also added option overrides in the default + configurations for these new tools. The trivial fix for the new C project wizard + involved changing the icon entry in the plugin file. + * plugin.xml + + In preparation for 44020, each new configuration created is assigned a truly + random ID. + * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java + + Removed a tooltip that was not being populated properly. + * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java + +2003-09-30 Sean Evoy + Fix for bug 41826. + + Updated the tool specifications for Win32, Linux, and Solaris so that header + file extension info is available. + * plugin.xml + +2003-09-25 Sean Evoy + For bug (really an enhancement request)43756, I added the word default to a + widget label to try and make it clear that a new configuration will be based + on default values, not user-overridden stuff. It remains to be seen if this + actually helps, but it seems reasonable. + * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties + + For bug 43220 I now display a widget just for user objects. + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java + + I also reordered the plugin definition for the linker tools, and moved some of + the option labels to the plugin property file. I also added a user object option + to each linker tool definition. + * plugin.properties + * plugin.xml + +2003-09-25 Sean Evoy + This patch contains a lot of changes needed to implement fixes for 42648 and + 43122. + + The properties file has been updated to externalize some of the option labels + to try and address some of the concern about continuity between UIs on + different platforms. + * plugin.properties + + There are changes in the plugin XML file to accomodate showing the targets + only on the correct host platform. Option names have bee replaced with + externalized equivalents where possible. The release and debug configurations + for each configuration now apply "reasonable" defaults for debug and optimization + option. Finally, the Cygwinb tool specification has been brought closer to those + for *nix. + * plugin.xml + + Only targets that correspond to the host platforms are shown in the drop-down + list. + * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java + +2003-09-23 Sean Evoy + I added a fix for critical bug 43439. The new project wizard is ready to be hooked + up to the help system content on F1. There is a new file with the string constant + the doc project will use to map the widget to a help file. + * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java + * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java + + In support of the fix for critical bug 43292, I added a new set of widgets to + the ManageConfigDialog implementation. I added new string literals in the properties + file for the plugin. There are obviously new event handlers for the Manage dialog. + It displays the make command for the target, the name of the build artifact, and + a list of current and deleted configurations. There is no way to add new targets. + Users can restore deleted configurations up until they click OK. The client of this + dialog has been changed to properly respond to the changes. The NewConfigurationDialog + now displays an externalized string in the title bar. + * plugin.xml + * plugin.properties + * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java + * src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java + +2003-09-19 Sean Evoy + Removed the binary parser selection tab from the new class wizard. Updated the + page description externalized string. + * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties + * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java + + Added the hard-coded binary parser info to the defined targets. + * plugin.xml + + Fixed the event handling for add/remove in the list widget for build settings pages. + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java + +2003-09-16 Sean Evoy + Changed the initialization and button status logic so the list buttons are + enabled correctly on start-up and that the fist item in the list (if + any) is selected. Also changed the "Add" event handler to properly enable + the buttons and set the list selection. + + * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java + +2003-09-15 Sean Evoy + First submission of code to new project. Moved all the managed + builder-specific UI elements out of the cdt.ui project. This + includes the icons, and externalized strings. + + There are 2 new classes to handle the externalized strings and image + files: + * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties + * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java + * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java + + The property pages have been modified to use a mix of externalized + strings from the CUIPlugin and ManagedBuilderUIPlugin. The new project + wizard has been reimplemented using the new C project classes added by QNX September 12, 2003. The UI itself has not changed. \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties index ecc2ffcaea3..42f6b93620e 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties +++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties @@ -7,15 +7,34 @@ MngCWizard.description=Create a new C project and let Eclipse create and manage MngCCWizard.name=Managed Make C++ Project MngCCWizard.description=Create a new C++ project and let Eclipse create and manage the makefile +#The property pages +MngBuildProp.name=C/C++ Build + # Build Model Names +TargetName.cygw=Cygwin +TargetName.cygw.exe=Cygwin Executable +TargetName.cygw.so=Cygwin Shared Library +TargetName.cygw.lib=Cygwin Static Library +TargetName.cygw.dll=Cygwin Export Library (DLL) +TargetName.linux=Linux +TargetName.linux.exe=Linux Executable +TargetName.linux.so=Linux Shared Library +TargetName.linux.lib=Linux Static Library +TargetName.solaris=Solaris +TargetName.solaris.exe=Solaris Executable +TargetName.solaris.so=Solaris Shared Library +TargetName.solaris.lib=Solaris Static Library + ConfigName.Rel=Release ConfigName.Dbg=Debug + ToolName.preprocessor = Preprocessor ToolName.compiler.c = C Compiler ToolName.compiler.cpp = C++ Compiler ToolName.archiver = Archiver ToolName.linker.c = C Linker ToolName.linker.cpp = C++ Linker + OptionCategory.Symbols = Symbols OptionCategory.Preproc = Preprocessor OptionCategory.Dirs = Directories diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml index 32c43178444..8a1ca52ae38 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml +++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml @@ -31,8 +31,8 @@ icon="icons/full/wizban/newmngcc_app.gif" category="org.eclipse.cdt.ui.newCCWizards" class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCCProjectWizard" - finalPerspective="org.eclipse.cdt.ui.CPerspective" project="true" + finalPerspective="org.eclipse.cdt.ui.CPerspective" id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCCWizard"> %MngCCWizard.description @@ -43,8 +43,8 @@ icon="icons/full/wizban/newmngc_app.gif" category="org.eclipse.cdt.ui.newCWizards" class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCProjectWizard" - finalPerspective="org.eclipse.cdt.ui.CPerspective" project="true" + finalPerspective="org.eclipse.cdt.ui.CPerspective" id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCWizard"> %MngCWizard.description @@ -55,7 +55,7 @@ point="org.eclipse.ui.propertyPages"> + + + valueType="boolean" + id="cygwin.gnu.c.compiler.preprocessor.nostdinc"> + valueType="definedSymbols" + id="cygwin.gnu.c.preprocessor.def.symbols"> + value="_X86_=1" + builtIn="true"> + value="__OPTIMIZE__" + builtIn="true"> + value="__STDC_HOSTED__=1" + builtIn="true"> + value="i386" + builtIn="true"> + value="__i386" + builtIn="true"> + value="__i386__" + builtIn="true"> + value="__tune_i686__" + builtIn="true"> + value="__tune_pentiumpro__" + builtIn="true"> + value="__tune_pentium2__" + builtIn="true"> + value="__tune_pentium3__" + builtIn="true"> + value="__stdcall=__attribute__((__stdcall__))" + builtIn="true"> + value="__fastcall=__attribute__((__fastcall__))" + builtIn="true"> + value="__cdecl=__attribute__((__cdecl__))" + builtIn="true"> + value="_stdcall=__attribute__((__stdcall__))" + builtIn="true"> + value="_fastcall=__attribute__((__fastcall__))" + builtIn="true"> + value="_cdecl=__attribute__((__cdecl__))" + builtIn="true"> + value="__declspec(x)=__attribute__((x))" + builtIn="true"> + value="__CYGWIN32__" + builtIn="true"> + value="__CYGWIN__" + builtIn="true"> + value="unix" + builtIn="true"> + value="__unix__" + builtIn="true"> + value="__unix" + builtIn="true"> + valueType="includePath" + id="cygwin.gnu.c.compiler.general.include.paths"> + value="C:\cygwin\usr\include\w32api" + builtIn="true"> + valueType="enumerated" + id="cygwin.gnu.c.compiler.general.optimization.level"> + valueType="string" + id="cygwin.gnu.c.compiler.optimization.flags"> + valueType="enumerated" + id="cygwin.c.compiler.debugging.level"> + valueType="string" + id="cygwin.gnu.c.compiler.debugging.other"> + valueType="boolean" + id="cygwin.gnu.c.compiler.warnings.syntax"> + valueType="string" + id="cygwin.gnu.c.compiler.misc.other"> + valueType="boolean" + id="cygwin.gnu.compiler.preprocessor.nostdinc"> + valueType="definedSymbols" + id="cygwin.preprocessor.def.symbols"> + value="_X86_=1" + builtIn="true"> + value="__OPTIMIZE__" + builtIn="true"> + value="__STDC_HOSTED__=1" + builtIn="true"> + value="i386" + builtIn="true"> + value="__i386" + builtIn="true"> + value="__i386__" + builtIn="true"> + value="__tune_i686__" + builtIn="true"> + value="__tune_pentiumpro__" + builtIn="true"> + value="__tune_pentium2__" + builtIn="true"> + value="__tune_pentium3__" + builtIn="true"> + value="__stdcall=__attribute__((__stdcall__))" + builtIn="true"> + value="__fastcall=__attribute__((__fastcall__))" + builtIn="true"> + value="__cdecl=__attribute__((__cdecl__))" + builtIn="true"> + value="_stdcall=__attribute__((__stdcall__))" + builtIn="true"> + value="_fastcall=__attribute__((__fastcall__))" + builtIn="true"> + value="_cdecl=__attribute__((__cdecl__))" + builtIn="true"> + value="__declspec(x)=__attribute__((x))" + builtIn="true"> + value="__CYGWIN32__" + builtIn="true"> + value="__CYGWIN__" + builtIn="true"> + value="unix" + builtIn="true"> + value="__unix__" + builtIn="true"> + value="__unix" + builtIn="true"> + valueType="includePath" + id="cygwin.compiler.general.include.paths"> + value="C:\cygwin\usr\include\w32api" + builtIn="true"> + valueType="enumerated" + id="cygwin.compiler.general.optimization.level"> + valueType="string" + id="cygwin.compiler.optimization.flags"> + valueType="enumerated" + id="cygwin.compiler.debugging.level"> + valueType="string" + id="cygwin.gnu.compiler.debugging.other"> + valueType="boolean" + id="cygwin.gnu.compiler.warnings.syntax"> + valueType="string" + id="cygwin.compiler.misc.other"> - - - - - - - - - - - - - - @@ -795,210 +771,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="cygwin.exec.release"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1051,283 +1027,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="cygwin.so.release"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1380,12 +1356,39 @@ + + + + + + + + + + + + + + + valueType="string" + id="cygwin.ar.flags"> + valueType="boolean" + id="linux.gnu.c.compiler.preprocessor.nostdinc"> + valueType="definedSymbols" + id="linux.gnu.c.preprocessor.def.symbols"> + value="__ELF__" + builtIn="true"> + value="unix" + builtIn="true"> + value="__gnu_linux__" + builtIn="true"> + value="linux" + builtIn="true"> + value="__unix__" + builtIn="true"> + value="__linux__" + builtIn="true"> + value="__unix" + builtIn="true"> + value="__linux" + builtIn="true"> + value="__OPTIMIZE__" + builtIn="true"> + value="__STDC_HOSTED__=1" + builtIn="true"> + value="_GNU_SOURCE" + builtIn="true"> + value="i386" + builtIn="true"> + value="__i386" + builtIn="true"> + value="__i386__" + builtIn="true"> + value="__tune_i386__" + builtIn="true"> + valueType="includePath" + id="linux.gnu.c.compiler.general.include.paths"> + valueType="enumerated" + id="linux.gnu.c.compiler.general.optimization.level"> + valueType="string" + id="linux.gnu.c.compiler.optimization.flags"> + valueType="enumerated" + id="linux.c.compiler.debugging.level"> + valueType="string" + id="linux.gnu.c.compiler.debugging.other"> + valueType="boolean" + id="linux.gnu.c.compiler.warnings.syntax"> + valueType="string" + id="linux.gnu.c.compiler.misc.other"> + valueType="boolean" + id="linux.gnu.compiler.preprocessor.nostdinc"> + valueType="includePath" + id="linux.gnu.compiler.dirs.incpaths"> + value="/usr/local/include" + builtIn="true"> + value="/usr/include" + builtIn="true"> + valueType="enumerated" + id="linux.gnu.compiler.optimization.level"> + valueType="string" + id="linux.compiler.optimization.flags"> + valueType="enumerated" + id="linux.gnu.compiler.debugging.level"> + valueType="string" + id="linux.gnu.compiler.debugging.other"> + valueType="boolean" + id="linux.gnu.compiler.warnings.syntax"> + valueType="string" + id="linux.gnu.compiler.other.other"> - - - - - - - - - - - - - - @@ -2059,210 +2036,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="linux.gnu.exec.release"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2312,208 +2289,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="linux.gnu.so.release"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2563,13 +2540,39 @@ + + + + + + + + + + + + + + + valueType="string" + id="linux.gnu.lib.flags"> + valueType="boolean" + id="solaris.gnu.c.compiler.preprocessor.nostdinc"> + valueType="definedSymbols" + id="solaris.gnu.c.preprocessor.def.symbols"> + value="sun" + builtIn="true"> + value="sparc" + builtIn="true"> + value="unix" + builtIn="true"> + value="__svr4__" + builtIn="true"> + value="__SVR4" + builtIn="true"> + value="__GCC_NEW_VARARGS__" + builtIn="true"> + value="__sun__" + builtIn="true"> + value="__sparc__" + builtIn="true"> + value="__unix__" + builtIn="true"> + value="__sun" + builtIn="true"> + value="__sparc" + builtIn="true"> + value="__unix" + builtIn="true"> + value="__OPTIMIZE__" + builtIn="true"> + valueType="includePath" + id="solaris.gnu.c.compiler.general.include.paths"> + valueType="enumerated" + id="solaris.gnu.c.compiler.general.optimization.level"> + valueType="string" + id="solaris.gnu.c.compiler.optimization.flags"> + valueType="enumerated" + id="solaris.c.compiler.debugging.level"> + valueType="string" + id="solaris.gnu.c.compiler.debugging.other"> + valueType="boolean" + id="solaris.gnu.c.compiler.warnings.syntax"> + valueType="string" + id="solaris.gnu.c.compiler.misc.other"> + valueType="boolean" + id="solaris.gnu.compiler.preprocessor.nostdinc"> + valueType="includePath" + id="solaris.gnu.compiler.dirs.incpaths"> + value="/usr/local/include" + builtIn="true"> + value="/usr/include" + builtIn="true"> + valueType="enumerated" + id="solaris.gnu.compiler.optimization.level"> + valueType="string" + id="solaris.compiler.optimization.flags"> + valueType="enumerated" + id="solaris.gnu.compiler.debugging.level"> + valueType="string" + id="solaris.gnu.compiler.debugging.other"> + valueType="boolean" + id="solaris.gnu.compiler.warnings.syntax"> + valueType="string" + id="solaris.gnu.compiler.other.other"> - - - - - - - - - - - - - - @@ -3220,10 +3197,36 @@ + + + + + + + + + + + + + + @@ -3237,40 +3240,40 @@ name="%Option.Posix.Linker.NoStartFiles" category="solaris.gnu.c.linker.category.general" command="-nostartfiles" - id="solaris.gnu.c.link.options.nostart" - valueType="boolean"> + valueType="boolean" + id="solaris.gnu.c.link.options.nostart"> + valueType="libs" + id="solaris.gnu.c.link.libs"> + valueType="string" + id="solaris.gnu.c.link.ldflags"> @@ -3333,40 +3336,40 @@ name="%Option.Posix.Linker.NoStartFiles" category="solaris.gnu.linker.category.options" command="-nostartfiles" - id="solaris.gnu.linker.options.nostart" - valueType="boolean"> + valueType="boolean" + id="solaris.gnu.linker.options.nostart"> + valueType="libs" + id="solaris.gnu.linker.libs.libs"> + valueType="string" + id="solaris.gnu.linker.libs.flags"> + + + + + + + + + + + + + + @@ -3451,40 +3480,14 @@ - - - - - - - - - - - - - - + valueType="boolean" + id="solaris.gnu.c.solink.options.nostart"> + valueType="libs" + id="solaris.gnu.c.solink.libs"> + valueType="string" + id="solaris.gnu.c.solink.ldflags"> + valueType="boolean" + id="solaris.gnu.solink.options.nostart"> + valueType="libs" + id="solaris.gnu.solink.libs.libs"> + valueType="string" + id="solaris.gnu.solink.libs.flags"> - - - - - - - - - - - - - - @@ -3728,13 +3705,39 @@ + + + + + + + + + + + + + + + valueType="string" + id="solaris.gnu.lib.flags"> diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties index 2dacaefb7cb..e174a08c6b3 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties @@ -59,7 +59,8 @@ NewConfiguration.error.duplicateName=A configuration named "{0}" already exists. ManageConfig.label.makecmdgroup=Make command ManageConfig.label.makecmddef=Use default command ManageConfig.label.output.group=Build output -ManageConfig.label.output.label=Artifact name: +ManageConfig.label.output.name=Artifact name: +ManageConfig.label.output.extension=Artifact extension: ManageConfig.label.configs=Manage configurations ManageConfig.label.restore=Restore ManageConfig.label.configs.current=Current: diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java index 5cb300916b2..1bb75ad74e2 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java @@ -1,73 +1,102 @@ package org.eclipse.cdt.managedbuilder.ui.properties; -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html +/******************************************************************************* + * Copyright (c) 2002,2004 IBM Corporation and others. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Common Public License v0.5 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/cpl-v05.html * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ + * Contributors: IBM Rational Software - Initial API and implementation + ******************************************************************************/ +import org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog; +import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; -public class BrowseEntryDialog extends Dialog { +/** + * The BrowseEntryDialog allows clients to prompt the user for a path location. + * The dialog will contain a browse button to make it easy to lcate absolute + * locations onthe target file system. The user will also be able to specify a + * location using defined variables. The client must be able to deal with these + * variables. + */ +public class BrowseEntryDialog extends SelectionStatusDialog { // String constants - private static final String PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String BROWSE = LABEL + ".browse"; //$NON-NLS-1$ - - /** + private static final String PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$ + private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ + private static final String BROWSE = LABEL + ".browse"; //$NON-NLS-1$ + private static final String HIDE = "hideAdvanced"; //$NON-NLS-1$ + private static final String SHOW = "showAdvanced"; //$NON-NLS-1$ + private static final String EMPTY = "NewFolderDialog.folderNameEmpty"; //$NON-NLS-1$ + + /* (non-Javadoc) * The title of the dialog. */ private String title = ""; - /** + /* (non-Javadoc) * The message to display, or null if none. */ private String message = ""; - /** + /* (non-Javadoc) * The input value; the empty string by default. */ - private String value = ""; - - /** - * Error message label widget. + private String folderName = ""; + + /* (non-Javadoc) + * */ - private Label errorMessageLabel; + private int basicShellHeight; + + /* (non-Javadoc) + * + */ +// private CreateLinkedResourceGroup linkedResourceGroup; // Widgets - private Button btnBrowse = null; - private Button btnOK = null; + private Button advancedButton = null; + private Button browseButton = null; + private Label errorMessageLabel; + private Composite macroComposite; private Text text = null; /** - * Creates an input dialog with OK, Cancel, and a Browse button. + * Creates an input dialog with OK, Cancel, a Browse button and a button to + * reveal path macros. * - * @param shell the parent shell - * @param dialogTitle the title of the dialog or null if none - * @param dialogMessage the dialog message, or null if none - * @param initialValue the initial input value, or null if none - * (equivalent to the empty string) + * @param shell + * the parent shell + * @param dialogTitle + * the title of the dialog or null if none + * @param dialogMessage + * the dialog message, or null if none + * @param initialValue + * the initial input value, or null if none + * (equivalent to the empty string) */ public BrowseEntryDialog(Shell shell, String dialogTitle, String dialogMessage, String initialValue) { super(shell); @@ -81,105 +110,228 @@ public class BrowseEntryDialog extends Dialog { } // Value for the text widget if (initialValue != null) { - value = initialValue; + folderName = initialValue; } + setStatusLineAboveButtons(true); } /* (non-Javadoc) - * Method declared on Dialog. + * @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#computeResult() */ - protected void buttonPressed(int buttonId) { - if (buttonId == IDialogConstants.OK_ID) { - value = text.getText().trim(); - } else { - value = null; - } - super.buttonPressed(buttonId); + protected void computeResult() { + // TODO Auto-generated method stub + } /* (non-Javadoc) - * Method declared in Window. + * @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#configureShell(org.eclipse.swt.widgets.Shell) */ protected void configureShell(Shell shell) { super.configureShell(shell); - if (title != null) + // Set the display title the user has specified + if (title != null) { shell.setText(title); - } - - protected Control createDialogArea(Composite parent) { - Composite composite = ControlFactory.createComposite(parent, 4); - - // Create the label - if (message != null) { - Label label = new Label(composite, SWT.WRAP); - label.setText(message); - GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); - gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); - gd.horizontalSpan = 4; - label.setLayoutData(gd); - label.setFont(parent.getFont()); } - - text = new Text(composite, SWT.SINGLE | SWT.BORDER); - GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 3; - text.setLayoutData(gd); - text.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateButtonState(); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#create() + */ + public void create() { + // Disable the OK button to start + super.create(); + getButton(IDialogConstants.OK_ID).setEnabled(false); + } + + /* (non-Javadoc) + * + * @param parent + */ + private void createAdvancedBrowseArea(Composite parent) { + // Instantiate the macros button + advancedButton = new Button(parent, SWT.PUSH); + applyDialogFont(advancedButton); + advancedButton.setText(IDEWorkbenchMessages.getString(SHOW)); + setButtonLayoutData(advancedButton); + GridData data = (GridData) advancedButton.getLayoutData(); + data.horizontalAlignment = GridData.BEGINNING; + advancedButton.setLayoutData(data); + advancedButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleAdvancedPressed(); + } + }); + advancedButton.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + advancedButton = null; } }); - // Instantiate the browse button - btnBrowse = ControlFactory.createPushButton(composite, ManagedBuilderUIPlugin.getResourceString(BROWSE)); - setButtonLayoutData(btnBrowse); - btnBrowse.addSelectionListener(new SelectionAdapter () { +// linkedResourceGroup = new CreateLinkedResourceGroup( +// IResource.FOLDER, +// new Listener(){ +// public void handleEvent(Event event) { +// // TODO Auto-generated method stub +// +// } +// }); + } + + /* (non-Javadoc) + * + * @param parent + */ + private void createBasicBrowseArea(Composite parent) { + Composite basicGroup = new Composite(parent, SWT.NONE); + basicGroup.setLayout(new GridLayout(2, false)); + basicGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + GridData data; + // Create the label + if (message != null) { + Label label = new Label(basicGroup, SWT.WRAP); + label.setText(message); + data = new GridData( + GridData.FILL_HORIZONTAL | + GridData.GRAB_VERTICAL | + GridData.VERTICAL_ALIGN_BEGINNING); + data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); + data.horizontalSpan = 2; + label.setLayoutData(data); + applyDialogFont(label); + } + + // Entry widget next + text = new Text(basicGroup, SWT.SINGLE | SWT.BORDER); + data = new GridData(GridData.FILL_BOTH); + data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; + text.setLayoutData(data); + text.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + validateLocation(); + } + }); + applyDialogFont(text); + + // Finally make the browse button + browseButton = new Button(basicGroup, SWT.PUSH); + applyDialogFont(browseButton); + browseButton.setText(ManagedBuilderUIPlugin.getResourceString(BROWSE)); + setButtonLayoutData(browseButton); + data = (GridData) browseButton.getLayoutData(); + data.horizontalAlignment = GridData.BEGINNING; + browseButton.setLayoutData(data); + browseButton.addSelectionListener(new SelectionAdapter () { public void widgetSelected(SelectionEvent e) { handleBrowsePressed(); } }); + browseButton.addDisposeListener(new DisposeListener () { + public void widgetDisposed(DisposeEvent e) { + browseButton = null; + } + }); + } + protected Control createDialogArea(Composite parent) { + Composite composite = (Composite) super.createDialogArea(parent); + composite.setLayout(new GridLayout()); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + createBasicBrowseArea(composite); + createAdvancedBrowseArea(composite); + return composite; } - protected void createButtonsForButtonBar(Composite parent) { - // create OK and Cancel buttons by default - btnOK = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); + /** + * Answers the value the user has entered in the selection dialog. + * + *

The selection will be a folder location specified in the format appropriate + * for the platform that Eclipse is running on, i.e. C:\foo\mydir + * for Windows platforms and /foo/mydir on POSIX platforms. + * + *

The answer may also contain a path variable as a component of the location. It + * is the responsibility of the client to properly handle this situation. + * + * @return String + */ + public String getValue() { + return folderName; + } - text.setFocus(); - if (value != null) { - text.setText(value); + /* (non-Javadoc) + * Shows/hides the path macro widgets. + */ + protected void handleAdvancedPressed() { + Shell shell = getShell(); + Point shellSize = shell.getSize(); + + if (macroComposite == null) { + basicShellHeight = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; + Composite composite = (Composite) getDialogArea(); +// macroComposite = linkedResourceGroup.createContents(composite); + macroComposite = ControlFactory.createComposite(composite, 1); + shellSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); + shell.setSize(shellSize); + advancedButton.setText(IDEWorkbenchMessages.getString(HIDE)); + } else if (macroComposite.getVisible()) { + macroComposite.setVisible(false); + shell.setSize(shellSize.x, basicShellHeight); + advancedButton.setText(IDEWorkbenchMessages.getString(SHOW)); + } else { + macroComposite.setVisible(true); + shellSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); + shell.setSize(shellSize); + advancedButton.setText(IDEWorkbenchMessages.getString(HIDE)); } - updateButtonState(); + } - - protected String getValue() { - return value; - } - + + /* (non-Javadoc) + * + */ protected void handleBrowsePressed() { - // Popup a file browser widget - DirectoryDialog dialog = new DirectoryDialog(getShell()); - // Create a hint if text widget contains value - String widgetText; - if ((widgetText = text.getText().trim()).length() > 0) { - dialog.setFilterPath(widgetText); - } - // Open the selection dialog and populate the widget - String directory; - if ((directory = dialog.open()) != null) { - /* - * TODO: Convert the dialog to the proper format for platform (i.e. - * if platform.pathStyle == Platform.POSIX then swap \\ to / ) - */ - text.setText(directory.trim()); - updateButtonState(); - } + // TODO Auto-generated method stub + } - protected void updateButtonState() { - if (btnOK != null) - btnOK.setEnabled(text.getText().trim().length() > 0); + /* (non-Javadoc) + * Utility method to send a status message to the status line of the dialog. + * + * @param severity + * @param message + */ + private void updateStatus(int severity, String message) { + updateStatus(new Status(severity, ManagedBuilderCorePlugin.getUniqueIdentifier(), severity, message, null)); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#updateStatus(org.eclipse.core.runtime.IStatus) + */ + protected void updateStatus(IStatus status) { + // TODO Auto-generated method stub + super.updateStatus(status); + } + + /** + * + */ + protected void validateLocation() { + folderName = text.getText(); + // Empty or null string is invalid + if (folderName == null || folderName.equals("")) { + updateStatus(IStatus.ERROR, IDEWorkbenchMessages.getString(EMPTY)); + return; + } else { + // Make sure that the specified location exists + IPath path = new Path(folderName); + if (!path.isValidPath(folderName)) { + updateStatus(IStatus.ERROR, "Folder name invalid"); + return; + } + } + updateStatus(IStatus.OK, ""); //$NON-NLS-1$ + getButton(IDialogConstants.OK_ID).setEnabled(true); } } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java index 22e80dc56e1..5554af61125 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java @@ -1,7 +1,7 @@ package org.eclipse.cdt.managedbuilder.ui.properties; /********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. + * Copyright (c) 2002,2004 Rational Software Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at @@ -43,13 +43,6 @@ public class BuildOptionListFieldEditor extends FieldEditor { private static final String DOWN = "BuildPropertyCommon.label.down"; //$NON-NLS-1$ private static final String EDIT = "BuildPropertyCommon.label.editVar"; //$NON-NLS-1$ - // UI constants - private static final int VERTICAL_DIALOG_UNITS_PER_CHAR = 8; - private static final int HORIZONTAL_DIALOG_UNITS_PER_CHAR = 4; - private static final int LIST_HEIGHT_IN_CHARS = 10; - private static final int LIST_HEIGHT_IN_DLUS = - LIST_HEIGHT_IN_CHARS * VERTICAL_DIALOG_UNITS_PER_CHAR; - // The top-level control for the field editor. private Composite top; // The list of tags. @@ -171,14 +164,6 @@ public class BuildOptionListFieldEditor extends FieldEditor { // Make the list list = new List(controlGroup, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - - // Create a grid data that takes up the extra space in the dialog and spans one column. - GridData listData = new GridData(GridData.FILL_HORIZONTAL); - listData.heightHint = - convertVerticalDLUsToPixels(list, LIST_HEIGHT_IN_DLUS); - listData.horizontalSpan = 1; - - list.setLayoutData(listData); list.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { selectionChanged(); @@ -222,6 +207,12 @@ public class BuildOptionListFieldEditor extends FieldEditor { // Create the buttons createButtons(buttonGroup); + + // Create a grid data that takes up the extra space in the dialog and spans one column. + GridData listData = new GridData(GridData.FILL_HORIZONTAL); + listData.heightHint = buttonGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; + listData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; + list.setLayoutData(listData); } /* (non-Javadoc) @@ -329,9 +320,11 @@ public class BuildOptionListFieldEditor extends FieldEditor { protected String getNewInputObject() { // Create a dialog to prompt for a new symbol or path InputDialog dialog = new InputDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, new String(), null); +// BrowseEntryDialog dialog = new BrowseEntryDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, new String()); String input = new String(); if (dialog.open() == InputDialog.OK) { - input = dialog.getValue(); +// if (dialog.open() == BrowseEntryDialog.OK) { + input = dialog.getValue(); } return input; } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java index b317069dc04..232e97e4999 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java @@ -1,7 +1,7 @@ package org.eclipse.cdt.managedbuilder.ui.properties; /********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. + * Copyright (c) 2002,2004 Rational Software Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at @@ -446,7 +446,11 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert // Get the build output name String newBuildOutput = manageDialog.getBuildArtifactName(); if (!selectedTarget.getArtifactName().equals(newBuildOutput)) { - selectedTarget.setBuildArtifact(newBuildOutput); + selectedTarget.setArtifactName(newBuildOutput); + } + String newBuildExt = manageDialog.getBuildArtifaceExtension(); + if (!selectedTarget.getArtifactExtension().equals(newBuildExt)) { + selectedTarget.setArtifactExtension(newBuildExt); } // Get the new make command diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java index ddad7215c23..9216b15ab9c 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java @@ -1,7 +1,7 @@ package org.eclipse.cdt.managedbuilder.ui.properties; /********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. + * Copyright (c) 2002,2004 Rational Software Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at @@ -19,7 +19,6 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.ITarget; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.core.resources.IProject; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; @@ -29,6 +28,7 @@ import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -50,14 +50,16 @@ public class ManageConfigDialog extends Dialog { private static final String GROUP = LABEL + ".makecmdgroup"; //$NON-NLS-1$ private static final String DEF_BTN = LABEL + ".makecmddef"; //$NON-NLS-1$ private static final String OUTPUT_GROUP = LABEL + ".output.group"; //$NON-NLS-1$ - private static final String OUTPUT_LABEL = LABEL + ".output.label"; //$NON-NLS-1$ + private static final String OUTPUT_EXT = LABEL + ".output.extension"; //$NON-NLS-1$ + private static final String OUTPUT_NAME = LABEL + ".output.name"; //$NON-NLS-1$ private static final String CONFIGS = LABEL + ".configs"; //$NON-NLS-1$ private static final String CURRENT_CONFIGS = CONFIGS + ".current"; //$NON-NLS-1$ private static final String DELETED_CONFIGS = CONFIGS + ".deleted"; //$NON-NLS-1$ private static final String CONF_DLG = LABEL + ".new.config.dialog"; //$NON-NLS-1$ // The name of the build artifact - private String buildArtifact; + private String artifactExt; + private String artifactName; // The list of configurations to delete private SortedMap deletedConfigs; // Map of configuration names and ids @@ -74,7 +76,8 @@ public class ManageConfigDialog extends Dialog { private boolean useDefaultMake; // Widgets - protected Text buildArtifactEntry; + protected Text buildArtifactExt; + protected Text buildArtifactName; protected List currentConfigList; protected List deletedConfigList; protected Button makeCommandDefault; @@ -96,7 +99,8 @@ public class ManageConfigDialog extends Dialog { makeCommand = managedTarget.getMakeCommand(); // Get the name of the build artifact - buildArtifact = managedTarget.getArtifactName(); + artifactExt = managedTarget.getArtifactExtension(); + artifactName = managedTarget.getArtifactName(); // Get the defined configurations from the target getExistingConfigs().clear(); @@ -117,16 +121,17 @@ public class ManageConfigDialog extends Dialog { if (buttonId == IDialogConstants.OK_ID) { useDefaultMake = makeCommandDefault.getSelection(); makeCommand = makeCommandEntry.getText().trim(); - buildArtifact = buildArtifactEntry.getText().trim(); + artifactName = buildArtifactName.getText().trim(); + artifactExt = buildArtifactExt.getText().trim(); } else { useDefaultMake = true; - buildArtifact = managedTarget.getArtifactName(); + artifactName = managedTarget.getArtifactName(); } super.buttonPressed(buttonId); } /* (non-Javadoc) - * Method declared in Window. + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) */ protected void configureShell(Shell shell) { super.configureShell(shell); @@ -134,6 +139,65 @@ public class ManageConfigDialog extends Dialog { shell.setText(title); } + /* (non-Javadoc) + * Creates the group that contains the build artifact name controls. + */ + private void createBuildArtifactGroup(Composite parent) { + final Group outputGroup = new Group(parent, SWT.NONE); + outputGroup.setFont(parent.getFont()); + outputGroup.setText(ManagedBuilderUIPlugin.getResourceString(OUTPUT_GROUP)); + outputGroup.setLayout(new GridLayout(3, false)); + outputGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + // Three labels + final Label nameLabel = new Label(outputGroup, SWT.LEFT); + nameLabel.setFont(outputGroup.getFont()); + nameLabel.setText(ManagedBuilderUIPlugin.getResourceString(OUTPUT_NAME)); + nameLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + final Label placeHolder = new Label(outputGroup, SWT.CENTER); + placeHolder.setText(new String()); + placeHolder.setLayoutData(new GridData()); + + final Label extLabel = new Label(outputGroup, SWT.LEFT); + extLabel.setFont(outputGroup.getFont()); + extLabel.setText(ManagedBuilderUIPlugin.getResourceString(OUTPUT_EXT)); + extLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + // Now we need two text widgets separated by a label + buildArtifactName = new Text(outputGroup, SWT.SINGLE | SWT.BORDER); + buildArtifactName.setFont(outputGroup.getFont()); + buildArtifactName.setText(artifactName); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; + buildArtifactName.setLayoutData(data); + buildArtifactName.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent event) { + buildArtifactName = null; + } + }); + + final Label dotLabel = new Label(outputGroup, SWT.CENTER); + dotLabel.setFont(outputGroup.getFont()); + dotLabel.setText(new String(".")); + dotLabel.setLayoutData(new GridData()); + + buildArtifactExt = new Text(outputGroup, SWT.SINGLE | SWT.BORDER); + buildArtifactExt.setFont(outputGroup.getFont()); + buildArtifactExt.setText(artifactExt); + data = new GridData(GridData.FILL_HORIZONTAL); + data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; + buildArtifactExt.setLayoutData(data); + buildArtifactExt.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + buildArtifactExt = null; + } + }); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) + */ protected void createButtonsForButtonBar(Composite parent) { // create OK and Cancel buttons by default okBtn = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); @@ -142,71 +206,40 @@ public class ManageConfigDialog extends Dialog { updateButtons(); } - protected Control createDialogArea(Composite parent) { - Composite comp = ControlFactory.createComposite(parent, 1); - - // Create a group for the build output - Group outputGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(OUTPUT_GROUP), 1); - outputGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); - Label outputLabel = ControlFactory.createLabel(outputGroup, ManagedBuilderUIPlugin.getResourceString(OUTPUT_LABEL)); - outputLabel.setLayoutData(new GridData()); - buildArtifactEntry = ControlFactory.createTextField(outputGroup); - buildArtifactEntry.setText(buildArtifact); - buildArtifactEntry.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - buildArtifactEntry = null; - } - }); - - // Create the make command group area - Group makeCommandGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(GROUP), 1); - GridData gd = new GridData(GridData.FILL_BOTH); - makeCommandGroup.setLayoutData(gd); - makeCommandDefault = ControlFactory.createCheckBox(makeCommandGroup, ManagedBuilderUIPlugin.getResourceString(DEF_BTN)); - setButtonLayoutData(makeCommandDefault); - makeCommandDefault.setSelection(!managedTarget.hasOverridenMakeCommand()); - makeCommandDefault.addSelectionListener(new SelectionAdapter () { - public void widgetSelected(SelectionEvent e) { - handleUseDefaultPressed(); - } - }); - makeCommandDefault.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - makeCommandDefault = null; - } - }); - makeCommandEntry = ControlFactory.createTextField(makeCommandGroup); - makeCommandEntry.setEditable(!makeCommandDefault.getSelection()); - makeCommandEntry.setText(makeCommand); - makeCommandEntry.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - makeCommandEntry = null; - } - }); - - + /* (non-Javadoc) + * Create and lays out the group with the configuration edit controls + */ + private void createConfigListGroup(Composite parent) { // Create the config list group area - Group configListGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(CONFIGS), 3); - gd = new GridData(GridData.FILL_BOTH); - configListGroup.setLayoutData(gd); + final Group configListGroup = new Group(parent, SWT.NONE); + configListGroup.setFont(parent.getFont()); + configListGroup.setText(ManagedBuilderUIPlugin.getResourceString(CONFIGS)); + configListGroup.setLayout(new GridLayout(3, false)); + configListGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); // Create the 2 labels first to align the buttons and list controls - Label currentConfigLabel = ControlFactory.createLabel(configListGroup, ManagedBuilderUIPlugin.getResourceString(CURRENT_CONFIGS)); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - currentConfigLabel.setLayoutData(gd); - Label deletedConfigLabel = ControlFactory.createLabel(configListGroup, ManagedBuilderUIPlugin.getResourceString(DELETED_CONFIGS)); + final Label currentConfigLabel = new Label(configListGroup, SWT.LEFT); + currentConfigLabel.setFont(configListGroup.getFont()); + currentConfigLabel.setText(ManagedBuilderUIPlugin.getResourceString(CURRENT_CONFIGS)); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + data.horizontalSpan = 2; + currentConfigLabel.setLayoutData(data); + final Label deletedConfigLabel = new Label(configListGroup, SWT.LEFT); + deletedConfigLabel.setFont(configListGroup.getFont()); + deletedConfigLabel.setText(ManagedBuilderUIPlugin.getResourceString(DELETED_CONFIGS)); deletedConfigLabel.setLayoutData(new GridData()); // Create the current config list - Composite currentComp = ControlFactory.createComposite(configListGroup, 1); - gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 1; - currentComp.setLayoutData(gd); + final Composite currentComp = new Composite(configListGroup, SWT.NULL); + currentComp.setFont(configListGroup.getFont()); + currentComp.setLayout(new GridLayout(1, true)); + currentComp.setLayoutData(new GridData(GridData.FILL_BOTH)); + currentConfigList = new List(currentComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); - gd = new GridData(GridData.FILL_BOTH); - gd.widthHint = 100; - currentConfigList.setLayoutData(gd); + currentConfigList.setFont(currentComp.getFont()); + data = new GridData(GridData.FILL_BOTH); + data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; + currentConfigList.setLayoutData(data); currentConfigList.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent event) { currentConfigList = null; @@ -214,10 +247,14 @@ public class ManageConfigDialog extends Dialog { }); // Create a composite for the buttons - Composite buttonBar = ControlFactory.createComposite(configListGroup, 1); - buttonBar.setLayoutData(new GridData()); + final Composite buttonBar = new Composite(configListGroup, SWT.NULL); + buttonBar.setFont(configListGroup.getFont()); + buttonBar.setLayout(new GridLayout(1, true)); + buttonBar.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - newBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(NEW)); + newBtn = new Button(buttonBar, SWT.PUSH); + newBtn.setFont(buttonBar.getFont()); + newBtn.setText(ManagedBuilderUIPlugin.getResourceString(NEW)); setButtonLayoutData(newBtn); newBtn.addSelectionListener(new SelectionAdapter () { public void widgetSelected(SelectionEvent e) { @@ -229,7 +266,10 @@ public class ManageConfigDialog extends Dialog { newBtn = null; } }); - removeBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(REMOVE)); + + removeBtn = new Button(buttonBar, SWT.PUSH); + removeBtn.setFont(buttonBar.getFont()); + removeBtn.setText(ManagedBuilderUIPlugin.getResourceString(REMOVE)); setButtonLayoutData(removeBtn); removeBtn.addSelectionListener(new SelectionAdapter () { public void widgetSelected(SelectionEvent e) { @@ -241,7 +281,10 @@ public class ManageConfigDialog extends Dialog { removeBtn = null; } }); - restoreBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(RESTORE)); + + restoreBtn = new Button(buttonBar, SWT.PUSH); + restoreBtn.setFont(buttonBar.getFont()); + restoreBtn.setText(ManagedBuilderUIPlugin.getResourceString(RESTORE)); setButtonLayoutData(restoreBtn); restoreBtn.addSelectionListener(new SelectionAdapter () { public void widgetSelected(SelectionEvent e) { @@ -255,42 +298,104 @@ public class ManageConfigDialog extends Dialog { }); // Create the deleted config list - Composite deletedComp = ControlFactory.createComposite(configListGroup, 1); - gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 1; - deletedComp.setLayoutData(gd); + final Composite deletedComp = new Composite(configListGroup, SWT.NULL); + deletedComp.setFont(configListGroup.getFont()); + deletedComp.setLayout(new GridLayout(1, true)); + deletedComp.setLayoutData(new GridData(GridData.FILL_BOTH)); + deletedConfigList = new List(deletedComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); - gd = new GridData(GridData.FILL_BOTH); - gd.widthHint = 100; - deletedConfigList.setLayoutData(gd); + deletedConfigList.setFont(deletedComp.getFont()); + data = new GridData(GridData.FILL_BOTH); + data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; + deletedConfigList.setLayoutData(data); deletedConfigList.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent event) { deletedConfigList = null; } }); - + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + protected Control createDialogArea(Composite parent) { + Composite comp = new Composite(parent, SWT.NULL); + comp.setFont(parent.getFont()); + comp.setLayout(new GridLayout(1, true)); + comp.setLayoutData(new GridData(GridData.FILL_BOTH)); + + // Create a group for the build output + createBuildArtifactGroup(comp); + + // Create the make command group area + createMakeCommandGroup(comp); + + // Make the configuration management area + createConfigListGroup(comp); + // Do the final widget prep currentConfigList.setItems(getConfigurationNames()); currentConfigList.select(0); newBtn.setFocus(); return comp; } + + /* (non-Javadoc) + * Creates the group control for the make command + * @param parent + */ + private void createMakeCommandGroup(Composite parent) { + final Group makeCommandGroup = new Group(parent, SWT.NONE); + makeCommandGroup.setFont(parent.getFont()); + makeCommandGroup.setText(ManagedBuilderUIPlugin.getResourceString(GROUP)); + makeCommandGroup.setLayout(new GridLayout(1, true)); + makeCommandGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + makeCommandDefault = new Button(makeCommandGroup, SWT.CHECK | SWT.LEFT); + makeCommandDefault.setFont(makeCommandGroup.getFont()); + makeCommandDefault.setText(ManagedBuilderUIPlugin.getResourceString(DEF_BTN)); + setButtonLayoutData(makeCommandDefault); + makeCommandDefault.setBackground(makeCommandGroup.getBackground()); + makeCommandDefault.setForeground(makeCommandGroup.getForeground()); + makeCommandDefault.setSelection(!managedTarget.hasOverridenMakeCommand()); + makeCommandDefault.addSelectionListener(new SelectionAdapter () { + public void widgetSelected(SelectionEvent e) { + handleUseDefaultPressed(); + } + }); + makeCommandDefault.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent event) { + makeCommandDefault = null; + } + }); + + makeCommandEntry = new Text(makeCommandGroup, SWT.SINGLE | SWT.BORDER); + makeCommandEntry.setFont(makeCommandGroup.getFont()); + makeCommandEntry.setEditable(!makeCommandDefault.getSelection()); + makeCommandEntry.setText(makeCommand); + makeCommandEntry.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + makeCommandEntry.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent event) { + makeCommandEntry = null; + } + }); + } /** - * + * Answers the extension for the build artifact. + * @return */ - protected void handleUseDefaultPressed() { - // If the state of the button is unchecked, then we want to enable the edit widget - makeCommandEntry.setEditable(!makeCommandDefault.getSelection()); + public String getBuildArtifaceExtension() { + return artifactExt; } - + /** * Answers the value in the build artifact entry widget. * * @return */ public String getBuildArtifactName() { - return buildArtifact; + return artifactName; } private String [] getConfigurationNames() { @@ -453,6 +558,14 @@ public class ManageConfigDialog extends Dialog { } } + /* (non-Javadoc) + * Event handler for the use default check box in the make command group + */ + protected void handleUseDefaultPressed() { + // If the state of the button is unchecked, then we want to enable the edit widget + makeCommandEntry.setEditable(!makeCommandDefault.getSelection()); + } + private void updateButtons() { // Disable the remove button if there is only 1 configuration removeBtn.setEnabled(currentConfigList.getItemCount() > 1); @@ -460,6 +573,10 @@ public class ManageConfigDialog extends Dialog { restoreBtn.setEnabled(deletedConfigList.getItemCount() > 0); } + /** + * Answers true if the user has left the use default check box selected. + * @return + */ public boolean useDefaultMakeCommand () { return useDefaultMake; } diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java index 968f821f726..12bd204a2a3 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java @@ -1,7 +1,7 @@ package org.eclipse.cdt.managedbuilder.ui.wizards; /********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. + * Copyright (c) 2002,2004 Rational Software Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at @@ -111,8 +111,7 @@ public class NewManagedProjectWizard extends NewCProjectWizard { newTarget = ManagedBuildManager.createTarget(newProject, parent); if (newTarget != null) { String artifactName = newProject.getName(); - artifactName += parent.getDefaultExtension().length() == 0 ? "" : "." + parent.getDefaultExtension(); - newTarget.setBuildArtifact(artifactName); + newTarget.setArtifactName(artifactName); IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations(); Random r = new Random(); r.setSeed(System.currentTimeMillis());