mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Clean up wizards
This commit is contained in:
parent
1c826045e9
commit
56f5df2f68
6 changed files with 40 additions and 80 deletions
|
@ -461,7 +461,6 @@
|
|||
helpId="cdt_u_prop_pns_sym"
|
||||
parent="org.eclipse.cdt.make.internal.ui.properties.PathAndSymbolPage"
|
||||
tooltip="%Symbols.tooltip"/>
|
||||
<!-- AG FIXME - rather use managedbuilder page ??? -->
|
||||
<tab
|
||||
class="org.eclipse.cdt.ui.newui.ErrorParsTab"
|
||||
helpId="cdt_u_prop_build_setting_errparser"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* Contributors:
|
||||
* Andrew Gvozdev - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.language.settings.providers.tests;
|
||||
package org.eclipse.cdt.managedbuilder.language.settings.providers.tests;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -66,9 +66,8 @@ public class LanguageSettingsProvidersMBSTest extends BaseTestCase {
|
|||
assertNotNull(cfgDescription);
|
||||
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
|
||||
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, true);
|
||||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDescription);
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(cfg, cfgDescription);
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDescription);
|
||||
|
||||
assertTrue(((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders().size() > 0);
|
||||
}
|
||||
|
|
|
@ -100,8 +100,8 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
String bPath = b.getDefaultBuildPath();
|
||||
b.setBuildPathAttribute(bPath);
|
||||
}
|
||||
// cfg.setConfigurationDescription(des);
|
||||
// ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
|
||||
// cfg.setConfigurationDescription(des);
|
||||
// ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
|
||||
cfg.serialize(cfgElemen);
|
||||
|
||||
return appliedCfg;
|
||||
|
@ -129,7 +129,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
CConfigurationData base,
|
||||
IModificationContext context,
|
||||
IProgressMonitor monitor)
|
||||
throws CoreException {
|
||||
throws CoreException {
|
||||
if(cfgDescription.isPreferenceConfiguration())
|
||||
return applyPreferences(cfgDescription, base);
|
||||
|
||||
|
@ -178,14 +178,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
|
||||
protected CConfigurationData createPreferences(
|
||||
ICConfigurationDescription cfgDescription, CConfigurationData base)
|
||||
throws CoreException {
|
||||
throws CoreException {
|
||||
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
|
||||
Configuration newCfg = new Configuration((ManagedProject)cfg.getManagedProject(), cfg, cfgDescription.getId(), true, true, true);
|
||||
newCfg.setConfigurationDescription(cfgDescription);
|
||||
newCfg.setName(cfgDescription.getName());
|
||||
// if(!newCfg.getId().equals(cfg.getId())){
|
||||
// newCfg.exportArtifactInfo();
|
||||
// }
|
||||
// if(!newCfg.getId().equals(cfg.getId())){
|
||||
// newCfg.exportArtifactInfo();
|
||||
// }
|
||||
|
||||
return newCfg.getConfigurationData();
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
ICConfigurationDescription baseCfgDescription,
|
||||
CConfigurationData base, boolean clone,
|
||||
IProgressMonitor monitor)
|
||||
throws CoreException {
|
||||
throws CoreException {
|
||||
if(cfgDescription.isPreferenceConfiguration())
|
||||
return createPreferences(cfgDescription, base);
|
||||
|
||||
|
@ -229,9 +229,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
|
||||
ManagedBuildManager.performValueHandlerEvent(newCfg, IManagedOptionValueHandler.EVENT_OPEN);
|
||||
|
||||
// if(!newCfg.getId().equals(cfg.getId())){
|
||||
// newCfg.exportArtifactInfo();
|
||||
// }
|
||||
// if(!newCfg.getId().equals(cfg.getId())){
|
||||
// newCfg.exportArtifactInfo();
|
||||
// }
|
||||
|
||||
return newCfg;
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
}
|
||||
|
||||
protected CConfigurationData loadPreferences(ICConfigurationDescription cfgDescription)
|
||||
throws CoreException {
|
||||
throws CoreException {
|
||||
|
||||
Configuration cfg = load(cfgDescription, null, true);
|
||||
|
||||
|
@ -554,12 +554,17 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
|
||||
}
|
||||
|
||||
public static void setDefaultLanguageSettingsProviders(IConfiguration cfg, ICConfigurationDescription cfgDescription) {
|
||||
setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
|
||||
List<ILanguageSettingsProvider> providers = getDefaultLanguageSettingsProviders(cfg);
|
||||
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
|
||||
}
|
||||
public static void setDefaultLanguageSettingsProviders(IProject project, IConfiguration cfg, ICConfigurationDescription cfgDescription) {
|
||||
// propagate the preference to project properties
|
||||
boolean isPreferenceEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null);
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isPreferenceEnabled);
|
||||
|
||||
if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProvidersIds(cfg, cfgDescription);
|
||||
List<ILanguageSettingsProvider> providers = ConfigurationDataProvider.getDefaultLanguageSettingsProviders(cfg);
|
||||
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isPersistedCfg(ICConfigurationDescription cfgDescription){
|
||||
return cfgDescription.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
|
||||
|
|
|
@ -23,16 +23,12 @@ import java.util.SortedMap;
|
|||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
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.managedbuilder.buildproperties.IBuildProperty;
|
||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
|
||||
|
@ -94,11 +90,11 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
private static final String PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
|
||||
|
||||
private static final String tooltip =
|
||||
Messages.CWizardHandler_1 +
|
||||
Messages.CWizardHandler_2 +
|
||||
Messages.CWizardHandler_3 +
|
||||
Messages.CWizardHandler_4 +
|
||||
Messages.CWizardHandler_5;
|
||||
Messages.CWizardHandler_1 +
|
||||
Messages.CWizardHandler_2 +
|
||||
Messages.CWizardHandler_3 +
|
||||
Messages.CWizardHandler_4 +
|
||||
Messages.CWizardHandler_5;
|
||||
|
||||
protected SortedMap<String, IToolChain> full_tcs = new TreeMap<String, IToolChain>();
|
||||
private String propertyId = null;
|
||||
|
@ -108,7 +104,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
private IToolChain[] savedToolChains = null;
|
||||
private IWizard wizard;
|
||||
private IWizardPage startingPage;
|
||||
// private EntryDescriptor entryDescriptor = null;
|
||||
// private EntryDescriptor entryDescriptor = null;
|
||||
private EntryInfo entryInfo;
|
||||
protected CfgHolder[] cfgs = null;
|
||||
protected IWizardPage[] customPages;
|
||||
|
@ -181,13 +177,13 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
List<Template> lstTemplates = new ArrayList<Template>();
|
||||
for (String id : langIDs) {
|
||||
lstTemplates.addAll(Arrays.asList(TemplateEngineUI.getDefault().
|
||||
getTemplates(projectTypeId, null, id)));
|
||||
getTemplates(projectTypeId, null, id)));
|
||||
}
|
||||
templates = lstTemplates.toArray(new Template[lstTemplates.size()]);
|
||||
}
|
||||
}
|
||||
if(null == templates) {
|
||||
templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
|
||||
templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
|
||||
}
|
||||
if((null == templates) || (templates.length == 0))
|
||||
break;
|
||||
|
@ -216,7 +212,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
|
||||
if(template != null){
|
||||
Map<String, String> valueStore = template.getValueStore();
|
||||
// valueStore.clear();
|
||||
// valueStore.clear();
|
||||
for (IWizardPage page : templatePages) {
|
||||
if (page instanceof UIWizardPage)
|
||||
valueStore.putAll(((UIWizardPage)page).getPageData());
|
||||
|
@ -301,7 +297,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
|
||||
for (String id : toolChainIds) {
|
||||
if ((id != null && id.equals(id1)) ||
|
||||
(id != null && id.equals(id2)))
|
||||
(id != null && id.equals(id2)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -472,7 +468,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
MBSCustomPageManager.PAGE_ID,
|
||||
MBSCustomPageManager.PROJECT_TYPE,
|
||||
getProjectType().getId()
|
||||
);
|
||||
);
|
||||
|
||||
IToolChain[] tcs = getSelectedToolChains();
|
||||
ArrayList<IToolChain> x = new ArrayList<IToolChain>();
|
||||
|
@ -525,7 +521,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
// New style managed project type. Configurations are referenced via propertyId.
|
||||
if (propertyId != null) {
|
||||
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, ARTIFACT, propertyId);
|
||||
// Old style managewd project type. Configs are obtained via projectType
|
||||
// Old style managewd project type. Configs are obtained via projectType
|
||||
} else if (pt != null) {
|
||||
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, pt);
|
||||
}
|
||||
|
@ -598,23 +594,14 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
if (cfgFirst == null) // select at least first configuration
|
||||
cfgFirst = cfgDes;
|
||||
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||
if (isEnableProvidersPreference) {
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||
} else {
|
||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||
}
|
||||
} else {
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||
}
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, config, cfgDes);
|
||||
|
||||
monitor.worked(work);
|
||||
}
|
||||
mngr.setProjectDescription(project, des);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doTemplatesPostProcess(IProject prj) {
|
||||
if(entryInfo == null)
|
||||
|
|
|
@ -14,14 +14,11 @@ import java.lang.reflect.InvocationTargetException;
|
|||
|
||||
import org.eclipse.cdt.core.CCProjectNature;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||
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.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
|
@ -32,7 +29,6 @@ import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
|||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
|
||||
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.IProjectDescription;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
|
@ -118,17 +114,7 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
|
|||
CConfigurationData data = config.getConfigurationData();
|
||||
ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||
if (isEnableProvidersPreference) {
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(config, cfgDes);
|
||||
} else {
|
||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||
}
|
||||
} else {
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||
}
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, config, cfgDes);
|
||||
|
||||
monitor.worked(1);
|
||||
|
||||
|
|
|
@ -11,14 +11,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.ui.wizards;
|
||||
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||
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.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
|
@ -29,13 +26,10 @@ import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
|
||||
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.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.wizard.IWizard;
|
||||
import org.eclipse.jface.wizard.IWizardPage;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
/**
|
||||
|
@ -110,17 +104,7 @@ public class STDWizardHandler extends MBSWizardHandler {
|
|||
CConfigurationData data = cfg.getConfigurationData();
|
||||
ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||
|
||||
if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
|
||||
boolean isEnableProvidersPreference = !CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS);
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isEnableProvidersPreference);
|
||||
if (isEnableProvidersPreference) {
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(cfg, cfgDes);
|
||||
} else {
|
||||
((ILanguageSettingsProvidersKeeper) cfgDes).setLanguageSettingProviders(ScannerDiscoveryLegacySupport.getDefaultProvidersLegacy());
|
||||
}
|
||||
} else {
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, false);
|
||||
}
|
||||
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);
|
||||
|
||||
monitor.worked(work);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue