Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDoug Schaefer2003-09-24 14:20:49 +0000
committerDoug Schaefer2003-09-24 14:20:49 +0000
commite09b94f945a1f60ed6ae4684263bbcff69ac9a60 (patch)
tree644ea22aa3443dd9b51a5550d3fa804a61812ab3 /build
parentec1f9424bbce5154839a5df7900cadf5bbc2942e (diff)
downloadorg.eclipse.cdt-e09b94f945a1f60ed6ae4684263bbcff69ac9a60.tar.gz
org.eclipse.cdt-e09b94f945a1f60ed6ae4684263bbcff69ac9a60.tar.xz
org.eclipse.cdt-e09b94f945a1f60ed6ae4684263bbcff69ac9a60.zip
Patch for Sean Evoy:
This patch adds a "hook" for F1 help on the new managed project wizard configuration selection page. It also adds functionality to the managed build project property page to allow the user to edit the make command and build artifact name. They can also add and delete configurations from a target. There is no support for adding another target to a project in this release.
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/ChangeLog10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java38
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java86
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/ChangeLog22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.properties4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml64
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java86
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java354
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java15
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java9
13 files changed, 615 insertions, 117 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
index 55e3d673bab..22ec15c7bfa 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
@@ -1,3 +1,13 @@
+2003-09-23 Sean Evoy
+ All the work in this patch is for critical bug 43292. In order to manage
+ configurations, there had to be a method through ITarget to remove
+ configurations. Also, to support the naming of newly created configurations,
+ I added a name method to the IConfiguration interface. Finally, the ITarget
+ needed to support setting (and resetting) the make command to use when building.
+ * src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
+ * src/org/eclipse/cdt/managedbuilder/core/ITarget.java
+ * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+
2003-09-19 Sean Evoy
Added a new field to the target specification in the build model to
hard-code the binary parser for project creation. There is a new getter
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
index 24478ebd8e9..840b3d80e49 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
@@ -46,6 +46,13 @@ public interface IConfiguration extends IBuildObject {
public ITool[] getTools();
/**
+ * Sets the name of the receiver to the value specified in the argument
+ *
+ * @param name
+ */
+ public void setName(String name);
+
+ /**
* Sets the value of a boolean option for this configuration.
*
* @param option The option to change.
@@ -72,4 +79,5 @@ public interface IConfiguration extends IBuildObject {
*/
public void setOption(IOption option, String[] value)
throws BuildException;
+
}
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 4f7f11be028..010a97db574 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
@@ -33,8 +33,8 @@ public interface ITarget extends IBuildObject {
* change in the parent, unoverridden values are updated in the child
* config as well.
*
- * @param parent
- * @param id
+ * @param parent The <code>IConfiguration</code> to use as a settings template
+ * @param id The unique id the new configuration will have
* @return
*/
public IConfiguration createConfiguration(IConfiguration parent, String id);
@@ -91,7 +91,7 @@ public interface ITarget extends IBuildObject {
public String getMakeCommand();
/**
- * Returns the configuration with the given id, or null if not found.
+ * Returns the configuration with the given id, or <code>null</code> if not found.
*
* @param id
* @return
@@ -118,6 +118,15 @@ public interface ITarget extends IBuildObject {
*/
public ITool[] getTools();
+
+ /**
+ * Answers true if the receiver has a make command that differs from its
+ * parent specification.
+ *
+ * @return
+ */
+ public boolean hasOverridenMakeCommand();
+
/**
* Returns whether this target is abstract.
* @return
@@ -134,12 +143,31 @@ public interface ITarget extends IBuildObject {
public boolean isTestTarget();
/**
+ * Removes the configuration with the ID specified in the argument.
+ *
+ * @param id
+ */
+ public void removeConfiguration(String id);
+
+ /**
+ * Resets the make command in the receiver to the value specified in
+ * its parent.
+ *
+ */
+ public void resetMakeCommand();
+
+ /**
* Set the name of the artifact that will be produced when the receiver
* is built.
*
- * @param name The name of the build artifact.
+ * @param name
*/
public void setBuildArtifact(String name);
-
+ /**
+ * Sets the make command for the receiver to the value in the argument.
+ *
+ * @param command
+ */
+ public void setMakeCommand(String command);
}
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 27b51690f84..a40912c2b60 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,3 +1,5 @@
+package org.eclipse.cdt.managedbuilder.internal.core;
+
/**********************************************************************
* Copyright (c) 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
@@ -8,10 +10,10 @@
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
-package org.eclipse.cdt.managedbuilder.internal.core;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -26,11 +28,9 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-/**
- *
- */
public class Target extends BuildObject implements ITarget {
+ // Build model elements that come from the plugin or project files
private String artifactName;
private String binaryParserId;
private String cleanCommand;
@@ -71,7 +71,6 @@ public class Target extends BuildObject implements ITarget {
this.defaultExtension = parent.getDefaultExtension();
this.isTest = parent.isTestTarget();
this.cleanCommand = parent.getCleanCommand();
- this.makeCommand = parent.getMakeCommand();
// Hook me up
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner, true);
@@ -190,7 +189,9 @@ public class Target extends BuildObject implements ITarget {
cleanCommand = element.getAttribute(CLEAN_COMMAND);
// Get the make command
- makeCommand = element.getAttribute(MAKE_COMMAND);
+ if (element.hasAttribute(MAKE_COMMAND)) {
+ makeCommand = element.getAttribute(MAKE_COMMAND);
+ }
Node child = element.getFirstChild();
while (child != null) {
@@ -201,6 +202,29 @@ public class Target extends BuildObject implements ITarget {
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#removeConfiguration(java.lang.String)
+ */
+ public void removeConfiguration(String id) {
+ // Remove the specified configuration from the list and map
+ Iterator iter = configurations.listIterator();
+ while (iter.hasNext()) {
+ IConfiguration config = (IConfiguration)iter.next();
+ if (config.getId().equals(id)) {
+ configurations.remove(config);
+ configMap.remove(id);
+ break;
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#resetMakeCommand()
+ */
+ public void resetMakeCommand() {
+ makeCommand = null;
+ }
+
/**
* Persist receiver to project file.
*
@@ -218,7 +242,9 @@ public class Target extends BuildObject implements ITarget {
element.setAttribute(DEFAULT_EXTENSION, getDefaultExtension());
element.setAttribute(IS_TEST, isTest ? "true" : "false");
element.setAttribute(CLEAN_COMMAND, getCleanCommand());
- element.setAttribute(MAKE_COMMAND, getMakeCommand());
+ if (makeCommand != null) {
+ element.setAttribute(MAKE_COMMAND, makeCommand);
+ }
if (configurations != null)
for (int i = 0; i < configurations.size(); ++i) {
@@ -234,17 +260,26 @@ public class Target extends BuildObject implements ITarget {
*/
public String getMakeCommand() {
// Return the name of the make utility
- return makeCommand == null ? EMPTY_STRING : makeCommand;
+ return (makeCommand == null) ? parent.getMakeCommand() : makeCommand;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
+ */
public String getName() {
return (name == null && parent != null) ? parent.getName() : name;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#getParent()
+ */
public ITarget getParent() {
return parent;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#getOwner()
+ */
public IResource getOwner() {
return owner;
}
@@ -269,12 +304,26 @@ public class Target extends BuildObject implements ITarget {
return n;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#getTools()
+ */
public ITool[] getTools() {
ITool[] toolArray = new ITool[getNumTools()];
addToolsToArray(toolArray, 0);
return toolArray;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#hasMakeCommandOverride()
+ */
+ public boolean hasOverridenMakeCommand() {
+ return (makeCommand != null && !makeCommand.equals(parent.getMakeCommand()));
+ }
+
+ /**
+ * @param id
+ * @return
+ */
public ITool getTool(String id) {
ITool result = null;
// See if receiver has it in list
@@ -286,6 +335,9 @@ public class Target extends BuildObject implements ITarget {
return result;
}
+ /**
+ * @param tool
+ */
public void addTool(ITool tool) {
if (tools == null) {
tools = new ArrayList();
@@ -296,6 +348,9 @@ public class Target extends BuildObject implements ITarget {
toolMap.put(tool.getId(), tool);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#getConfigurations()
+ */
public IConfiguration[] getConfigurations() {
if (configurations != null)
return (IConfiguration[])configurations.toArray(new IConfiguration[configurations.size()]);
@@ -340,6 +395,9 @@ public class Target extends BuildObject implements ITarget {
return (IConfiguration)configMap.get(id);
}
+ /**
+ * @param configuration
+ */
public void addConfiguration(IConfiguration configuration) {
if (configurations == null) {
configurations = new ArrayList();
@@ -381,8 +439,18 @@ public class Target extends BuildObject implements ITarget {
* @see org.eclipse.cdt.core.build.managed.ITarget#setBuildArtifact(java.lang.String)
*/
public void setBuildArtifact(String name) {
- artifactName = name;
+ if (name != null) {
+ artifactName = name;
+ }
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#setMakeCommand(java.lang.String)
+ */
+ public void setMakeCommand(String command) {
+ if (command != null && !getMakeCommand().equals(command)) {
+ makeCommand = command;
+ }
+ }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
index 7ca161b10ad..98cbb16ca00 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
@@ -1,3 +1,25 @@
+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.
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
index b8dfd060f59..bff79be6a1e 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
@@ -22,3 +22,7 @@ OptionCategory.Debug=Debugging
OptionCategory.Warn=Warnings
OptionCategory.Misc=Miscellaneous
OptionCategory.Libs=Libraries
+Option.Posix.PreprocOnly=Preprocess only (-E)
+Option.Posix.DefSym=Defined symbols (-D)
+Option.Posix.Libs=Libraries (-l)
+Option.Posix.Libsearch=Library search path (-L)
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index cf08589e7d2..95183810699 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -96,7 +96,7 @@
</option>
<option
defaultValue="false"
- name="Preprocess only (-E)"
+ name="%Option.Posix.PreprocOnly"
category="cygwin.compiler.category.preprocessor"
command="-E"
valueType="boolean"
@@ -115,7 +115,7 @@
id="cygwin.gnu.compiler.category.symbols">
</optionCategory>
<option
- name="Defined symbols (-D)"
+ name="%Option.Posix.DefSym"
category="cygwin.gnu.compiler.category.symbols"
command="-D"
valueType="definedSymbols"
@@ -338,14 +338,14 @@
id="cygwin.link.ld.flags">
</option>
<option
- name="Libraries"
+ name="%Option.Posix.Libs"
category="cygwin.linker.category.general"
command="-l"
valueType="libs"
id="cygwin.link.libs">
</option>
<option
- name="Library Paths"
+ name="%Option.Posix.Libsearch"
category="cygwin.linker.category.general"
command="-L"
valueType="stringList"
@@ -389,19 +389,19 @@
id="cygwin.solink.ld.flags">
</option>
<option
- name="Library Paths"
- category="cygwin.solink.category.general"
- command="-L"
- valueType="stringList"
- id="cygwin.solink.ld.paths">
- </option>
- <option
- name="Libraries"
+ name="%Option.Posix.Libs"
category="cygwin.solink.category.general"
command="-l"
valueType="libs"
id="cygwin.solink.libs">
</option>
+ <option
+ name="%Option.Posix.Libsearch"
+ category="cygwin.solink.category.general"
+ command="-L"
+ valueType="stringList"
+ id="cygwin.solink.ld.paths">
+ </option>
</tool>
</target>
<target
@@ -440,19 +440,19 @@
id="cygwin.explink.ld.flags">
</option>
<option
- name="Library Paths"
- category="cygwin.explink.category.general"
- command="-L"
- valueType="stringList"
- id="cygwin.explink.ld.paths">
- </option>
- <option
- name="Libraries"
+ name="%Option.Posix.Libs"
category="cygwin.explink.category.general"
command="-l"
valueType="libs"
id="cygwin.explink.libs">
</option>
+ <option
+ name="%Option.Posix.Libsearch"
+ category="cygwin.explink.category.general"
+ command="-L"
+ valueType="stringList"
+ id="cygwin.explink.ld.paths">
+ </option>
</tool>
</target>
<target
@@ -522,14 +522,14 @@
</option>
<option
defaultValue="false"
- name="Preprocess only (-E)"
+ name="%Option.Posix.PreprocOnly"
category="linux.gnu.compiler.category.preprocessor"
command="-E"
valueType="boolean"
id="linux.gnu.compiler.preprocessor.preprocess">
</option>
<option
- name="Defined Symbols (-D)"
+ name="%Option.Posix.DefSym"
category="linux.gnu.compiler.category.preprocessor"
command="-D"
valueType="definedSymbols"
@@ -862,14 +862,14 @@
id="linux.gnu.linker.category.libs">
</optionCategory>
<option
- name="Libraries"
+ name="%Option.Posix.Libs"
category="linux.gnu.linker.category.libs"
command="-l"
valueType="libs"
id="linux.gnu.linker.libs.libs">
</option>
<option
- name="Library search path"
+ name="%Option.Posix.Libsearch"
category="linux.gnu.linker.category.libs"
command="-L"
valueType="stringList"
@@ -967,14 +967,14 @@
id="linux.gnu.solink.category.libs">
</optionCategory>
<option
- name="Libraries"
+ name="%Option.Posix.Libs"
category="linux.gnu.solink.category.libs"
command="-l"
valueType="libs"
id="linux.gnu.solink.libs.libs">
</option>
<option
- name="Library search path"
+ name="%Option.Posix.Libsearch"
category="linux.gnu.solink.category.libs"
command="-L"
valueType="stringList"
@@ -1050,14 +1050,14 @@
</option>
<option
defaultValue="false"
- name="Preprocess only (-E)"
+ name="%Option.Posix.PreprocOnly"
category="solaris.gnu.compiler.category.preprocessor"
command="-E"
valueType="boolean"
id="solaris.gnu.compiler.preprocessor.preprocess">
</option>
<option
- name="Defined Symbols (-D)"
+ name="%Option.Posix.DefSym"
category="solaris.gnu.compiler.category.preprocessor"
command="-D"
valueType="definedSymbols"
@@ -1382,14 +1382,14 @@
id="solaris.gnu.linker.category.libs">
</optionCategory>
<option
- name="Libraries"
+ name="%Option.Posix.Libs"
category="solaris.gnu.linker.category.libs"
command="-l"
valueType="libs"
id="solaris.gnu.linker.libs.libs">
</option>
<option
- name="Library search path"
+ name="%Option.Posix.Libsearch"
category="solaris.gnu.linker.category.libs"
command="-L"
valueType="stringList"
@@ -1487,14 +1487,14 @@
id="solaris.gnu.solink.category.libs">
</optionCategory>
<option
- name="Libraries"
+ name="%Option.Posix.Libs"
category="solaris.gnu.solink.category.libs"
command="-l"
valueType="libs"
id="solaris.gnu.solink.libs.libs">
</option>
<option
- name="Library search path"
+ name="%Option.Posix.Libsearch"
category="solaris.gnu.solink.category.libs"
command="-L"
valueType="stringList"
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java
new file mode 100644
index 00000000000..b2f4bb4e4d1
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java
@@ -0,0 +1,22 @@
+package org.eclipse.cdt.managedbuilder.internal.ui;
+
+import org.eclipse.cdt.ui.CUIPlugin;
+
+/**********************************************************************
+ * 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
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ * **********************************************************************/
+
+public interface ManagedBuilderHelpContextIds {
+ public static final String PREFIX= CUIPlugin.PLUGIN_ID + ".";
+
+ // Wizard pages
+ public static final String MAN_PROJ_PLATFORM_HELP = PREFIX + "man_proj_platform_help";
+
+}
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 88290bb4ba2..7bdbcf4b7f3 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
@@ -47,11 +47,21 @@ BuildPropertyPage.tip.platform=Select a platform for the project
BuildPropertyPage.tip.config=Select the configuration to edit
BuildPropertyPage.tip.addconf=Add configurations for the platform
BuildPropertyPage.tip.remconf=Remove configurations for the platform
-BuildPropertyPage.manage.title=Manage Configurations
-
+BuildPropertyPage.manage.title=Manage
# ----------- New Configuration -----------
NewConfiguration.label.name=Configuration name:
NewConfiguration.label.copy=Copy settings from:
NewConfiguration.error.title=Error
NewConfiguration.error.duplicateName=A configuration named "{0}" already exists.
+
+# ----------- Target/Config management dialog -----------------
+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.configs=Manage configurations
+ManageConfig.label.restore=Restore
+ManageConfig.label.configs.current=Current:
+ManageConfig.label.configs.deleted=Deleted:
+ManageConfig.label.new.config.dialog=Create \ No newline at end of file
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 e8b0d53a0c5..53fb3a13a9f 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
@@ -13,14 +13,19 @@ package org.eclipse.cdt.managedbuilder.ui.properties;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.ITarget;
+import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
@@ -403,9 +408,29 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
// Recreate the settings store for the configuration
settingsStore = new BuildToolsSettingsStore(selectedConfiguration);
- // Select the first option in the list
+ // Select the first tool or option category in the list that has options
Object[] elements = provider.getElements(selectedConfiguration);
Object primary = elements.length > 0 ? elements[0] : null;
+
+ if (primary != null && primary instanceof ITool) {
+ // Check to see if there are any options.
+ ITool tool = (ITool)primary;
+ IOptionCategory top = tool.getTopOptionCategory();
+ IOption[] topOpts = top.getOptions(selectedConfiguration);
+ if (topOpts != null && topOpts.length == 0) {
+ // Get the children categories and start looking
+ IOptionCategory[] children = top.getChildCategories();
+ for (int i = 0; i < children.length; i++) {
+ IOptionCategory category = children[i];
+ IOption[] catOpts = category.getOptions(selectedConfiguration);
+ if (catOpts != null && catOpts.length > 0) {
+ primary = category;
+ break;
+ }
+ }
+ }
+ }
+
if (primary != null) {
optionList.setSelection(new StructuredSelection(primary));
}
@@ -415,13 +440,66 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
private void handleManageConfig () {
ManageConfigDialog manageDialog = new ManageConfigDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(MANAGE_TITLE), selectedTarget);
if (manageDialog.open() == ManageConfigDialog.OK) {
+ boolean updateConfigs = false;
+
+ // Get the build output name
+ String newBuildOutput = manageDialog.getBuildArtifactName();
+ if (!selectedTarget.getArtifactName().equals(newBuildOutput)) {
+ selectedTarget.setBuildArtifact(newBuildOutput);
+ }
+
+ // Get the new make command
+ if (manageDialog.useDefaultMakeCommand()) {
+ // This is a cheap assignment to null so do it to be doubly sure
+ selectedTarget.resetMakeCommand();
+ } else {
+ String makeCommand = manageDialog.getMakeCommand();
+ selectedTarget.setMakeCommand(makeCommand);
+ }
+
// Check to see if any configurations have to be deleted
- ArrayList deleteMe = manageDialog.getDeletedConfigs();
- ListIterator iter = deleteMe.listIterator();
+ List deletedConfigs = manageDialog.getDeletedConfigIds();
+ Iterator iter = deletedConfigs.listIterator();
while (iter.hasNext()) {
+ String id = (String)iter.next();
+
+ // Remove the configurations from the target
+ selectedTarget.removeConfiguration(id);
+
+ // Clean up the UI
+ configurations = selectedTarget.getConfigurations();
+ configSelector.removeAll();
+ configSelector.setItems(getConfigurationNames());
+ configSelector.select(0);
+ updateConfigs = true;
+ }
+
+ // Check to see if any have to be added
+ SortedMap newConfigs = manageDialog.getNewConfigs();
+ Set keys = newConfigs.keySet();
+ Iterator keyIter = keys.iterator();
+ int index = selectedTarget.getConfigurations().length;
+ while (keyIter.hasNext()) {
+ String name = (String) keyIter.next();
+ IConfiguration parent = (IConfiguration) newConfigs.get(name);
+ if (parent != null) {
+ ++index;
+ String newId = parent.getId() + "." + index;
+ IConfiguration newConfig = selectedTarget.createConfiguration(parent, newId);
+ newConfig.setName(name);
+ // Update the config lists
+ configurations = selectedTarget.getConfigurations();
+ configSelector.removeAll();
+ configSelector.setItems(getConfigurationNames());
+ configSelector.select(configSelector.indexOf(name));
+ updateConfigs = true;
+ }
+ }
+ if (updateConfigs){
+ handleConfigSelection();
}
- return;
}
+ return;
}
private void handleOptionSelection() {
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 6a9ba104c99..06d14a86791 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
@@ -18,50 +18,72 @@ import java.util.TreeMap;
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.ui.CUIPlugin;
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;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+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.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
public class ManageConfigDialog extends Dialog {
// String constants
- private static final String PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$
+ private static final String CMN_PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$
+ private static final String CMN_LABEL = CMN_PREFIX + ".label"; //$NON-NLS-1$
+ private static final String NEW = CMN_LABEL + ".new"; //$NON-NLS-1$
+ private static final String REMOVE = CMN_LABEL + ".remove"; //$NON-NLS-1$
+ private static final String PREFIX = "ManageConfig"; //$NON-NLS-1$
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
- private static final String NEW = LABEL + ".new"; //$NON-NLS-1$
- private static final String REMOVE = LABEL + ".remove"; //$NON-NLS-1$
+ private static final String RESTORE = LABEL + ".restore"; //$NON-NLS-1$
+ 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 CONFIGS = LABEL + ".configs"; //$NON-NLS-1$
-
- // Default return values
- private static final ArrayList EMPTY_LIST = new ArrayList(0);
- private static final SortedMap EMPTY_MAP = new TreeMap();
+ 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 title of the dialog.
- private String title = "";
- // The target the configs belong to
- private ITarget managedTarget;
+ // The name of the build artifact
+ private String buildArtifact;
// The list of configurations to delete
- private ArrayList deletedConfigIds;
+ private SortedMap deletedConfigs;
// Map of configuration names and ids
- private SortedMap configIds;
+ private SortedMap existingConfigs;
+ // The make command associated with the target
+ private String makeCommand;
+ // The target the configs belong to
+ private ITarget managedTarget;
// Map of new configurations chosen by the user
private SortedMap newConfigs;
+ // The title of the dialog.
+ private String title = "";
+ // State of the check box on exit
+ private boolean useDefaultMake;
// Widgets
- private List configurationList;
- private Button newBtn;
- private Button okBtn;
- private Button removeBtn;
+ protected Text buildArtifactEntry;
+ protected List currentConfigList;
+ protected List deletedConfigList;
+ protected Button makeCommandDefault;
+ protected Text makeCommandEntry;
+ protected Button newBtn;
+ protected Button okBtn;
+ protected Button removeBtn;
+ protected Button restoreBtn;
/**
* @param parentShell
@@ -71,16 +93,40 @@ public class ManageConfigDialog extends Dialog {
this.title = title;
this.managedTarget = target;
+ // Figure out the default make command
+ makeCommand = managedTarget.getMakeCommand();
+
+ // Get the name of the build artifact
+ buildArtifact = managedTarget.getArtifactName();
+
// Get the defined configurations from the target
- IConfiguration [] configs = this.managedTarget.getConfigurations();
- configIds = new TreeMap();
+ getExistingConfigs().clear();
+ IConfiguration [] configs = managedTarget.getConfigurations();
for (int i = 0; i < configs.length; i++) {
IConfiguration configuration = configs[i];
- configIds.put(configuration.getName(), configuration.getId());
+ getExistingConfigs().put(configuration.getName(), configuration.getId());
}
+
+ getDeletedConfigs().clear();
+ getNewConfigs().clear();
}
/* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
+ */
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == IDialogConstants.OK_ID) {
+ useDefaultMake = makeCommandDefault.getSelection();
+ makeCommand = makeCommandEntry.getText().trim();
+ buildArtifact = buildArtifactEntry.getText().trim();
+ } else {
+ useDefaultMake = true;
+ buildArtifact = managedTarget.getArtifactName();
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ /* (non-Javadoc)
* Method declared in Window.
*/
protected void configureShell(Shell shell) {
@@ -98,23 +144,80 @@ public class ManageConfigDialog extends Dialog {
}
protected Control createDialogArea(Composite parent) {
- // Create the main composite with a 2-column grid layout
- Composite composite = ControlFactory.createComposite(parent, 3);
+ Composite comp = ControlFactory.createComposite(parent, 1);
- // Create a list
- Composite listComp = ControlFactory.createComposite(composite, 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;
+ }
+ });
+
+
+ // Create the config list group area
+ Group configListGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(CONFIGS), 3);
+ gd = new GridData(GridData.FILL_BOTH);
+ configListGroup.setLayoutData(gd);
+
+ // 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;
- listComp.setLayoutData(gd);
- Label label = ControlFactory.createLabel(listComp, CUIPlugin.getResourceString(CONFIGS));
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- configurationList = new List(listComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
+ currentConfigLabel.setLayoutData(gd);
+ Label deletedConfigLabel = ControlFactory.createLabel(configListGroup, 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);
+ currentConfigList = new List(currentComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = 15;
- configurationList.setLayoutData(gd);
+ gd.widthHint = 100;
+ currentConfigList.setLayoutData(gd);
+ currentConfigList.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ currentConfigList = null;
+ }
+ });
// Create a composite for the buttons
- Composite buttonBar = ControlFactory.createComposite(composite, 1);
+ Composite buttonBar = ControlFactory.createComposite(configListGroup, 1);
+ buttonBar.setLayoutData(new GridData());
+
newBtn = ControlFactory.createPushButton(buttonBar, CUIPlugin.getResourceString(NEW));
setButtonLayoutData(newBtn);
newBtn.addSelectionListener(new SelectionAdapter () {
@@ -122,6 +225,11 @@ public class ManageConfigDialog extends Dialog {
handleNewPressed();
}
});
+ newBtn.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ newBtn = null;
+ }
+ });
removeBtn = ControlFactory.createPushButton(buttonBar, CUIPlugin.getResourceString(REMOVE));
setButtonLayoutData(removeBtn);
removeBtn.addSelectionListener(new SelectionAdapter () {
@@ -129,38 +237,115 @@ public class ManageConfigDialog extends Dialog {
handleRemovePressed();
}
});
-
+ removeBtn.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ removeBtn = null;
+ }
+ });
+ restoreBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(RESTORE));
+ setButtonLayoutData(restoreBtn);
+ restoreBtn.addSelectionListener(new SelectionAdapter () {
+ public void widgetSelected(SelectionEvent e) {
+ handleRestorePressed();
+ }
+ });
+ restoreBtn.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ restoreBtn = null;
+ }
+ });
+
+ // Create the deleted config list
+ Composite deletedComp = ControlFactory.createComposite(configListGroup, 1);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 1;
+ deletedComp.setLayoutData(gd);
+ 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.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ deletedConfigList = null;
+ }
+ });
+
// Do the final widget prep
- configurationList.setItems(getConfigurationNames());
- configurationList.select(0);
+ currentConfigList.setItems(getConfigurationNames());
+ currentConfigList.select(0);
newBtn.setFocus();
- return composite;
+ return comp;
}
+ /**
+ *
+ */
+ protected void handleUseDefaultPressed() {
+ // If the state of the button is unchecked, then we want to enable the edit widget
+ makeCommandEntry.setEditable(!makeCommandDefault.getSelection());
+ }
+
+ /**
+ * Answers the value in the build artifact entry widget.
+ *
+ * @return
+ */
+ public String getBuildArtifactName() {
+ return buildArtifact;
+ }
+
private String [] getConfigurationNames() {
- return (String[]) configIds.keySet().toArray(new String[configIds.size()]);
+ return (String[]) getExistingConfigs().keySet().toArray(new String[getExistingConfigs().size()]);
+ }
+
+ /* (non-javadoc)
+ * Answers a <code>SortedMap</code> of <code>IConfiguration</code> names to unique IDs.
+ *
+ * @return
+ */
+ protected SortedMap getDeletedConfigs() {
+ if (deletedConfigs == null) {
+ deletedConfigs = new TreeMap();
+ }
+ return deletedConfigs;
}
/**
- * @return <code>ArrayList</code> of <code>IConfiguration</code> ids
- * the user has decided to remove from the target.
+ * Answers a <code>List</code> of unique IDs corresponding to the <code>IConfigurations</code>
+ * the user wishes to remove from the <code>ITarget</code>
+ * @return
*/
- public ArrayList getDeletedConfigs() {
- if (deletedConfigIds == null) {
- deletedConfigIds = EMPTY_LIST;
+ public ArrayList getDeletedConfigIds() {
+ return new ArrayList(getDeletedConfigs().values());
+ }
+
+ protected SortedMap getExistingConfigs() {
+ if (existingConfigs == null) {
+ existingConfigs = new TreeMap();
}
- return deletedConfigIds;
+ return existingConfigs;
+ }
+
+ /**
+ * Answers the value in the make command entry widget.
+ *
+ * @return
+ */
+ public String getMakeCommand() {
+ return makeCommand;
}
/**
- * @return Map of configuration names to <code>IConfiguration</code>.
+ * Answers a map of configuration names to <code>IConfiguration</code>.
* The name is selected by the user and should be unique for the target
* it will be added to. The configuration is the what the new
- * configuration will be based on.
+ * configuration will be based on.
+ *
+ * @return Map
*/
public SortedMap getNewConfigs() {
if (newConfigs == null) {
- newConfigs = EMPTY_MAP;
+ newConfigs = new TreeMap();
}
return newConfigs;
}
@@ -181,7 +366,7 @@ public class ManageConfigDialog extends Dialog {
ITarget [] targets = ManagedBuildManager.getDefinedTargets(getProject());
for (int i = 0; i < targets.length; i++) {
ITarget target = targets[i];
- if (target.getId().equals(managedTarget.getId())) {
+ if (target.getId().equals(managedTarget.getParent().getId())) {
parentTarget = target;
break;
}
@@ -194,10 +379,16 @@ public class ManageConfigDialog extends Dialog {
// There should be predefined configurations ....
if (allDefinedConfigs != null && allDefinedConfigs.length != 0) {
- NewConfigurationDialog dialog = new NewConfigurationDialog(getShell(), allDefinedConfigs, managedTarget);
+ NewConfigurationDialog dialog = new NewConfigurationDialog(getShell(),
+ allDefinedConfigs,
+ managedTarget,
+ ManagedBuilderUIPlugin.getResourceString(CONF_DLG));
if (dialog.open() == NewConfigurationDialog.OK) {
// Get the new name and configuration to base the new config on
- getNewConfigs().put(dialog.getNewName(), dialog.getParentConfiguration());
+ String newConfigName = dialog.getNewName();
+ getNewConfigs().put(newConfigName, dialog.getParentConfiguration());
+ currentConfigList.add(newConfigName);
+ currentConfigList.setSelection(currentConfigList.getItemCount() - 1);
}
}
@@ -205,29 +396,72 @@ public class ManageConfigDialog extends Dialog {
updateButtons();
}
- /*
+ /* (non-javadoc)
* Event handler for the remove button
*/
protected void handleRemovePressed() {
- // TODO Request a remove configuration function through the ITarget interface
// Determine which configuration was selected
- int selectionIndex = configurationList.getSelectionIndex();
+ int selectionIndex = currentConfigList.getSelectionIndex();
if (selectionIndex != -1){
- String selectedConfig = configurationList.getItem(selectionIndex);
- getDeletedConfigs().add(configIds.get(selectedConfig));
- configurationList.remove(selectionIndex);
+ String selectedConfigName = currentConfigList.getItem(selectionIndex);
+ String selectedConfigId = null;
+
+ // If this is a newly added config, remove it from that map
+ if (getNewConfigs().containsKey(selectedConfigName)) {
+ selectedConfigId = (String) getNewConfigs().get(selectedConfigName);
+ getNewConfigs().remove(selectedConfigName);
+ }
+
+ // If it is not a new item, the ID is in the existing list
+ selectedConfigId = (String) getExistingConfigs().get(selectedConfigName);
+ getDeletedConfigs().put(selectedConfigName, selectedConfigId);
+
+ // Clean up the UI lists
+ currentConfigList.remove(selectionIndex);
+ currentConfigList.setSelection(selectionIndex - 1);
+ deletedConfigList.add(selectedConfigName);
+ deletedConfigList.setSelection(deletedConfigList.getItemCount() - 1);
+ updateButtons();
+ }
+ }
+
+ /* (non-javadoc)
+ * Event handler for the restore button
+ */
+ protected void handleRestorePressed() {
+ // Determine which configuration was selected
+ int selectionIndex = deletedConfigList.getSelectionIndex();
+ // Move the selected element from the deleted list to the current list
+ if (selectionIndex != -1){
+ // Get the name of the item to delete
+ String selectedConfigName = deletedConfigList.getItem(selectionIndex);
+ String selectedConfigId = (String) getDeletedConfigs().get(selectedConfigName);
+
+ // If this was a new config (it won't be in the existing list) then add it back there
+ if (!getExistingConfigs().containsKey(selectedConfigName)) {
+ getNewConfigs().put(selectedConfigName, selectedConfigId);
+ }
+
+ // Remove it from the deleted map
+ getDeletedConfigs().remove(selectedConfigName);
+
+ // Clean up the UI
+ deletedConfigList.remove(selectionIndex);
+ deletedConfigList.setSelection(selectionIndex - 1);
+ currentConfigList.add(selectedConfigName);
+ currentConfigList.setSelection(currentConfigList.getItemCount());
updateButtons();
}
}
private void updateButtons() {
// Disable the remove button if there is only 1 configuration
-// removeBtn.setEnabled(configurationList.getItemCount() > 1);
- removeBtn.setEnabled(false);
-
- // Enable the OK button if there are any configs to delete or add
- okBtn.setEnabled(!(getDeletedConfigs().isEmpty() && getNewConfigs().isEmpty()));
+ removeBtn.setEnabled(currentConfigList.getItemCount() > 1);
+ // Enable the restore button if there is anything in the deleted list
+ restoreBtn.setEnabled(deletedConfigList.getItemCount() > 0);
}
-
+ public boolean useDefaultMakeCommand () {
+ return useDefaultMake;
+ }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
index 8765e7ce573..2a98b4a464d 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
@@ -53,13 +53,15 @@ public class NewConfigurationDialog extends Dialog {
private ITarget target;
private String newName;
private String [] allNames;
+ private String title = "";
/**
* @param parentShell
*/
- protected NewConfigurationDialog(Shell parentShell, IConfiguration[] configs, ITarget managedTarget) {
+ protected NewConfigurationDialog(Shell parentShell, IConfiguration[] configs, ITarget managedTarget, String title) {
super(parentShell);
+ this.title = title;
setShellStyle(getShellStyle()|SWT.RESIZE);
newName = new String();
parentConfig = null;
@@ -92,7 +94,16 @@ public class NewConfigurationDialog extends Dialog {
}
/* (non-Javadoc)
- * Method declared on Dialog. Create OK and Cancel buttons and hold onto the OK button handle.
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ if (title != null)
+ shell.setText(title);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
protected void createButtonsForButtonBar(Composite parent) {
btnOk = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
index edb4066ae70..05919effbe8 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
@@ -18,6 +18,7 @@ import java.util.ListIterator;
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.ManagedBuilderHelpContextIds;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.jface.viewers.CheckboxTableViewer;
@@ -33,12 +34,12 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.help.WorkbenchHelp;
public class CProjectPlatformPage extends WizardPage {
/*
* Bookeeping variables
*/
-// private CProjectWizard wizard;
private ArrayList selectedConfigurations;
protected ITarget selectedTarget;
protected String[] targetNames;
@@ -61,10 +62,9 @@ public class CProjectPlatformPage extends WizardPage {
* @param wizard
* @param pageName
*/
- public CProjectPlatformPage(/*CProjectWizard wizard,*/ String pageName) {
+ public CProjectPlatformPage(String pageName) {
super(pageName);
setPageComplete(false);
-// this.wizard = wizard;
populateTargets();
selectedTarget = null;
selectedConfigurations = new ArrayList(0);
@@ -129,6 +129,9 @@ public class CProjectPlatformPage extends WizardPage {
// Select the first target in the list
handleTargetSelection();
+ // Setup the help information
+ WorkbenchHelp.setHelp(composite, ManagedBuilderHelpContextIds.MAN_PROJ_PLATFORM_HELP);
+
// Do the nasty
setErrorMessage(null);
setMessage(null);

Back to the top