mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-18 05:35:45 +02:00
Clean up
This commit is contained in:
parent
95886b4f65
commit
1e208208ed
17 changed files with 2615 additions and 2686 deletions
File diff suppressed because it is too large
Load diff
|
@ -174,11 +174,11 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns default language settings providers IDs specified for the configuration.
|
* Returns default language settings providers IDs specified for the configuration.
|
||||||
* @return default language settings providers IDs.
|
* @return default language settings providers IDs or {@code null}.
|
||||||
*
|
*
|
||||||
* @since 8.1
|
* @since 8.1
|
||||||
*/
|
*/
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds();
|
public String[] getDefaultLanguageSettingsProviderIds();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Projects have C or CC natures. Tools can specify a filter so they are not
|
* Projects have C or CC natures. Tools can specify a filter so they are not
|
||||||
|
|
|
@ -271,7 +271,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
||||||
*
|
*
|
||||||
* @since 8.1
|
* @since 8.1
|
||||||
*/
|
*/
|
||||||
public String getDefaultLanguageSettingsProvidersIds();
|
public String getDefaultLanguageSettingsProviderIds();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
||||||
|
|
|
@ -26,7 +26,6 @@ import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
|
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
|
||||||
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
|
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
|
||||||
import org.eclipse.cdt.core.ErrorParserManager;
|
import org.eclipse.cdt.core.ErrorParserManager;
|
||||||
import org.eclipse.cdt.core.settings.model.CSourceEntry;
|
import org.eclipse.cdt.core.settings.model.CSourceEntry;
|
||||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
|
@ -84,10 +83,8 @@ import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IResourceDelta;
|
import org.eclipse.core.resources.IResourceDelta;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Status;
|
|
||||||
import org.eclipse.osgi.util.NLS;
|
import org.eclipse.osgi.util.NLS;
|
||||||
import org.osgi.framework.Version;
|
import org.osgi.framework.Version;
|
||||||
|
|
||||||
|
@ -96,6 +93,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
|
private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
|
||||||
private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";"; //$NON-NLS-1$
|
private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";"; //$NON-NLS-1$
|
||||||
|
private static final String LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN = "-"; //$NON-NLS-1$
|
||||||
|
private static final String $TOOLCHAIN = "${Toolchain}"; //$NON-NLS-1$
|
||||||
|
|
||||||
// Parent and children
|
// Parent and children
|
||||||
private String parentId;
|
private String parentId;
|
||||||
|
@ -107,7 +106,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
private String artifactExtension;
|
private String artifactExtension;
|
||||||
private String errorParserIds;
|
private String errorParserIds;
|
||||||
private String defaultLanguageSettingsProvidersAttribute;
|
private String defaultLanguageSettingsProvidersAttribute;
|
||||||
private String[] defaultLanguageSettingsProvidersIds;
|
private String[] defaultLanguageSettingsProviderIds;
|
||||||
private String prebuildStep;
|
private String prebuildStep;
|
||||||
private String postbuildStep;
|
private String postbuildStep;
|
||||||
private String preannouncebuildStep;
|
private String preannouncebuildStep;
|
||||||
|
@ -1462,6 +1461,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get value of attribute {@link IConfiguration#LANGUAGE_SETTINGS_PROVIDERS}
|
||||||
|
* It not defined, it will try to pull the attribute from the parent configuration.
|
||||||
|
*/
|
||||||
private String getDefaultLanguageSettingsProvidersAttribute() {
|
private String getDefaultLanguageSettingsProvidersAttribute() {
|
||||||
if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
|
if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
|
||||||
defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
|
defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
|
||||||
|
@ -1470,29 +1473,32 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return defaultLanguageSettingsProvidersAttribute;
|
return defaultLanguageSettingsProvidersAttribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*
|
||||||
|
* This function will try to find default provider Ids specified in this instance.
|
||||||
|
* It none defined, it will try to pull Ids from the parent configuration.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
public String[] getDefaultLanguageSettingsProviderIds() {
|
||||||
defaultLanguageSettingsProvidersIds = null;
|
defaultLanguageSettingsProviderIds = null;
|
||||||
if (defaultLanguageSettingsProvidersIds == null) {
|
if (defaultLanguageSettingsProviderIds == null) {
|
||||||
getDefaultLanguageSettingsProvidersAttribute();
|
defaultLanguageSettingsProvidersAttribute = getDefaultLanguageSettingsProvidersAttribute();
|
||||||
if (defaultLanguageSettingsProvidersAttribute != null) {
|
if (defaultLanguageSettingsProvidersAttribute != null) {
|
||||||
List<String> ids = new ArrayList<String>();
|
List<String> ids = new ArrayList<String>();
|
||||||
String[] defaultIds = defaultLanguageSettingsProvidersAttribute.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
|
String[] defaultIds = defaultLanguageSettingsProvidersAttribute.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
|
||||||
for (String id : defaultIds) {
|
for (String id : defaultIds) {
|
||||||
if (id != null && !id.isEmpty()) {
|
if (id != null && !id.isEmpty()) {
|
||||||
if (id.startsWith("-")) {
|
if (id.startsWith(LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN)) {
|
||||||
id = id.substring(1);
|
id = id.substring(1);
|
||||||
ids.remove(id);
|
ids.remove(id);
|
||||||
} else if (!ids.contains(id)){
|
} else if (!ids.contains(id)) {
|
||||||
if (id.contains("${Toolchain}")) {
|
if (id.contains($TOOLCHAIN)) {
|
||||||
IToolChain toolchain = getToolChain();
|
IToolChain toolchain = getToolChain();
|
||||||
if (toolchain != null) {
|
if (toolchain != null) {
|
||||||
String toolchainProvidersIds = toolchain.getDefaultLanguageSettingsProvidersIds();
|
String toolchainProvidersIds = toolchain.getDefaultLanguageSettingsProviderIds();
|
||||||
if (toolchainProvidersIds != null) {
|
if (toolchainProvidersIds != null) {
|
||||||
ids.addAll(Arrays.asList(toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
|
ids.addAll(Arrays.asList(toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
|
||||||
} else {
|
|
||||||
String message = "Invalid use of ${Toolchain} tag, toolchain does not specify language settings providers. cfg=" + getId();
|
|
||||||
ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, IStatus.ERROR, message, new Exception()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1502,13 +1508,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
defaultLanguageSettingsProvidersIds = ids.toArray(new String[ids.size()]);
|
defaultLanguageSettingsProviderIds = ids.toArray(new String[ids.size()]);
|
||||||
} else if (parent != null) {
|
} else if (parent != null) {
|
||||||
defaultLanguageSettingsProvidersIds = parent.getDefaultLanguageSettingsProvidersIds();
|
defaultLanguageSettingsProviderIds = parent.getDefaultLanguageSettingsProviderIds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultLanguageSettingsProvidersIds;
|
return defaultLanguageSettingsProviderIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -441,7 +441,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
public String[] getDefaultLanguageSettingsProviderIds() {
|
||||||
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode");
|
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
private String targetToolIds;
|
private String targetToolIds;
|
||||||
private String secondaryOutputIds;
|
private String secondaryOutputIds;
|
||||||
private Boolean isAbstract;
|
private Boolean isAbstract;
|
||||||
private String defaultLanguageSettingsProvidersIds;
|
private String defaultLanguageSettingsProviderIds;
|
||||||
private String scannerConfigDiscoveryProfileId;
|
private String scannerConfigDiscoveryProfileId;
|
||||||
private String versionsSupported;
|
private String versionsSupported;
|
||||||
private String convertToId;
|
private String convertToId;
|
||||||
|
@ -559,7 +559,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL));
|
targetToolIds = SafeStringInterner.safeIntern(element.getAttribute(TARGET_TOOL));
|
||||||
|
|
||||||
// Get the initial/default language setttings providers IDs
|
// Get the initial/default language setttings providers IDs
|
||||||
defaultLanguageSettingsProvidersIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
|
defaultLanguageSettingsProviderIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
|
||||||
|
|
||||||
// Get the scanner config discovery profile id
|
// Get the scanner config discovery profile id
|
||||||
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
|
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
|
||||||
|
@ -1537,13 +1537,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDefaultLanguageSettingsProvidersIds() {
|
public String getDefaultLanguageSettingsProviderIds() {
|
||||||
if (defaultLanguageSettingsProvidersIds == null) {
|
if (defaultLanguageSettingsProviderIds == null && superClass instanceof IToolChain) {
|
||||||
if (superClass instanceof IToolChain) {
|
defaultLanguageSettingsProviderIds = ((IToolChain) superClass).getDefaultLanguageSettingsProviderIds();
|
||||||
defaultLanguageSettingsProvidersIds = ((IToolChain) superClass).getDefaultLanguageSettingsProvidersIds();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return defaultLanguageSettingsProvidersIds;
|
return defaultLanguageSettingsProviderIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1552,9 +1550,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
|
private boolean isLanguageSettingsProvidersFunctionalityEnabled() {
|
||||||
boolean isLanguageSettingsProvidersEnabled = false;
|
boolean isLanguageSettingsProvidersEnabled = false;
|
||||||
IConfiguration cfg = getParent();
|
IConfiguration cfg = getParent();
|
||||||
if (cfg!=null) {
|
if (cfg != null) {
|
||||||
IResource rc = cfg.getOwner();
|
IResource rc = cfg.getOwner();
|
||||||
if (rc!=null) {
|
if (rc != null) {
|
||||||
IProject project = rc.getProject();
|
IProject project = rc.getProject();
|
||||||
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
|
isLanguageSettingsProvidersEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
|
||||||
}
|
}
|
||||||
|
@ -1564,11 +1562,13 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temporary method to support compatibility during SD transition.
|
* Temporary method to support compatibility during SD transition.
|
||||||
|
* @see ScannerDiscoveryLegacySupport#getDeprecatedLegacyProfiles(String)
|
||||||
|
*
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public String getLegacyScannerConfigDiscoveryProfileId() {
|
public String getLegacyScannerConfigDiscoveryProfileId() {
|
||||||
String profileId = scannerConfigDiscoveryProfileId;
|
String profileId = scannerConfigDiscoveryProfileId;
|
||||||
if (profileId==null) {
|
if (profileId == null) {
|
||||||
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
|
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
|
||||||
if (profileId == null) {
|
if (profileId == null) {
|
||||||
IToolChain superClass = getSuperClass();
|
IToolChain superClass = getSuperClass();
|
||||||
|
|
|
@ -519,7 +519,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
private static List<ILanguageSettingsProvider> getDefaultLanguageSettingsProviders(IConfiguration cfg) {
|
private static List<ILanguageSettingsProvider> getDefaultLanguageSettingsProviders(IConfiguration cfg) {
|
||||||
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
|
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
|
||||||
String[] ids = cfg.getDefaultLanguageSettingsProvidersIds();
|
String[] ids = cfg.getDefaultLanguageSettingsProviderIds();
|
||||||
if (ids != null) {
|
if (ids != null) {
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
ILanguageSettingsProvider provider = null;
|
ILanguageSettingsProvider provider = null;
|
||||||
|
|
|
@ -208,7 +208,7 @@ public class TestConfiguration implements IConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultLanguageSettingsProvidersIds() {
|
public String[] getDefaultLanguageSettingsProviderIds() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,7 +365,7 @@ public class TestToolchain extends HoldsOptions implements IToolChain {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDefaultLanguageSettingsProvidersIds() {
|
public String getDefaultLanguageSettingsProviderIds() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,7 +274,7 @@ PropertyPageDefsTab_7=Show disc. page names if they are unique. Else show profil
|
||||||
PropertyPageDefsTab_8=Always show names + profile IDs
|
PropertyPageDefsTab_8=Always show names + profile IDs
|
||||||
PropertyPageDefsTab_9=Always show profile IDs only
|
PropertyPageDefsTab_9=Always show profile IDs only
|
||||||
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab
|
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab
|
||||||
PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tabs
|
PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tab and enable language settings providers
|
||||||
ProjectConvert_convertersList=Converters List
|
ProjectConvert_convertersList=Converters List
|
||||||
|
|
||||||
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
|
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
|
@ -23,7 +22,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*
|
*
|
||||||
* @noextend This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
|
@ -31,7 +30,6 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
private Button show_sup;
|
private Button show_sup;
|
||||||
private Button show_oth;
|
private Button show_oth;
|
||||||
private Button checkBoxTryNewSD;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
|
@ -39,34 +37,27 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
||||||
usercomp.setLayout(new GridLayout(1, false));
|
usercomp.setLayout(new GridLayout(1, false));
|
||||||
|
|
||||||
show_sup = new Button(usercomp, SWT.CHECK);
|
show_sup = new Button(usercomp, SWT.CHECK);
|
||||||
show_sup.setText(Messages.WizardDefaultsTab_0);
|
show_sup.setText(Messages.WizardDefaultsTab_0);
|
||||||
show_sup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
show_sup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
show_oth = new Button(usercomp, SWT.CHECK);
|
show_oth = new Button(usercomp, SWT.CHECK);
|
||||||
show_oth.setText(Messages.WizardDefaultsTab_1);
|
show_oth.setText(Messages.WizardDefaultsTab_1);
|
||||||
show_oth.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
show_oth.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
checkBoxTryNewSD = new Button(usercomp, SWT.CHECK);
|
|
||||||
checkBoxTryNewSD.setText(org.eclipse.cdt.internal.ui.newui.Messages.LanguageSettingsProviders_EnableForProject);
|
|
||||||
checkBoxTryNewSD.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
|
||||||
|
|
||||||
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
||||||
show_oth.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS));
|
show_oth.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS));
|
||||||
checkBoxTryNewSD.setSelection(CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performOK() {
|
protected void performOK() {
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOSUPP, !show_sup.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOSUPP, !show_sup.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_OTHERS, show_oth.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_OTHERS, show_oth.getSelection());
|
||||||
CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NEWSD, checkBoxTryNewSD.getSelection());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
show_sup.setSelection(true);
|
show_sup.setSelection(true);
|
||||||
show_oth.setSelection(false);
|
show_oth.setSelection(false);
|
||||||
checkBoxTryNewSD.setSelection(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||||
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
|
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.internal.ui.wizards.ICDTCommonProjectWizard;
|
import org.eclipse.cdt.internal.ui.wizards.ICDTCommonProjectWizard;
|
||||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
||||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
|
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
|
||||||
|
@ -598,20 +599,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
||||||
cfgFirst = cfgDes;
|
cfgFirst = cfgDes;
|
||||||
|
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||||
boolean isTryingNewSD = false;
|
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||||
IWizardPage page = getStartingPage();
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||||
if (page instanceof CDTMainWizardPage) {
|
if (isEnableProvidersPreference) {
|
||||||
isTryingNewSD = ((CDTMainWizardPage)page).isTryingNewSD();
|
|
||||||
}
|
|
||||||
|
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
|
||||||
List<ILanguageSettingsProvider> providers;
|
|
||||||
if (isTryingNewSD) {
|
|
||||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||||
} else {
|
} else {
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
|
@ -31,6 +32,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
|
||||||
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IProjectDescription;
|
import org.eclipse.core.resources.IProjectDescription;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
|
@ -73,7 +75,6 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
|
||||||
final String locationStr = page.getLocation();
|
final String locationStr = page.getLocation();
|
||||||
final boolean isCPP = page.isCPP();
|
final boolean isCPP = page.isCPP();
|
||||||
final IToolChain toolChain = page.getToolChain();
|
final IToolChain toolChain = page.getToolChain();
|
||||||
final boolean isTryingNewSD = page.isTryingNewSD();
|
|
||||||
|
|
||||||
IRunnableWithProgress op = new WorkspaceModifyOperation() {
|
IRunnableWithProgress op = new WorkspaceModifyOperation() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -118,13 +119,12 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
|
||||||
ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||||
|
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||||
if (isTryingNewSD) {
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||||
|
if (isEnableProvidersPreference) {
|
||||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||||
} else {
|
} else {
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||||
|
|
|
@ -16,12 +16,9 @@ import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
|
@ -62,8 +59,8 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
IWorkspaceRoot root;
|
IWorkspaceRoot root;
|
||||||
List tcList;
|
List tcList;
|
||||||
Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>();
|
Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if the user entered a non-empty string in the project name field. In that state, we avoid
|
* True if the user entered a non-empty string in the project name field. In that state, we avoid
|
||||||
* automatically filling the project name field with the directory name (last segment of the location) he
|
* automatically filling the project name field with the directory name (last segment of the location) he
|
||||||
|
@ -71,9 +68,6 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
*/
|
*/
|
||||||
boolean projectNameSetByUser;
|
boolean projectNameSetByUser;
|
||||||
|
|
||||||
private Button checkBoxTryNewSD;
|
|
||||||
|
|
||||||
|
|
||||||
protected NewMakeProjFromExistingPage() {
|
protected NewMakeProjFromExistingPage() {
|
||||||
super(Messages.NewMakeProjFromExistingPage_0);
|
super(Messages.NewMakeProjFromExistingPage_0);
|
||||||
setTitle(Messages.NewMakeProjFromExistingPage_1);
|
setTitle(Messages.NewMakeProjFromExistingPage_1);
|
||||||
|
@ -93,22 +87,6 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
addSourceSelector(comp);
|
addSourceSelector(comp);
|
||||||
addLanguageSelector(comp);
|
addLanguageSelector(comp);
|
||||||
addToolchainSelector(comp);
|
addToolchainSelector(comp);
|
||||||
|
|
||||||
checkBoxTryNewSD = new Button(comp, SWT.CHECK);
|
|
||||||
checkBoxTryNewSD.setText(org.eclipse.cdt.internal.ui.newui.Messages.LanguageSettingsProviders_EnableForProject);
|
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
checkBoxTryNewSD.setLayoutData(gd);
|
|
||||||
|
|
||||||
|
|
||||||
// restore settings from preferences
|
|
||||||
boolean isTryNewSD = true;
|
|
||||||
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(LanguageSettingsProvidersPage.KEY_NEWSD);
|
|
||||||
if (contains) {
|
|
||||||
isTryNewSD = CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD);
|
|
||||||
}
|
|
||||||
checkBoxTryNewSD.setSelection(isTryNewSD);
|
|
||||||
|
|
||||||
setControl(comp);
|
setControl(comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +109,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Note that the modify listener gets called not only when the user enters text but also when we
|
// Note that the modify listener gets called not only when the user enters text but also when we
|
||||||
// programatically set the field. This listener only gets called when the user modifies the field
|
// programatically set the field. This listener only gets called when the user modifies the field
|
||||||
projectName.addKeyListener(new KeyAdapter() {
|
projectName.addKeyListener(new KeyAdapter() {
|
||||||
|
@ -141,17 +119,17 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the contents of the page, setting the page error message and Finish button state accordingly
|
* Validates the contents of the page, setting the page error message and Finish button state accordingly
|
||||||
*
|
*
|
||||||
* @since 8.1
|
* @since 8.1
|
||||||
*/
|
*/
|
||||||
protected void validatePage() {
|
protected void validatePage() {
|
||||||
// Don't generate an error if project name or location is empty, but do disable Finish button.
|
// Don't generate an error if project name or location is empty, but do disable Finish button.
|
||||||
String msg = null;
|
String msg = null;
|
||||||
boolean complete = true; // ultimately treated as false if msg != null
|
boolean complete = true; // ultimately treated as false if msg != null
|
||||||
|
|
||||||
String name = getProjectName();
|
String name = getProjectName();
|
||||||
if (name.isEmpty()) {
|
if (name.isEmpty()) {
|
||||||
complete = false;
|
complete = false;
|
||||||
|
@ -279,11 +257,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
|
|
||||||
tcList = new List(group, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
|
tcList = new List(group, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
|
||||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||||
|
|
||||||
// Base the List control size on the number of total toolchains, up to 15 entries, but allocate for no
|
// Base the List control size on the number of total toolchains, up to 15 entries, but allocate for no
|
||||||
// less than five (small list boxes look strange). A vertical scrollbar will appear as needed
|
// less than five (small list boxes look strange). A vertical scrollbar will appear as needed
|
||||||
updateTcMap(false);
|
updateTcMap(false);
|
||||||
gd.heightHint = tcList.getItemHeight() * (1 + Math.max(Math.min(tcMap.size(), 15), 5)); // +1 for <none>
|
gd.heightHint = tcList.getItemHeight() * (1 + Math.max(Math.min(tcMap.size(), 15), 5)); // +1 for <none>
|
||||||
tcList.setLayoutData(gd);
|
tcList.setLayoutData(gd);
|
||||||
tcList.add(Messages.NewMakeProjFromExistingPage_11);
|
tcList.add(Messages.NewMakeProjFromExistingPage_11);
|
||||||
|
|
||||||
|
@ -301,11 +279,11 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
|
|
||||||
supportedOnly.setSelection(true);
|
supportedOnly.setSelection(true);
|
||||||
updateTcWidget(true);
|
updateTcWidget(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load our map and with the suitable toolchains and then populate the List control
|
* Load our map and with the suitable toolchains and then populate the List control
|
||||||
*
|
*
|
||||||
* @param supportedOnly
|
* @param supportedOnly
|
||||||
* if true, consider only supported toolchains
|
* if true, consider only supported toolchains
|
||||||
*/
|
*/
|
||||||
|
@ -324,7 +302,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load our map with the suitable toolchains.
|
* Load our map with the suitable toolchains.
|
||||||
*
|
*
|
||||||
* @param supportedOnly
|
* @param supportedOnly
|
||||||
* if true, add only toolchains that are available and which support the host platform
|
* if true, add only toolchains that are available and which support the host platform
|
||||||
*/
|
*/
|
||||||
|
@ -364,11 +342,4 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
||||||
return selection.length != 0 ? tcMap.get(selection[0]) : null;
|
return selection.length != 0 ? tcMap.get(selection[0]) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* AG FIXME temporary method to be removed before CDT Juno release.
|
|
||||||
* @since 8.1
|
|
||||||
*/
|
|
||||||
public boolean isTryingNewSD() {
|
|
||||||
return checkBoxTryNewSD.getSelection();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||||
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
|
@ -28,6 +29,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||||
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
|
import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -52,7 +54,7 @@ public class STDWizardHandler extends MBSWizardHandler {
|
||||||
full_tcs.put(Messages.StdProjectTypeHandler_0, null);
|
full_tcs.put(Messages.StdProjectTypeHandler_0, null);
|
||||||
} else {
|
} else {
|
||||||
if (tc.isAbstract() || tc.isSystemObject()) return;
|
if (tc.isAbstract() || tc.isSystemObject()) return;
|
||||||
// unlike CWizardHandler, we don't check for configs
|
// unlike CWizardHandler, we don't check for configs
|
||||||
full_tcs.put(tc.getUniqueRealName(), tc);
|
full_tcs.put(tc.getUniqueRealName(), tc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,61 +78,54 @@ public class STDWizardHandler extends MBSWizardHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
|
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
|
||||||
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
||||||
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
||||||
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
||||||
ManagedProject mProj = new ManagedProject(des);
|
ManagedProject mProj = new ManagedProject(des);
|
||||||
info.setManagedProject(mProj);
|
info.setManagedProject(mProj);
|
||||||
monitor.worked(20);
|
monitor.worked(20);
|
||||||
cfgs = CfgHolder.unique(getCfgItems(false));
|
cfgs = CfgHolder.unique(getCfgItems(false));
|
||||||
cfgs = CfgHolder.reorder(cfgs);
|
cfgs = CfgHolder.reorder(cfgs);
|
||||||
int work = 50/cfgs.length;
|
int work = 50/cfgs.length;
|
||||||
for (int i=0; i<cfgs.length; i++) {
|
for (int i=0; i<cfgs.length; i++) {
|
||||||
String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
|
String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
|
||||||
Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
|
Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
|
||||||
cfgs[i].setConfiguration(cfg);
|
cfgs[i].setConfiguration(cfg);
|
||||||
IBuilder bld = cfg.getEditableBuilder();
|
IBuilder bld = cfg.getEditableBuilder();
|
||||||
if (bld != null) {
|
if (bld != null) {
|
||||||
if(bld.isInternalBuilder()){
|
if(bld.isInternalBuilder()){
|
||||||
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
|
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
|
||||||
IBuilder prefBuilder = prefCfg.getBuilder();
|
IBuilder prefBuilder = prefCfg.getBuilder();
|
||||||
cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
|
cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
|
||||||
bld = cfg.getEditableBuilder();
|
bld = cfg.getEditableBuilder();
|
||||||
bld.setBuildPath(null);
|
bld.setBuildPath(null);
|
||||||
}
|
}
|
||||||
bld.setManagedBuildOn(false);
|
bld.setManagedBuildOn(false);
|
||||||
} else {
|
} else {
|
||||||
System.out.println(Messages.StdProjectTypeHandler_3);
|
System.out.println(Messages.StdProjectTypeHandler_3);
|
||||||
}
|
}
|
||||||
cfg.setArtifactName(mProj.getDefaultArtifactName());
|
cfg.setArtifactName(mProj.getDefaultArtifactName());
|
||||||
CConfigurationData data = cfg.getConfigurationData();
|
CConfigurationData data = cfg.getConfigurationData();
|
||||||
ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||||
|
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||||
boolean isTryingNewSD = false;
|
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||||
IWizardPage page = getStartingPage();
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||||
if (page instanceof CDTMainWizardPage) {
|
if (isEnableProvidersPreference) {
|
||||||
isTryingNewSD = ((CDTMainWizardPage)page).isTryingNewSD();
|
|
||||||
}
|
|
||||||
|
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isTryingNewSD);
|
|
||||||
if (isTryingNewSD) {
|
|
||||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(cfg, cfgDes);
|
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(cfg, cfgDes);
|
||||||
} else {
|
} else {
|
||||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.worked(work);
|
monitor.worked(work);
|
||||||
}
|
}
|
||||||
mngr.setProjectDescription(project, des);
|
mngr.setProjectDescription(project, des);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canCreateWithoutToolchain() {
|
public boolean canCreateWithoutToolchain() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -138,7 +133,7 @@ public class STDWizardHandler extends MBSWizardHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
|
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
|
||||||
setProjectDescription(proj, true, true, monitor);
|
setProjectDescription(proj, true, true, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,8 +26,6 @@ import org.eclipse.cdt.ui.newui.ICPropertyTab;
|
||||||
public class LanguageSettingsProvidersPage extends AbstractPage {
|
public class LanguageSettingsProvidersPage extends AbstractPage {
|
||||||
/** @since 5.4 */ // temporary key, subject to removal
|
/** @since 5.4 */ // temporary key, subject to removal
|
||||||
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
||||||
/** @since 5.4 */ // temporary key, subject to removal
|
|
||||||
public static final String KEY_NEWSD = "wizard.try.new.sd.enable"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
private static boolean isLanguageSettingsProvidersEnabled = false;
|
private static boolean isLanguageSettingsProvidersEnabled = false;
|
||||||
private static IProject project = null;
|
private static IProject project = null;
|
||||||
|
|
|
@ -50,7 +50,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.cdt.ui.newui.PageLayout;
|
import org.eclipse.cdt.ui.newui.PageLayout;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
|
||||||
import org.eclipse.cdt.internal.ui.newui.Messages;
|
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
|
|
||||||
public class CDTMainWizardPage extends WizardNewProjectCreationPage implements IWizardItemsListListener {
|
public class CDTMainWizardPage extends WizardNewProjectCreationPage implements IWizardItemsListListener {
|
||||||
|
@ -68,7 +67,6 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
private Tree tree;
|
private Tree tree;
|
||||||
private Composite right;
|
private Composite right;
|
||||||
private Button show_sup;
|
private Button show_sup;
|
||||||
private Button checkBoxTryNewSD;
|
|
||||||
private Label right_label;
|
private Label right_label;
|
||||||
|
|
||||||
public CWizardHandler h_selected = null;
|
public CWizardHandler h_selected = null;
|
||||||
|
@ -156,20 +154,6 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
|
|
||||||
// restore settings from preferences
|
// restore settings from preferences
|
||||||
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
show_sup.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOSUPP));
|
||||||
|
|
||||||
checkBoxTryNewSD = new Button(c, SWT.CHECK);
|
|
||||||
checkBoxTryNewSD.setText(Messages.LanguageSettingsProviders_EnableForProject);
|
|
||||||
/* GridData */gd = new GridData(GridData.FILL_HORIZONTAL);
|
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
checkBoxTryNewSD.setLayoutData(gd);
|
|
||||||
|
|
||||||
// restore settings from preferences
|
|
||||||
boolean isTryNewSD = true;
|
|
||||||
boolean contains = CUIPlugin.getDefault().getPreferenceStore().contains(LanguageSettingsProvidersPage.KEY_NEWSD);
|
|
||||||
if (contains) {
|
|
||||||
isTryNewSD = CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NEWSD);
|
|
||||||
}
|
|
||||||
checkBoxTryNewSD.setSelection(isTryNewSD);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -497,13 +481,5 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
public List filterItems(List items) {
|
public List filterItems(List items) {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* AG FIXME - remove before CDT Juno release.
|
|
||||||
* @since 5.4
|
|
||||||
*/
|
|
||||||
public boolean isTryingNewSD() {
|
|
||||||
return checkBoxTryNewSD.getSelection();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue