mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Apply patch from Sunil Davasam for multi-version and converter support
This commit is contained in:
parent
cc72de6f60
commit
92e840899d
11 changed files with 1344 additions and 32 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
<extension-point id="ManagedBuildInfo" name="Managed Build Tools 2.0 (Deprecated)" schema="schema/ManagedBuildTools.exsd"/>
|
||||
<extension-point id="buildDefinitions" name="Managed Build Definitions" schema="schema/buildDefinitions.exsd"/>
|
||||
<extension-point id="projectConverter" name="Managed Build Project Converter" schema="schema/Converter.exsd"/>
|
||||
|
||||
<!-- =================================================================================== -->
|
||||
<!-- Extension Point: IScannerInfoProvider for the managed Builder -->
|
||||
|
|
163
build/org.eclipse.cdt.managedbuilder.core/schema/Converter.exsd
Normal file
163
build/org.eclipse.cdt.managedbuilder.core/schema/Converter.exsd
Normal file
|
@ -0,0 +1,163 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.eclipse.cdt.managedbuilder.core">
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.schema plugin="org.eclipse.cdt.managedbuilder.core" id="Converter" name="Converter"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
This extension point allows a tool integrator to contribute a project-type/tool-chain/tool/builder converter to MBS.
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="converter" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="converter">
|
||||
<annotation>
|
||||
<documentation>
|
||||
This extension point allows a tool integrator to contribute a project-type/tool-chain/tool/builder converter to MBS. Converters can be used to upgrade to newer versions, change the project-type, or to perform conversions between different tool chains/tools/buiders.
|
||||
</documentation>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<attribute name="fromId" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The 'fromId' is project-type/tool-chain/tool/builder id - a regular expression.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="toId" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The 'toId' is project-type/tool-chain/tool/builder id - a regular expression.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="mbsVersion" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The MBS version the converter was written for.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="class" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The class that implements the IConvertManagedBuildObject interface
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of the converter
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The name of the converter that is used in User Interface to display to the user
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="since"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
CDT version 3.0
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="examples"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
<p>
|
||||
<pre>
|
||||
<extension point="org.eclipse.cdt.managedbuilder.core.converter">
|
||||
<converter
|
||||
fromId="project-type/tool-chain/tool/builder id"
|
||||
toId="project-type/tool-chain/tool/builder id"
|
||||
mbsVersion="The MBS version the converter was written for"
|
||||
class="org.eclipse.cdt.managedbuilder.core.GccConverter">
|
||||
</converter>
|
||||
</extension>
|
||||
</pre>
|
||||
</p>
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="apiInfo"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Plugins that want to extend this extension point must implement
|
||||
"org.eclipse.cdt.managedbuilder.core.IConvertManagedBuildObject" interface
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
"Example plugin" has default implementation of the converter
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="copyright"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
</schema>
|
|
@ -0,0 +1,16 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core;
|
||||
|
||||
|
||||
public interface IConvertManagedBuildObject {
|
||||
public IBuildObject convert(IBuildObject buildObj, String fromId, String toId, boolean isConfirmed);
|
||||
}
|
|
@ -24,6 +24,8 @@ import java.util.List;
|
|||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
|
@ -139,13 +141,13 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
// Resource configurations defined in the manifest files
|
||||
private static Map extensionResourceConfigurationMap;
|
||||
// Tool-chains defined in the manifest files
|
||||
private static Map extensionToolChainMap;
|
||||
private static SortedMap extensionToolChainMap;
|
||||
// Tools defined in the manifest files
|
||||
private static Map extensionToolMap;
|
||||
private static SortedMap extensionToolMap;
|
||||
// Target Platforms defined in the manifest files
|
||||
private static Map extensionTargetPlatformMap;
|
||||
// Builders defined in the manifest files
|
||||
private static Map extensionBuilderMap;
|
||||
private static SortedMap extensionBuilderMap;
|
||||
// Options defined in the manifest files
|
||||
private static Map extensionOptionMap;
|
||||
// Option Categories defined in the manifest files
|
||||
|
@ -306,9 +308,9 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
*
|
||||
* @return Map
|
||||
*/
|
||||
protected static Map getExtensionToolChainMap() {
|
||||
public static SortedMap getExtensionToolChainMap() {
|
||||
if (extensionToolChainMap == null) {
|
||||
extensionToolChainMap = new HashMap();
|
||||
extensionToolChainMap = new TreeMap();
|
||||
}
|
||||
return extensionToolChainMap;
|
||||
}
|
||||
|
@ -318,9 +320,9 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
*
|
||||
* @return Map
|
||||
*/
|
||||
protected static Map getExtensionToolMap() {
|
||||
public static SortedMap getExtensionToolMap() {
|
||||
if (extensionToolMap == null) {
|
||||
extensionToolMap = new HashMap();
|
||||
extensionToolMap = new TreeMap();
|
||||
}
|
||||
return extensionToolMap;
|
||||
}
|
||||
|
@ -342,9 +344,9 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
*
|
||||
* @return Map
|
||||
*/
|
||||
protected static Map getExtensionBuilderMap() {
|
||||
public static SortedMap getExtensionBuilderMap() {
|
||||
if (extensionBuilderMap == null) {
|
||||
extensionBuilderMap = new HashMap();
|
||||
extensionBuilderMap = new TreeMap();
|
||||
}
|
||||
return extensionBuilderMap;
|
||||
}
|
||||
|
@ -1507,21 +1509,61 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
NodeList nodes = document.getElementsByTagName(ROOT_NODE_NAME);
|
||||
if (nodes.getLength() > 0) {
|
||||
Node node = nodes.item(0);
|
||||
|
||||
// Create the internal representation of the project's MBS information
|
||||
buildInfo = new ManagedBuildInfo(project, (Element)node, fileVersion);
|
||||
if (fileVersion != null) {
|
||||
buildInfo.setVersion(fileVersion);
|
||||
}
|
||||
if(!UpdateManagedProjectManager.isCompatibleProject(buildInfo)){
|
||||
UpdateManagedProjectManager.updateProject(project,buildInfo);
|
||||
}
|
||||
// Check to see if all elements could be loaded correctly - for example,
|
||||
// if references in the project file could not be resolved to extension
|
||||
// elements
|
||||
if (buildInfo.getManagedProject() == null ||
|
||||
(!buildInfo.getManagedProject().isValid())) {
|
||||
// The load failed
|
||||
throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// Each ToolChain/Tool/Builder element maintain two separate
|
||||
// converters if available
|
||||
// 0ne for previous Mbs versions and one for current Mbs version
|
||||
// walk through the project hierarchy and call the converters
|
||||
// written for previous mbs versions
|
||||
if ( checkForMigrationSupport(buildInfo, false) != true ) {
|
||||
// display an error message that the project is no loadable
|
||||
if (buildInfo.getManagedProject() == null ||
|
||||
(!buildInfo.getManagedProject().isValid())) {
|
||||
// The load failed
|
||||
throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
// Upgrade the project's CDT version if necessary
|
||||
if (!UpdateManagedProjectManager.isCompatibleProject(buildInfo)) {
|
||||
UpdateManagedProjectManager.updateProject(project, buildInfo);
|
||||
}
|
||||
// Check to see if the upgrade (if required) succeeded
|
||||
if (buildInfo.getManagedProject() == null ||
|
||||
(!buildInfo.getManagedProject().isValid())) {
|
||||
// The load failed
|
||||
throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// Walk through the project hierarchy and call the converters
|
||||
// written for current mbs version
|
||||
if ( checkForMigrationSupport(buildInfo, true) != true ) {
|
||||
// display an error message.that the project is no loadable
|
||||
if (buildInfo.getManagedProject() == null ||
|
||||
(!buildInfo.getManagedProject().isValid())) {
|
||||
// The load failed
|
||||
throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
// Finish up
|
||||
project.setSessionProperty(buildInfoProperty, buildInfo);
|
||||
IConfiguration[] configs = buildInfo.getManagedProject().getConfigurations();
|
||||
// Send an event to each configuration and if they exist, its resource configurations
|
||||
// Send an event to each configuration and if they exist, its resource configurations
|
||||
for (int i=0; i < configs.length; ++i) {
|
||||
ManagedBuildManager.performValueHandlerEvent(configs[i], IManagedOptionValueHandler.EVENT_OPEN);
|
||||
}
|
||||
|
@ -2503,5 +2545,104 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkForMigrationSupport(ManagedBuildInfo buildInfo,
|
||||
boolean forCurrentMbsVersion) {
|
||||
|
||||
IProjectType projectType = null;
|
||||
IConfigurationElement element = null;
|
||||
|
||||
// Get the projectType from buildInfo
|
||||
IManagedProject managedProject = buildInfo.getManagedProject();
|
||||
projectType = managedProject.getProjectType();
|
||||
|
||||
// walk through the hierarchy of the projectType and
|
||||
// call the converters if available for each configuration
|
||||
IConfiguration[] configs = projectType.getConfigurations();
|
||||
for (int i = 0; i < configs.length; i++) {
|
||||
IConfiguration configuration = configs[i];
|
||||
IToolChain toolChain = configuration.getToolChain();
|
||||
|
||||
if (forCurrentMbsVersion) {
|
||||
element = ((ToolChain)toolChain).getCurrentMbsVersionConversionElement();
|
||||
} else {
|
||||
element = ((ToolChain)toolChain).getPreviousMbsVersionConversionElement();
|
||||
}
|
||||
|
||||
if (element != null) {
|
||||
// If there is a converter element for toolChain, invoke it
|
||||
// toolChain converter should take care of invoking converters of it's children
|
||||
if ( invokeConverter(toolChain, buildInfo, element) != true ) {
|
||||
buildInfo.getManagedProject().setValid(false);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// If there are no converters for toolChain, walk through it's children
|
||||
ITool[] tools = toolChain.getTools();
|
||||
for (int j = 0; j < tools.length; j++) {
|
||||
ITool tool = tools[j];
|
||||
if (forCurrentMbsVersion) {
|
||||
element = ((Tool)tool).getCurrentMbsVersionConversionElement();
|
||||
} else {
|
||||
element = ((Tool)tool).getPreviousMbsVersionConversionElement();
|
||||
}
|
||||
if (element != null) {
|
||||
if ( invokeConverter(tool, buildInfo, element) != true ) {
|
||||
buildInfo.getManagedProject().setValid(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
IBuilder builder = toolChain.getBuilder();
|
||||
if (forCurrentMbsVersion) {
|
||||
element = ((Builder)builder).getCurrentMbsVersionConversionElement();
|
||||
} else {
|
||||
element = ((Builder)builder).getPreviousMbsVersionConversionElement();
|
||||
}
|
||||
|
||||
if (element != null) {
|
||||
if ( invokeConverter(builder, buildInfo, element) != true ) {
|
||||
buildInfo.getManagedProject().setValid(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// If control comes here, it means either there is no converter element
|
||||
// or converters are invoked successfully
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean invokeConverter(IBuildObject buildObject,
|
||||
IManagedBuildInfo buildInfo, IConfigurationElement element) {
|
||||
String toId = null;
|
||||
String fromId = null;
|
||||
IConvertManagedBuildObject convertBuildObject = null;
|
||||
|
||||
if (element != null) {
|
||||
toId = element.getAttribute("toId"); //$NON-NLS-1$
|
||||
fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
|
||||
try {
|
||||
convertBuildObject = (IConvertManagedBuildObject) element
|
||||
.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
} catch (CoreException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (convertBuildObject != null) {
|
||||
// invoke the converter
|
||||
if (convertBuildObject
|
||||
.convert(buildObject, fromId, toId, false) != null) {
|
||||
// If it is successful, return 'true'
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if control comes here, it means that either 'convertBuildObject' is null or
|
||||
// converter did not convert the object successfully
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,11 +12,14 @@ package org.eclipse.cdt.managedbuilder.internal.core;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.SortedMap;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
|
@ -28,6 +31,10 @@ import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator;
|
|||
import org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
|
@ -61,10 +68,13 @@ public class Builder extends BuildObject implements IBuilder {
|
|||
private boolean isDirty = false;
|
||||
private boolean resolved = true;
|
||||
|
||||
private IConfigurationElement previousMbsVersionConversionElement = null;
|
||||
private IConfigurationElement currentMbsVersionConversionElement = null;
|
||||
/*
|
||||
* C O N S T R U C T O R S
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* This constructor is called to create a builder defined by an extension point in
|
||||
* a plugin manifest file, or returned by a dynamic element provider
|
||||
|
@ -308,9 +318,8 @@ public class Builder extends BuildObject implements IBuilder {
|
|||
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
|
||||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionBuilder(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
}
|
||||
// Check for migration support
|
||||
checkForMigrationSupport();
|
||||
}
|
||||
|
||||
// Get the 'versionSupported' attribute
|
||||
|
@ -776,4 +785,200 @@ public class Builder extends BuildObject implements IBuilder {
|
|||
return superClass.getReservedMacroNameSupplier();
|
||||
return reservedMacroNameSupplier;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function checks for migration support for the builder, while
|
||||
* loading. If migration support is needed, looks for the available
|
||||
* converters and stores them.
|
||||
*/
|
||||
|
||||
private void checkForMigrationSupport() {
|
||||
|
||||
String tmpId = null;
|
||||
boolean isExists = false;
|
||||
|
||||
if (getSuperClass() == null) {
|
||||
// If 'superClass' is null, then there is no builder available in
|
||||
// plugin manifest file with the same 'id' & version.
|
||||
// Look for the 'versionsSupported' attribute
|
||||
String high = (String) ManagedBuildManager
|
||||
.getExtensionBuilderMap().lastKey();
|
||||
|
||||
SortedMap subMap = null;
|
||||
if (superClassId.compareTo(high) <= 0) {
|
||||
subMap = ManagedBuildManager.getExtensionBuilderMap().subMap(
|
||||
superClassId, high + "\0"); //$NON-NLS-1$
|
||||
} else {
|
||||
// It means there are no entries in the map for the given id.
|
||||
// make the project is invalid
|
||||
|
||||
IToolChain parent = getParent();
|
||||
IConfiguration parentConfig = parent.getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// for each element in the 'subMap',
|
||||
// check the 'versionsSupported' attribute whether the given
|
||||
// builder version is supported
|
||||
|
||||
String baseId = ManagedBuildManager
|
||||
.getIdFromIdAndVersion(superClassId);
|
||||
String version = ManagedBuildManager
|
||||
.getVersionFromIdAndVersion(superClassId);
|
||||
|
||||
IBuilder[] builderElements = (IBuilder[]) subMap.values()
|
||||
.toArray();
|
||||
|
||||
for (int i = 0; i < builderElements.length; i++) {
|
||||
IBuilder builderElement = builderElements[i];
|
||||
|
||||
if (ManagedBuildManager.getIdFromIdAndVersion(
|
||||
builderElement.getId()).compareTo(baseId) > 0)
|
||||
break;
|
||||
// First check if both base ids are equal
|
||||
if (ManagedBuildManager.getIdFromIdAndVersion(
|
||||
builderElement.getId()).equals(baseId)) {
|
||||
|
||||
// Check if 'versionsSupported' attribute is available'
|
||||
String versionsSupported = builderElement
|
||||
.getVersionsSupported();
|
||||
|
||||
if ((versionsSupported != null)
|
||||
&& (!versionsSupported.equals(""))) { //$NON-NLS-1$
|
||||
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
|
||||
|
||||
for (int j = 0; j < tmpVersions.length; j++) {
|
||||
if (new PluginVersionIdentifier(version)
|
||||
.equals(new PluginVersionIdentifier(
|
||||
tmpVersions[j]))) {
|
||||
// version is supported.
|
||||
// Do the automatic conversion without
|
||||
// prompting the user.
|
||||
// Get the supported version
|
||||
String supportedVersion = ManagedBuildManager
|
||||
.getVersionFromIdAndVersion(builderElement
|
||||
.getId());
|
||||
setId(ManagedBuildManager
|
||||
.getIdFromIdAndVersion(getId())
|
||||
+ "_" + supportedVersion); //$NON-NLS-1$
|
||||
|
||||
// If control comes here means that 'superClass' is null
|
||||
// So, set the superClass to this builder element
|
||||
superClass = builderElement;
|
||||
superClassId = superClass.getId();
|
||||
isExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isExists)
|
||||
break; // break the outer for loop if 'isExists' is true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getSuperClass() != null) {
|
||||
// If 'getSuperClass()' is not null, look for 'convertToId' attribute in plugin
|
||||
// manifest file for this builder.
|
||||
String convertToId = getSuperClass().getConvertToId();
|
||||
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$
|
||||
// It means there is no 'convertToId' attribute available and
|
||||
// the version is still actively
|
||||
// supported by the tool integrator. So do nothing, just return
|
||||
return;
|
||||
} else {
|
||||
// Incase the 'convertToId' attribute is available,
|
||||
// it means that Tool integrator currently does not support this
|
||||
// version of builder.
|
||||
// Look for the converters available for this builder version.
|
||||
|
||||
getConverter(convertToId);
|
||||
}
|
||||
|
||||
} else {
|
||||
// make the project is invalid
|
||||
//
|
||||
IToolChain parent = getParent();
|
||||
IConfiguration parentConfig = parent.getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void getConverter(String convertToId) {
|
||||
|
||||
String fromId = null;
|
||||
String toId = null;
|
||||
|
||||
// Get the Converter Extension Point
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
|
||||
.getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
|
||||
"projectConverter"); //$NON-NLS-1$
|
||||
if (extensionPoint != null) {
|
||||
// Get the extensions
|
||||
IExtension[] extensions = extensionPoint.getExtensions();
|
||||
for (int i = 0; i < extensions.length; i++) {
|
||||
// Get the configuration elements of each extension
|
||||
IConfigurationElement[] configElements = extensions[i]
|
||||
.getConfigurationElements();
|
||||
for (int j = 0; j < configElements.length; j++) {
|
||||
|
||||
IConfigurationElement element = configElements[j];
|
||||
|
||||
if (element.getName().equals("converter")) { //$NON-NLS-1$
|
||||
|
||||
fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
toId = element.getAttribute("toId"); //$NON-NLS-1$
|
||||
// Check whether the current converter can be used for
|
||||
// the selected builder
|
||||
|
||||
if (fromId.equals(getSuperClass().getId())
|
||||
&& toId.equals(convertToId)) {
|
||||
// If it matches
|
||||
String mbsVersion = element
|
||||
.getAttribute("mbsVersion"); //$NON-NLS-1$
|
||||
PluginVersionIdentifier currentMbsVersion = ManagedBuildManager
|
||||
.getBuildInfoVersion();
|
||||
|
||||
// set the converter element based on the MbsVersion
|
||||
if (currentMbsVersion
|
||||
.isGreaterThan(new PluginVersionIdentifier(
|
||||
mbsVersion))) {
|
||||
previousMbsVersionConversionElement = element;
|
||||
} else {
|
||||
currentMbsVersionConversionElement = element;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If control comes here, it means 'Tool Integrator' specified
|
||||
// 'convertToId' attribute in toolchain definition file, but
|
||||
// has not provided any converter.
|
||||
// So, make the project is invalid
|
||||
|
||||
IToolChain parent = getParent();
|
||||
IConfiguration parentConfig = parent.getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
}
|
||||
|
||||
public IConfigurationElement getPreviousMbsVersionConversionElement() {
|
||||
return previousMbsVersionConversionElement;
|
||||
}
|
||||
|
||||
public IConfigurationElement getCurrentMbsVersionConversionElement() {
|
||||
return currentMbsVersionConversionElement;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.Vector;
|
||||
|
||||
|
@ -25,6 +26,7 @@ import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
|||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IEnvVarBuildPath;
|
||||
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOptionApplicability;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
|
||||
|
@ -46,8 +48,12 @@ import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
|
|||
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -111,6 +117,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
|||
private boolean isExtensionTool = false;
|
||||
private boolean isDirty = false;
|
||||
private boolean resolved = resolvedDefault;
|
||||
private IConfigurationElement previousMbsVersionConversionElement = null;
|
||||
private IConfigurationElement currentMbsVersionConversionElement = null;
|
||||
|
||||
/*
|
||||
* C O N S T R U C T O R S
|
||||
|
@ -558,9 +566,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
|||
setSuperClass( resConfig.getParent().getTool(superClassId) );
|
||||
} else {
|
||||
setSuperClass( ManagedBuildManager.getExtensionTool(superClassId) );
|
||||
}
|
||||
if (getSuperClass() == null) {
|
||||
// TODO: Report error
|
||||
|
||||
// Check for migration support
|
||||
checkForMigrationSupport();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2408,5 +2416,214 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
|||
|
||||
envVarBuildPathList.add(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function checks for migration support for the tool, while
|
||||
* loading. If migration support is needed, looks for the available
|
||||
* converters and stores them.
|
||||
*/
|
||||
|
||||
private void checkForMigrationSupport() {
|
||||
|
||||
String tmpId = null;
|
||||
boolean isExists = false;
|
||||
|
||||
if ( getSuperClass() == null) {
|
||||
// If 'getSuperClass()' is null, then there is no tool available in
|
||||
// plugin manifest file with the same 'id' & version.
|
||||
// Look for the 'versionsSupported' attribute
|
||||
String high = (String) ManagedBuildManager.getExtensionToolMap()
|
||||
.lastKey();
|
||||
|
||||
SortedMap subMap = null;
|
||||
if (superClassId.compareTo(high) <= 0) {
|
||||
subMap = ManagedBuildManager.getExtensionToolMap().subMap(
|
||||
superClassId, high + "\0"); //$NON-NLS-1$
|
||||
} else {
|
||||
// It means there are no entries in the map for the given id.
|
||||
// make the project is invalid
|
||||
|
||||
// It means there are no entries in the map for the given id.
|
||||
// make the project is invalid
|
||||
// If the parent is a tool chain
|
||||
IToolChain parent = (IToolChain) getParent();
|
||||
IConfiguration parentConfig = parent.getParent();
|
||||
IManagedProject managedProject = parentConfig
|
||||
.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// for each element in the 'subMap',
|
||||
// check the 'versionsSupported' attribute whether the given
|
||||
// builder version is supported
|
||||
|
||||
String baseId = ManagedBuildManager
|
||||
.getIdFromIdAndVersion(superClassId);
|
||||
String version = ManagedBuildManager
|
||||
.getVersionFromIdAndVersion(superClassId);
|
||||
|
||||
ITool[] toolElements = (ITool[]) subMap.values().toArray();
|
||||
|
||||
for (int i = 0; i < toolElements.length; i++) {
|
||||
ITool toolElement = toolElements[i];
|
||||
|
||||
if (ManagedBuildManager.getIdFromIdAndVersion(
|
||||
toolElement.getId()).compareTo(baseId) > 0)
|
||||
break;
|
||||
|
||||
// First check if both base ids are equal
|
||||
if (ManagedBuildManager.getIdFromIdAndVersion(
|
||||
toolElement.getId()).equals(baseId)) {
|
||||
|
||||
// Check if 'versionsSupported' attribute is available'
|
||||
String versionsSupported = toolElement
|
||||
.getVersionsSupported();
|
||||
|
||||
if ((versionsSupported != null)
|
||||
&& (!versionsSupported.equals(""))) { //$NON-NLS-1$
|
||||
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
|
||||
|
||||
for (int j = 0; j < tmpVersions.length; j++) {
|
||||
if (new PluginVersionIdentifier(version)
|
||||
.equals(new PluginVersionIdentifier(
|
||||
tmpVersions[j]))) {
|
||||
// version is supported.
|
||||
// Do the automatic conversion without
|
||||
// prompting the user.
|
||||
// Get the supported version
|
||||
String supportedVersion = ManagedBuildManager
|
||||
.getVersionFromIdAndVersion(toolElement
|
||||
.getId());
|
||||
setId(ManagedBuildManager
|
||||
.getIdFromIdAndVersion(getId())
|
||||
+ "_" + supportedVersion); //$NON-NLS-1$
|
||||
|
||||
// If control comes here means that superClass
|
||||
// is null.
|
||||
// So, set the superClass to this tool element
|
||||
setSuperClass(toolElement);
|
||||
superClassId = getSuperClass().getId();
|
||||
isExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isExists)
|
||||
break; // break the outer for loop if 'isExists' is
|
||||
// true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getSuperClass() != null) {
|
||||
// If 'getSuperClass()' is not null, look for 'convertToId'
|
||||
// attribute in plugin
|
||||
// manifest file for this tool.
|
||||
String convertToId = getSuperClass().getConvertToId();
|
||||
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$
|
||||
// It means there is no 'convertToId' attribute available and
|
||||
// the version is still actively
|
||||
// supported by the tool integrator. So do nothing, just return
|
||||
return;
|
||||
} else {
|
||||
// Incase the 'convertToId' attribute is available,
|
||||
// it means that Tool integrator currently does not support this
|
||||
// version of tool.
|
||||
// Look for the converters available for this tool version.
|
||||
|
||||
getConverter(convertToId);
|
||||
}
|
||||
|
||||
} else {
|
||||
// make the project is invalid
|
||||
//
|
||||
// It means there are no entries in the map for the given id.
|
||||
// make the project is invalid
|
||||
IToolChain parent = (IToolChain) getParent();
|
||||
IConfiguration parentConfig = parent.getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
private void getConverter(String convertToId) {
|
||||
|
||||
String fromId = null;
|
||||
String toId = null;
|
||||
|
||||
// Get the Converter Extension Point
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
|
||||
.getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
|
||||
"projectConverter"); //$NON-NLS-1$
|
||||
if (extensionPoint != null) {
|
||||
// Get the extensions
|
||||
IExtension[] extensions = extensionPoint.getExtensions();
|
||||
for (int i = 0; i < extensions.length; i++) {
|
||||
// Get the configuration elements of each extension
|
||||
IConfigurationElement[] configElements = extensions[i]
|
||||
.getConfigurationElements();
|
||||
for (int j = 0; j < configElements.length; j++) {
|
||||
|
||||
IConfigurationElement element = configElements[j];
|
||||
|
||||
if (element.getName().equals("converter")) { //$NON-NLS-1$
|
||||
|
||||
fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
toId = element.getAttribute("toId"); //$NON-NLS-1$
|
||||
// Check whether the current converter can be used for
|
||||
// the selected tool
|
||||
|
||||
if (fromId.equals(getSuperClass().getId())
|
||||
&& toId.equals(convertToId)) {
|
||||
// If it matches
|
||||
String mbsVersion = element
|
||||
.getAttribute("mbsVersion"); //$NON-NLS-1$
|
||||
PluginVersionIdentifier currentMbsVersion = ManagedBuildManager
|
||||
.getBuildInfoVersion();
|
||||
|
||||
// set the converter element based on the MbsVersion
|
||||
if (currentMbsVersion
|
||||
.isGreaterThan(new PluginVersionIdentifier(
|
||||
mbsVersion))) {
|
||||
previousMbsVersionConversionElement = element;
|
||||
} else {
|
||||
currentMbsVersionConversionElement = element;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If control comes here, it means 'Tool Integrator' specified
|
||||
// 'convertToId' attribute in toolchain definition file, but
|
||||
// has not provided any converter.
|
||||
// So, make the project is invalid
|
||||
|
||||
// It means there are no entries in the map for the given id.
|
||||
// make the project is invalid
|
||||
IToolChain parent = (IToolChain) getParent();
|
||||
IConfiguration parentConfig = parent.getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public IConfigurationElement getPreviousMbsVersionConversionElement() {
|
||||
return previousMbsVersionConversionElement;
|
||||
}
|
||||
|
||||
public IConfigurationElement getCurrentMbsVersionConversionElement() {
|
||||
return currentMbsVersionConversionElement;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
|
@ -22,6 +23,7 @@ import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
|||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOutputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITargetPlatform;
|
||||
|
@ -33,6 +35,10 @@ import org.eclipse.cdt.managedbuilder.internal.macros.StorableMacros;
|
|||
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -80,6 +86,9 @@ public class ToolChain extends HoldsOptions implements IToolChain {
|
|||
//holds the user-defined macros
|
||||
private StorableMacros userDefinedMacros;
|
||||
|
||||
private IConfigurationElement previousMbsVersionConversionElement = null;
|
||||
private IConfigurationElement currentMbsVersionConversionElement = null;
|
||||
|
||||
/*
|
||||
* C O N S T R U C T O R S
|
||||
*/
|
||||
|
@ -473,9 +482,8 @@ public class ToolChain extends HoldsOptions implements IToolChain {
|
|||
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
|
||||
if (superClassId != null && superClassId.length() > 0) {
|
||||
setSuperClass( ManagedBuildManager.getExtensionToolChain(superClassId) );
|
||||
if (getSuperClass() == null) {
|
||||
// TODO: Report error
|
||||
}
|
||||
// Check for migration support
|
||||
checkForMigrationSupport();
|
||||
}
|
||||
|
||||
// Get the unused children, if any
|
||||
|
@ -1460,4 +1468,191 @@ public class ToolChain extends HoldsOptions implements IToolChain {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function checks for migration support for the toolchain, while
|
||||
* loading. If migration support is needed, looks for the available
|
||||
* converters and adds them to the list.
|
||||
*/
|
||||
|
||||
private void checkForMigrationSupport() {
|
||||
|
||||
String tmpId = null;
|
||||
boolean isExists = false;
|
||||
|
||||
if (getSuperClass() == null) {
|
||||
// If 'getSuperClass()' is null, then there is no toolchain available in
|
||||
// plugin manifest file with the 'id' & version.
|
||||
// Look for the 'versionsSupported' attribute
|
||||
String high = (String) ManagedBuildManager
|
||||
.getExtensionToolChainMap().lastKey();
|
||||
|
||||
SortedMap subMap = null;
|
||||
if (superClassId.compareTo(high) <= 0) {
|
||||
subMap = ManagedBuildManager.getExtensionToolChainMap().subMap(
|
||||
superClassId, high + "\0"); //$NON-NLS-1$
|
||||
} else {
|
||||
// It means there are no entries in the map for the given id.
|
||||
// make the project is invalid
|
||||
IConfiguration parentConfig = getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// for each element in the 'subMap',
|
||||
// check the 'versionsSupported' attribute whether the given
|
||||
// toolChain version is supported
|
||||
|
||||
String baseId = ManagedBuildManager.getIdFromIdAndVersion(superClassId);
|
||||
String version = ManagedBuildManager.getVersionFromIdAndVersion(superClassId);
|
||||
|
||||
IToolChain[] toolChainElements = (IToolChain[]) subMap.values().toArray();
|
||||
|
||||
for (int i = 0; i < toolChainElements.length; i++) {
|
||||
IToolChain toolChainElement = toolChainElements[i];
|
||||
|
||||
if (ManagedBuildManager.getIdFromIdAndVersion(
|
||||
toolChainElement.getId()).compareTo(baseId) > 0)
|
||||
break;
|
||||
|
||||
// First check if both base ids are equal
|
||||
if (ManagedBuildManager.getIdFromIdAndVersion(
|
||||
toolChainElement.getId()).equals(baseId)) {
|
||||
|
||||
// Check if 'versionsSupported' attribute is available'
|
||||
String versionsSupported = toolChainElement.getVersionsSupported();
|
||||
|
||||
if ((versionsSupported != null)
|
||||
&& (!versionsSupported.equals(""))) { //$NON-NLS-1$
|
||||
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
|
||||
|
||||
for (int j = 0; j < tmpVersions.length; j++) {
|
||||
if (new PluginVersionIdentifier(version).equals(new PluginVersionIdentifier(tmpVersions[j]))) {
|
||||
// version is supported.
|
||||
// Do the automatic conversion without
|
||||
// prompting the user.
|
||||
// Get the supported version
|
||||
String supportedVersion = ManagedBuildManager.getVersionFromIdAndVersion(
|
||||
toolChainElement.getId());
|
||||
setId(ManagedBuildManager.getIdFromIdAndVersion(getId())
|
||||
+ "_" + supportedVersion); //$NON-NLS-1$
|
||||
|
||||
// If control comes here means that 'superClass' is null
|
||||
// So, set the superClass to this toolChain element
|
||||
setSuperClass(toolChainElement);
|
||||
superClassId = getSuperClass().getId();
|
||||
isExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isExists)
|
||||
break; // break the outer for loop if 'isExists' is true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getSuperClass() != null) {
|
||||
// If 'getSuperClass()' is not null, look for 'convertToId' attribute in plugin
|
||||
// manifest file for this toolchain.
|
||||
String convertToId = getSuperClass().getConvertToId();
|
||||
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$
|
||||
// It means there is no 'convertToId' attribute available and
|
||||
// the version is still actively
|
||||
// supported by the tool integrator. So do nothing, just return
|
||||
return;
|
||||
} else {
|
||||
// In case the 'convertToId' attribute is available,
|
||||
// it means that Tool integrator currently does not support this
|
||||
// version of toolchain.
|
||||
// Look for the converters available for this toolchain version.
|
||||
|
||||
getConverter(convertToId);
|
||||
}
|
||||
|
||||
} else {
|
||||
// make the project is invalid
|
||||
//
|
||||
IConfiguration parentConfig = getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void getConverter(String convertToId) {
|
||||
|
||||
String fromId = null;
|
||||
String toId = null;
|
||||
|
||||
// Get the Converter Extension Point
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
|
||||
.getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
|
||||
"projectConverter"); //$NON-NLS-1$
|
||||
if (extensionPoint != null) {
|
||||
// Get the extensions
|
||||
IExtension[] extensions = extensionPoint.getExtensions();
|
||||
for (int i = 0; i < extensions.length; i++) {
|
||||
// Get the configuration elements of each extension
|
||||
IConfigurationElement[] configElements = extensions[i]
|
||||
.getConfigurationElements();
|
||||
for (int j = 0; j < configElements.length; j++) {
|
||||
|
||||
IConfigurationElement element = configElements[j];
|
||||
|
||||
if (element.getName().equals("converter")) { //$NON-NLS-1$
|
||||
|
||||
fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
toId = element.getAttribute("toId"); //$NON-NLS-1$
|
||||
// Check whether the current converter can be used for
|
||||
// the selected toolchain
|
||||
|
||||
if (fromId.equals(getSuperClass().getId())
|
||||
&& toId.equals(convertToId)) {
|
||||
// If it matches
|
||||
String mbsVersion = element
|
||||
.getAttribute("mbsVersion"); //$NON-NLS-1$
|
||||
PluginVersionIdentifier currentMbsVersion = ManagedBuildManager
|
||||
.getBuildInfoVersion();
|
||||
|
||||
// set the converter element based on the MbsVersion
|
||||
if (currentMbsVersion
|
||||
.isGreaterThan(new PluginVersionIdentifier(
|
||||
mbsVersion))) {
|
||||
previousMbsVersionConversionElement = element;
|
||||
} else {
|
||||
currentMbsVersionConversionElement = element;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If control comes here, it means 'Tool Integrator' specified
|
||||
// 'convertToId' attribute in toolchain definition file, but
|
||||
// has not provided any converter.
|
||||
// So, make the project is invalid
|
||||
|
||||
IConfiguration parentConfig = getParent();
|
||||
IManagedProject managedProject = parentConfig.getManagedProject();
|
||||
if (managedProject != null) {
|
||||
managedProject.setValid(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IConfigurationElement getPreviousMbsVersionConversionElement() {
|
||||
return previousMbsVersionConversionElement;
|
||||
}
|
||||
|
||||
public IConfigurationElement getCurrentMbsVersionConversionElement() {
|
||||
return currentMbsVersionConversionElement;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.managedbuilder.internal.ui;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.ui.actions.ConvertTargetAction;
|
||||
import org.eclipse.ui.IStartup;
|
||||
|
||||
|
||||
public class ConvertStartup implements IStartup {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IStartup#earlyStartup()
|
||||
*/
|
||||
/*
|
||||
* This code is needed incase we want to add cascading menu for project converters in UI.
|
||||
*/
|
||||
public void earlyStartup() {
|
||||
ConvertTargetAction.initStartup();
|
||||
}
|
||||
}
|
|
@ -276,6 +276,10 @@ ManageConfig.label.rename.config.dialog=Rename configuration
|
|||
ManageConfig.deletedialog.message=Are you sure you want to delete the "{0}" configuration?
|
||||
ManageConfig.deletedialog.title=Confirm Delete
|
||||
|
||||
# Toolchain Conversion Target confirmation Dialog
|
||||
ConfigurationConvert.confirmdialog.message=Currently the "{0}" Configuration uses "{1}" tool-chain. After conversion it will use "{2}" tool-chain. Do you want to proceed?
|
||||
ConfigurationConvert.confirmdialog.title=Confirm Configuration Conversion
|
||||
|
||||
# ----------- Build Property Common -----------
|
||||
BuildPropertyCommon.label.title=Enter Value
|
||||
BuildPropertyCommon.label.new=New...
|
||||
|
|
|
@ -0,0 +1,236 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.ui.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IConvertManagedBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IObjectActionDelegate;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.actions.ActionDelegate;
|
||||
|
||||
public class ConvertTargetAction
|
||||
extends ActionDelegate
|
||||
implements IObjectActionDelegate {
|
||||
|
||||
private String converterId = null;
|
||||
private String fromId = null;
|
||||
private String toId = null;
|
||||
private IConvertManagedBuildObject convertBuildObject = null;
|
||||
private IProject selectedProject = null;
|
||||
|
||||
public static void initStartup() {
|
||||
return;
|
||||
}
|
||||
|
||||
public void initConvertAction(IAction action) {
|
||||
convertBuildObject = null;
|
||||
String id = action.getId();
|
||||
try {
|
||||
|
||||
// Get the Converter Extension Point
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
|
||||
.getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
|
||||
"projectConverter"); //$NON-NLS-1$
|
||||
if (extensionPoint != null) {
|
||||
// Get the Converter Extensions
|
||||
IExtension[] extensions = extensionPoint.getExtensions();
|
||||
List list = new ArrayList(extensions.length);
|
||||
for (int i = 0; i < extensions.length; i++) {
|
||||
|
||||
// Get the configuration elements for each extension
|
||||
IConfigurationElement[] configElements = extensions[i]
|
||||
.getConfigurationElements();
|
||||
|
||||
for (int j = 0; j < configElements.length; j++) {
|
||||
IConfigurationElement element = configElements[j];
|
||||
|
||||
if (element.getName().equals("converter")) { //$NON-NLS-1$
|
||||
// Get the converter 'id'
|
||||
String tmpConverterID = element.getAttribute("id"); //$NON-NLS-1$
|
||||
// If the converter 'id' and action 'id' are same.
|
||||
if (id.equals(tmpConverterID)) {
|
||||
|
||||
convertBuildObject = (IConvertManagedBuildObject) element
|
||||
.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
toId = element.getAttribute("toId"); //$NON-NLS-1$
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
}
|
||||
|
||||
public void selectionChanged(IAction action, ISelection selection) {
|
||||
initConvertAction(action);
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
IStructuredSelection sel = (IStructuredSelection) selection;
|
||||
Object obj = sel.getFirstElement();
|
||||
if (obj instanceof IProject) {
|
||||
IProject project = (IProject)obj;
|
||||
|
||||
// Save the selected project.
|
||||
setSelectedProject(project);
|
||||
|
||||
// If the project does not have managed build nature then disable the action.
|
||||
try {
|
||||
if(!project.hasNature("org.eclipse.cdt.managedbuilder.core.managedBuildNature")) { //$NON-NLS-1$
|
||||
action.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
// e.printStackTrace();
|
||||
}
|
||||
|
||||
// Get the projectType of the project.
|
||||
IProjectType projectType = getProjectType(project);
|
||||
|
||||
// Check whether the Converter can convert the selected project.
|
||||
if( isProjectConvertable(projectType))
|
||||
action.setEnabled(true);
|
||||
else
|
||||
action.setEnabled(false);
|
||||
} else {
|
||||
action.setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IProjectType getProjectType(IProject project) {
|
||||
IProjectType projectType = null;
|
||||
|
||||
// Get the projectType from project.
|
||||
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
|
||||
if (info != null) {
|
||||
IManagedProject managedProject = info.getManagedProject();
|
||||
projectType = managedProject.getProjectType();
|
||||
}
|
||||
return projectType;
|
||||
}
|
||||
|
||||
|
||||
private boolean isProjectConvertable(IProjectType projectType) {
|
||||
|
||||
IProjectType tmpProjectType = projectType;
|
||||
|
||||
// Check whether the converter can convert the given projectType
|
||||
if(fromId == null)
|
||||
return false;
|
||||
|
||||
while( tmpProjectType != null) {
|
||||
String id = tmpProjectType.getId();
|
||||
|
||||
if (fromId.equals(id))
|
||||
return true;
|
||||
else
|
||||
tmpProjectType = tmpProjectType.getSuperClass();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void run(IAction action) {
|
||||
if( convertBuildObject != null) {
|
||||
// Get the confirmation from user before converting the selected project
|
||||
Shell shell = ManagedBuilderUIPlugin.getDefault().getShell();
|
||||
boolean shouldConvert = MessageDialog.openQuestion(shell,
|
||||
ManagedBuilderUIMessages.getResourceString("ProjectConvert.confirmdialog.title"), //$NON-NLS-1$
|
||||
ManagedBuilderUIMessages.getFormattedString("ProjectConvert.confirmdialog.message", //$NON-NLS-1$
|
||||
new String[] {getSelectedProject().getName()}));
|
||||
|
||||
if (shouldConvert) {
|
||||
convertBuildObject.convert( getProjectType(getSelectedProject()), getFromId(), getToId(), true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private IConvertManagedBuildObject getConvertBuildObject() {
|
||||
return convertBuildObject;
|
||||
}
|
||||
|
||||
private void setConvertBuildObject(IConvertManagedBuildObject convertBuildObject) {
|
||||
this.convertBuildObject = convertBuildObject;
|
||||
}
|
||||
|
||||
private String getConverterId() {
|
||||
return converterId;
|
||||
}
|
||||
|
||||
private void setConverterId(String converterId) {
|
||||
this.converterId = converterId;
|
||||
}
|
||||
|
||||
private String getFromId() {
|
||||
return fromId;
|
||||
}
|
||||
|
||||
private void setFromId(String fromId) {
|
||||
this.fromId = fromId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the selectedProject.
|
||||
*/
|
||||
private IProject getSelectedProject() {
|
||||
return selectedProject;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param selectedProject The selectedProject to set.
|
||||
*/
|
||||
private void setSelectedProject(IProject selectedProject) {
|
||||
this.selectedProject = selectedProject;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the toId.
|
||||
*/
|
||||
private String getToId() {
|
||||
return toId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param toId The toId to set.
|
||||
*/
|
||||
private void setToId(String toId) {
|
||||
this.toId = toId;
|
||||
}
|
||||
}
|
|
@ -14,14 +14,21 @@ import java.util.ArrayList;
|
|||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IConvertManagedBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages;
|
||||
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.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
|
@ -83,6 +90,11 @@ public class ManageConfigDialog extends Dialog {
|
|||
|
||||
private Combo conversionTargetSelector;
|
||||
private Button convertTargetBtn;
|
||||
private Composite conversionGroup;
|
||||
|
||||
// The list of conversion targets for the selected configuration
|
||||
private SortedMap conversionTargets;
|
||||
|
||||
// Widgets
|
||||
protected List currentConfigList;
|
||||
|
||||
|
@ -173,13 +185,15 @@ public class ManageConfigDialog extends Dialog {
|
|||
});
|
||||
|
||||
// Create a composite for the conversion target combo
|
||||
final Composite conversionGroup = new Composite(configListGroup, SWT.NULL);
|
||||
// final Composite conversionGroup = new Composite(configListGroup, SWT.NULL);
|
||||
conversionGroup = new Composite(configListGroup, SWT.NULL);
|
||||
conversionGroup.setFont(configListGroup.getFont());
|
||||
conversionGroup.setLayout(new GridLayout(2, true));
|
||||
conversionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
// Create the Tool chain conversion target list
|
||||
Label conversionTargetLabel = ControlFactory.createLabel(conversionGroup, ManagedBuilderUIMessages.getResourceString(CONVERSION_TARGET_LABEL));
|
||||
|
||||
conversionTargetSelector = new Combo(conversionGroup, SWT.READ_ONLY|SWT.DROP_DOWN);
|
||||
conversionTargetSelector.addListener(SWT.Selection, new Listener () {
|
||||
public void handleEvent(Event e) {
|
||||
|
@ -187,6 +201,7 @@ public class ManageConfigDialog extends Dialog {
|
|||
}
|
||||
});
|
||||
conversionTargetSelector.setToolTipText(ManagedBuilderUIMessages.getResourceString(CONVERSION_TARGET_TIP));
|
||||
conversionTargetSelector.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
// Create a composite for the buttons
|
||||
final Composite buttonBar = new Composite(configListGroup, SWT.NULL);
|
||||
|
@ -250,9 +265,38 @@ public class ManageConfigDialog extends Dialog {
|
|||
}
|
||||
|
||||
private void handleConversionTargetSelection() {
|
||||
return;
|
||||
IConfigurationElement element = null;
|
||||
String selectedConversionTargetName = null;
|
||||
|
||||
// Determine which conversion target was selected
|
||||
int selectionIndex = conversionTargetSelector.getSelectionIndex();
|
||||
if (selectionIndex != -1) {
|
||||
// Get the converter based on selection
|
||||
selectedConversionTargetName = conversionTargetSelector.getItem(selectionIndex);
|
||||
element = (IConfigurationElement) getConversionTargets().get(selectedConversionTargetName);
|
||||
|
||||
// Get the confirmation from the user
|
||||
Shell shell = ManagedBuilderUIPlugin.getDefault().getShell();
|
||||
boolean shouldConvert = MessageDialog.openQuestion(shell,
|
||||
ManagedBuilderUIMessages.getResourceString("ConfigurationConvert.confirmdialog.title"), //$NON-NLS-1$
|
||||
ManagedBuilderUIMessages.getFormattedString("ConfigurationConvert.confirmdialog.message", //$NON-NLS-1$
|
||||
new String[] {getSelectedConfiguration().getName(), getSelectedConfiguration().getToolChain().getName(), element.getAttribute("name")})); //$NON-NLS-1$
|
||||
if (shouldConvert) {
|
||||
IConvertManagedBuildObject convertBuildObject = null;
|
||||
try {
|
||||
convertBuildObject = (IConvertManagedBuildObject) element.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
} catch (CoreException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
String fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
String toId = element.getAttribute("toId"); //$NON-NLS-1$
|
||||
|
||||
if(convertBuildObject != null )
|
||||
convertBuildObject.convert( getSelectedConfiguration().getToolChain(), fromId, toId, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
|
@ -289,17 +333,71 @@ public class ManageConfigDialog extends Dialog {
|
|||
}
|
||||
|
||||
private String [] getConversionTargetList(IConfiguration config) {
|
||||
// This is temporary, once I implement backend & converter extension point,
|
||||
// this will be replaced with original code.
|
||||
String [] conversionTargetNames = { "GNU Toolchain version 4.0"}; //$NON-NLS-1$
|
||||
return conversionTargetNames;
|
||||
|
||||
String []emptyList = new String[0];
|
||||
|
||||
String fromId = null;
|
||||
|
||||
// Get the id of the toolchain used in the given configuration.
|
||||
String id = config.getToolChain().getId();
|
||||
|
||||
// Clear the conversionTargets list.
|
||||
getConversionTargets().clear();
|
||||
|
||||
// Get the Converter Extension Point
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
|
||||
.getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
|
||||
"projectConverter"); //$NON-NLS-1$
|
||||
if (extensionPoint != null) {
|
||||
// Get the extensions
|
||||
IExtension[] extensions = extensionPoint.getExtensions();
|
||||
for (int i = 0; i < extensions.length; i++) {
|
||||
// Get the configuration elements of each extension
|
||||
IConfigurationElement[] configElements = extensions[i]
|
||||
.getConfigurationElements();
|
||||
for (int j = 0; j < configElements.length; j++) {
|
||||
|
||||
IConfigurationElement element = configElements[j];
|
||||
if (element.getName().equals("converter")) { //$NON-NLS-1$
|
||||
|
||||
fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
// Check whether the current converter can be used for the selected configuration(toolchain)
|
||||
if (hasToolChainConverters(config.getToolChain(), fromId)) {
|
||||
// Add this converter to the display list
|
||||
getConversionTargets().put( element.getAttribute("name"), element); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( getConversionTargets().isEmpty())
|
||||
return (String []) emptyList;
|
||||
else
|
||||
return (String []) getConversionTargets().keySet().toArray(new String[getConversionTargets().size()]);
|
||||
}
|
||||
|
||||
private boolean hasToolChainConverters(IToolChain toolChain, String fromId) {
|
||||
|
||||
// Check whether the converter's 'fromId' and the given toolChain 'id' are equal
|
||||
if(fromId == null)
|
||||
return false;
|
||||
|
||||
while( toolChain != null) {
|
||||
String id = toolChain.getId();
|
||||
|
||||
if (fromId.equals(id))
|
||||
return true;
|
||||
else
|
||||
toolChain = toolChain.getSuperClass();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void updateConversionTargets(IConfiguration config) {
|
||||
conversionTargetSelector.setItems( getConversionTargetList(config));
|
||||
conversionTargetSelector.select(0);
|
||||
conversionTargetSelector.setEnabled(conversionTargetSelector.getItemCount() > 1);
|
||||
convertTargetBtn.setEnabled( conversionTargetSelector.getItemCount() > 1);
|
||||
conversionGroup.setEnabled(conversionTargetSelector.getItemCount() > 0);
|
||||
convertTargetBtn.setEnabled( conversionTargetSelector.getItemCount() > 0);
|
||||
}
|
||||
|
||||
private String [] getConfigurationNamesAndDescriptions() {
|
||||
|
@ -337,6 +435,13 @@ public class ManageConfigDialog extends Dialog {
|
|||
}
|
||||
|
||||
|
||||
protected SortedMap getConversionTargets() {
|
||||
if (conversionTargets == null) {
|
||||
conversionTargets = new TreeMap();
|
||||
}
|
||||
return conversionTargets;
|
||||
}
|
||||
|
||||
/*
|
||||
* @return the <code>IProject</code> associated with the managed project
|
||||
*/
|
||||
|
@ -525,7 +630,7 @@ public class ManageConfigDialog extends Dialog {
|
|||
private void updateButtons() {
|
||||
// Disable the remove button if there is only 1 configuration
|
||||
removeBtn.setEnabled(currentConfigList.getItemCount() > 1);
|
||||
convertTargetBtn.setEnabled( conversionTargetSelector.getItemCount() > 1);
|
||||
convertTargetBtn.setEnabled( conversionTargetSelector.getItemCount() > 0);
|
||||
}
|
||||
|
||||
private void handleConfigSelection() {
|
||||
|
|
Loading…
Add table
Reference in a new issue