mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Multi-config updates.
This commit is contained in:
parent
f4087a09fc
commit
bfda3445f7
26 changed files with 344 additions and 130 deletions
|
@ -83,6 +83,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.ManagedCommandLineGenerator;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiFolderInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Option;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.OptionCategory;
|
||||
|
@ -1691,11 +1692,18 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
*/
|
||||
public static void resetConfiguration(IProject project, IConfiguration configuration) {
|
||||
// reset the configuration
|
||||
((Configuration)configuration).reset();
|
||||
|
||||
performValueHandlerEvent(configuration,
|
||||
IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
|
||||
|
||||
if (configuration instanceof MultiConfiguration) {
|
||||
IConfiguration[] cfs = (IConfiguration[])((MultiConfiguration)configuration).getItems();
|
||||
for (IConfiguration c : cfs) {
|
||||
((Configuration)c).reset();
|
||||
performValueHandlerEvent(c,
|
||||
IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
|
||||
}
|
||||
} else {
|
||||
((Configuration)configuration).reset();
|
||||
performValueHandlerEvent(configuration,
|
||||
IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void resetResourceConfiguration(IProject project, IResourceConfiguration resConfig) {
|
||||
|
@ -1709,17 +1717,34 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
|
||||
public static void resetOptionSettings(IResourceInfo rcInfo){
|
||||
if(rcInfo instanceof IFileInfo){
|
||||
Configuration cfg = (Configuration)rcInfo.getParent();
|
||||
IProject project;
|
||||
IConfiguration c = rcInfo.getParent();
|
||||
Configuration cfg = null;
|
||||
IProject project = null;
|
||||
if (c instanceof Configuration)
|
||||
cfg = (Configuration)c;
|
||||
else if (c instanceof MultiConfiguration) {
|
||||
MultiConfiguration mc = (MultiConfiguration)c;
|
||||
IConfiguration[] cfs = (IConfiguration[])mc.getItems();
|
||||
cfg = (Configuration)cfs[0];
|
||||
}
|
||||
if(cfg.isExtensionElement() || cfg.isPreference())
|
||||
project = null;
|
||||
else
|
||||
project = cfg.getOwner().getProject();
|
||||
|
||||
resetResourceConfiguration(project, (IFileInfo)rcInfo);
|
||||
if (rcInfo instanceof MultiResourceInfo) {
|
||||
for (IResourceInfo ri : (IResourceInfo[])((MultiResourceInfo)rcInfo).getItems())
|
||||
resetResourceConfiguration(project, (IFileInfo)ri);
|
||||
} else
|
||||
resetResourceConfiguration(project, (IFileInfo)rcInfo);
|
||||
} else {
|
||||
FolderInfo fo = (FolderInfo)rcInfo;
|
||||
fo.resetOptionSettings();
|
||||
if (rcInfo instanceof MultiFolderInfo) {
|
||||
for (IFolderInfo fi : (IFolderInfo[])((MultiFolderInfo)rcInfo).getItems())
|
||||
((FolderInfo)fi).resetOptionSettings();
|
||||
} else {
|
||||
FolderInfo fo = (FolderInfo)rcInfo;
|
||||
fo.resetOptionSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -578,7 +578,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
|||
System.arraycopy(ris, 0, fis, 0, ris.length);
|
||||
return new MultiFolderInfo(fis, this);
|
||||
}
|
||||
return new MultiResourceInfo(ris, this);
|
||||
return new MultiFileInfo(ris, this);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -0,0 +1,149 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 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.core;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.extension.CFileData;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFileInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
|
||||
|
||||
public MultiFileInfo(IResourceInfo[] ris, IConfiguration p) {
|
||||
super(ris, p);
|
||||
fRis = ris;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IFileInfo#getFileData()
|
||||
*/
|
||||
public CFileData getFileData() {
|
||||
return ((IFileInfo)fRis[curr]).getFileData();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#createTool(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String, boolean)
|
||||
*/
|
||||
public ITool createTool(ITool superClass, String Id, String name,
|
||||
boolean isExtensionElement) {
|
||||
ITool t = null;
|
||||
for (IResourceInfo ri : fRis) {
|
||||
if (ri instanceof IFileInfo) {
|
||||
IFileInfo fi = (IFileInfo)ri;
|
||||
t = fi.createTool(superClass, Id, name, isExtensionElement);
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getOwner()
|
||||
*/
|
||||
public IResource getOwner() {
|
||||
return ((IFileInfo)fRis[curr]).getOwner();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getRcbsApplicability()
|
||||
*/
|
||||
public int getRcbsApplicability() {
|
||||
return ((IFileInfo)fRis[curr]).getRcbsApplicability();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getResourcePath()
|
||||
*/
|
||||
public String getResourcePath() {
|
||||
return ((IFileInfo)fRis[curr]).getResourcePath();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getTool(java.lang.String)
|
||||
*/
|
||||
public ITool getTool(String id) {
|
||||
return ((IFileInfo)fRis[curr]).getTool(id);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getToolsToInvoke()
|
||||
*/
|
||||
public ITool[] getToolsToInvoke() {
|
||||
return ((IFileInfo)fRis[curr]).getToolsToInvoke();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#removeTool(org.eclipse.cdt.managedbuilder.core.ITool)
|
||||
*/
|
||||
public void removeTool(ITool tool) {
|
||||
System.out.println("MultiFileInfo.removeTool() does not work OK !");
|
||||
for (IResourceInfo ri : fRis) {
|
||||
if (ri instanceof IFileInfo) {
|
||||
IFileInfo fi = (IFileInfo)ri;
|
||||
fi.removeTool(tool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setRcbsApplicability(int)
|
||||
*/
|
||||
public void setRcbsApplicability(int value) {
|
||||
for (IResourceInfo ri : fRis) {
|
||||
if (ri instanceof IFileInfo) {
|
||||
IFileInfo fi = (IFileInfo)ri;
|
||||
fi.setRcbsApplicability(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setResourcePath(java.lang.String)
|
||||
*/
|
||||
public void setResourcePath(String path) {
|
||||
for (IResourceInfo ri : fRis) {
|
||||
if (ri instanceof IFileInfo) {
|
||||
IFileInfo fi = (IFileInfo)ri;
|
||||
fi.setResourcePath(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
||||
*/
|
||||
public void setToolCommand(ITool tool, String command) {
|
||||
System.out.println("MultiFileInfo.setToolCommand() does not work OK !");
|
||||
for (IResourceInfo ri : fRis) {
|
||||
if (ri instanceof IFileInfo) {
|
||||
IFileInfo fi = (IFileInfo)ri;
|
||||
fi.setToolCommand(tool, command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setTools(org.eclipse.cdt.managedbuilder.core.ITool[])
|
||||
*/
|
||||
public void setTools(ITool[] tools) {
|
||||
for (IResourceInfo ri : fRis) {
|
||||
if (ri instanceof IFileInfo) {
|
||||
IFileInfo fi = (IFileInfo)ri;
|
||||
fi.setTools(tools);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -28,7 +28,7 @@ import org.eclipse.core.runtime.PluginVersionIdentifier;
|
|||
* belonging to different configurations while they are
|
||||
* edited simultaneously.
|
||||
*/
|
||||
public class MultiResourceInfo extends MultiItemsHolder implements
|
||||
public abstract class MultiResourceInfo extends MultiItemsHolder implements
|
||||
IResourceInfo {
|
||||
private static final int MODE_BOOL = 0;
|
||||
private static final int MODE_STR = 1;
|
||||
|
|
|
@ -46,7 +46,7 @@ public abstract class AbstractCBuildPropertyTab extends AbstractCPropertyTab {
|
|||
public IConfiguration getCfg() {
|
||||
return getCfg(getResDesc().getConfiguration());
|
||||
}
|
||||
public IConfiguration getCfg(ICConfigurationDescription cfgd) {
|
||||
public static IConfiguration getCfg(ICConfigurationDescription cfgd) {
|
||||
if (cfgd instanceof ICMultiConfigDescription) {
|
||||
ICConfigurationDescription[] cfds = (ICConfigurationDescription[])((ICMultiConfigDescription)cfgd).getItems();
|
||||
return new MultiConfiguration(cfds, 9);
|
||||
|
|
|
@ -11,12 +11,15 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildProcessManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Builder;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
||||
import org.eclipse.cdt.newmake.core.IMakeBuilderInfo;
|
||||
|
@ -395,12 +398,57 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
|||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
Configuration cfg01 = (Configuration)getCfg(src.getConfiguration());
|
||||
Configuration cfg02 = (Configuration)getCfg(dst.getConfiguration());
|
||||
cfg02.enableInternalBuilder(cfg01.isInternalBuilderEnabled());
|
||||
BuilderSettingsTab.copyBuilders(cfg01.getBuilder(), cfg02.getEditableBuilder());
|
||||
apply(src, dst, page.isMultiCfg());
|
||||
}
|
||||
|
||||
static void apply(ICResourceDescription src, ICResourceDescription dst, boolean multi) {
|
||||
if (multi) {
|
||||
ICMultiConfigDescription mc1 = (ICMultiConfigDescription)src.getConfiguration();
|
||||
ICMultiConfigDescription mc2 = (ICMultiConfigDescription)dst.getConfiguration();
|
||||
ICConfigurationDescription[] cds1 = (ICConfigurationDescription[])mc1.getItems();
|
||||
ICConfigurationDescription[] cds2 = (ICConfigurationDescription[])mc2.getItems();
|
||||
for (int i=0; i<cds1.length; i++)
|
||||
applyToCfg(cds1[i], cds2[i]);
|
||||
} else
|
||||
applyToCfg(src.getConfiguration(), dst.getConfiguration());
|
||||
}
|
||||
|
||||
private static void applyToCfg(ICConfigurationDescription c1, ICConfigurationDescription c2) {
|
||||
Configuration cfg01 = (Configuration)getCfg(c1);
|
||||
Configuration cfg02 = (Configuration)getCfg(c2);
|
||||
cfg02.enableInternalBuilder(cfg01.isInternalBuilderEnabled());
|
||||
copyBuilders(cfg01.getBuilder(), cfg02.getEditableBuilder());
|
||||
}
|
||||
|
||||
static void copyBuilders(IBuilder b1, IBuilder b2) {
|
||||
try {
|
||||
b2.setUseDefaultBuildCmd(b1.isDefaultBuildCmd());
|
||||
if (!b1.isDefaultBuildCmd()) {
|
||||
b2.setCommand(b1.getCommand());
|
||||
b2.setArguments(b1.getArguments());
|
||||
} else {
|
||||
b2.setCommand(null);
|
||||
b2.setArguments(null);
|
||||
}
|
||||
b2.setStopOnError(b1.isStopOnError());
|
||||
b2.setParallelBuildOn(b1.isParallelBuildOn());
|
||||
b2.setParallelizationNum(b1.getParallelizationNum());
|
||||
if (b2.canKeepEnvironmentVariablesInBuildfile())
|
||||
b2.setKeepEnvironmentVariablesInBuildfile(b1.keepEnvironmentVariablesInBuildfile());
|
||||
((Builder)b2).setBuildPath(((Builder)b1).getBuildPathAttribute());
|
||||
|
||||
b2.setAutoBuildEnable((b1.isAutoBuildEnable()));
|
||||
b2.setBuildAttribute(IBuilder.BUILD_TARGET_AUTO, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_AUTO, EMPTY_STR)));
|
||||
b2.setCleanBuildEnable(b1.isCleanBuildEnabled());
|
||||
b2.setBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, EMPTY_STR)));
|
||||
b2.setIncrementalBuildEnable(b1.isIncrementalBuildEnabled());
|
||||
b2.setBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, EMPTY_STR)));
|
||||
|
||||
b2.setManagedBuildOn(b1.isManagedBuildOn());
|
||||
} catch (CoreException ex) {
|
||||
ManagedBuilderUIPlugin.log(ex);
|
||||
}
|
||||
}
|
||||
// This page can be displayed for project only
|
||||
public boolean canBeVisible() {
|
||||
return page.isForProject() || page.isForPrefs();
|
||||
|
@ -410,15 +458,16 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
|||
super.setVisible(b);
|
||||
}
|
||||
|
||||
|
||||
protected void performDefaults() {
|
||||
if (icfg instanceof IMultiConfiguration) {
|
||||
IConfiguration[] cfs = (IConfiguration[])((IMultiConfiguration)icfg).getItems();
|
||||
for (int i=0; i<cfs.length; i++) {
|
||||
IBuilder b = cfs[i].getEditableBuilder();
|
||||
BuilderSettingsTab.copyBuilders(b.getSuperClass(), b);
|
||||
copyBuilders(b.getSuperClass(), b);
|
||||
}
|
||||
} else
|
||||
BuilderSettingsTab.copyBuilders(bldr.getSuperClass(), bldr);
|
||||
copyBuilders(bldr.getSuperClass(), bldr);
|
||||
updateData(getResDesc());
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
|
||||
import org.eclipse.cdt.core.settings.model.ICMultiResourceDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
|
@ -292,7 +293,6 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
|
|||
return path.toString();
|
||||
}
|
||||
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
if (page.isForProject()) {
|
||||
IConfiguration cfg1 = getCfg(src.getConfiguration());
|
||||
|
@ -302,33 +302,42 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
|
|||
cfg2.setPostbuildStep(cfg1.getPostbuildStep());
|
||||
cfg2.setPostannouncebuildStep(cfg1.getPostannouncebuildStep());
|
||||
} else {
|
||||
IFileInfo rcfg1 = (IFileInfo)getResCfg(src);
|
||||
IFileInfo rcfg2 = (IFileInfo)getResCfg(dst);
|
||||
rcfg2.setRcbsApplicability(rcfg1.getRcbsApplicability());
|
||||
ITool tool1 = getRcbsTool(rcfg1);
|
||||
ITool tool2 = getRcbsTool(rcfg2);
|
||||
|
||||
IInputType[] ein1 = tool1.getInputTypes();
|
||||
IInputType[] ein2 = tool2.getInputTypes();
|
||||
if (valid(ein1) && valid(ein2)) {
|
||||
IAdditionalInput[] add1 = ein1[0].getAdditionalInputs();
|
||||
IAdditionalInput[] add2 = ein2[0].getAdditionalInputs();
|
||||
if (valid(add1) && valid(add2)) {
|
||||
// if (add1 != null && add2 != null && add1.length > 0 && add2.length > 0) {
|
||||
add2[0].setPaths(createList(add1[0].getPaths()));
|
||||
}
|
||||
}
|
||||
IOutputType[] tmp1 = tool1.getOutputTypes();
|
||||
IOutputType[] tmp2 = tool2.getOutputTypes();
|
||||
// if (tmp1 != null && tmp2 != null && tmp1.length > 0 && tmp2.length > 0) {
|
||||
if (valid(tmp1) && valid(tmp2)) {
|
||||
tmp2[0].setOutputNames(createList(tmp1[0].getOutputNames()));
|
||||
}
|
||||
tool2.setToolCommand(tool1.getToolCommand());
|
||||
tool2.setAnnouncement(tool1.getAnnouncement());
|
||||
if (page.isMultiCfg()) {
|
||||
ICResourceDescription[] ris1 = (ICResourceDescription[])((ICMultiResourceDescription)src).getItems();
|
||||
ICResourceDescription[] ris2 = (ICResourceDescription[])((ICMultiResourceDescription)dst).getItems();
|
||||
for (int i=0; i<ris1.length; i++)
|
||||
applyToFile(ris1[i], ris2[i]);
|
||||
} else
|
||||
applyToFile(src, dst);
|
||||
}
|
||||
}
|
||||
|
||||
private void applyToFile(ICResourceDescription src, ICResourceDescription dst) {
|
||||
IFileInfo rcfg1 = (IFileInfo)getResCfg(src);
|
||||
IFileInfo rcfg2 = (IFileInfo)getResCfg(dst);
|
||||
rcfg2.setRcbsApplicability(rcfg1.getRcbsApplicability());
|
||||
ITool tool1 = getRcbsTool(rcfg1);
|
||||
ITool tool2 = getRcbsTool(rcfg2);
|
||||
IInputType[] ein1 = tool1.getInputTypes();
|
||||
IInputType[] ein2 = tool2.getInputTypes();
|
||||
if (valid(ein1) && valid(ein2)) {
|
||||
IAdditionalInput[] add1 = ein1[0].getAdditionalInputs();
|
||||
IAdditionalInput[] add2 = ein2[0].getAdditionalInputs();
|
||||
if (valid(add1) && valid(add2)) {
|
||||
// if (add1 != null && add2 != null && add1.length > 0 && add2.length > 0) {
|
||||
add2[0].setPaths(createList(add1[0].getPaths()));
|
||||
}
|
||||
}
|
||||
IOutputType[] tmp1 = tool1.getOutputTypes();
|
||||
IOutputType[] tmp2 = tool2.getOutputTypes();
|
||||
// if (tmp1 != null && tmp2 != null && tmp1.length > 0 && tmp2.length > 0) {
|
||||
if (valid(tmp1) && valid(tmp2)) {
|
||||
tmp2[0].setOutputNames(createList(tmp1[0].getOutputNames()));
|
||||
}
|
||||
tool2.setToolCommand(tool1.getToolCommand());
|
||||
tool2.setAnnouncement(tool1.getAnnouncement());
|
||||
}
|
||||
|
||||
private int sel2app(int index){
|
||||
String sel = combo.getItem(index);
|
||||
if(UIMessages.getString(RCBS_OVERRIDE).equals(sel)){
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
|||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Builder;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
@ -119,7 +118,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
b_dirVars = setupBottomButton(c, VARIABLESBUTTON_NAME);
|
||||
}
|
||||
|
||||
void setManagedBuild(boolean enable) {
|
||||
private void setManagedBuild(boolean enable) {
|
||||
setManagedBuildOn(enable);
|
||||
page.informPages(MANAGEDBUILDSTATE, null);
|
||||
updateButtons();
|
||||
|
@ -192,7 +191,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
canModify = true;
|
||||
}
|
||||
|
||||
Button setupBottomButton(Composite c, String name) {
|
||||
private Button setupBottomButton(Composite c, String name) {
|
||||
Button b = new Button(c, SWT.PUSH);
|
||||
b.setText(name);
|
||||
GridData fd = new GridData(GridData.CENTER);
|
||||
|
@ -302,42 +301,9 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
Configuration cfg01 = (Configuration)getCfg(src.getConfiguration());
|
||||
Configuration cfg02 = (Configuration)getCfg(dst.getConfiguration());
|
||||
cfg02.enableInternalBuilder(cfg01.isInternalBuilderEnabled());
|
||||
copyBuilders(cfg01.getBuilder(), cfg02.getEditableBuilder());
|
||||
BuildBehaviourTab.apply(src, dst, page.isMultiCfg());
|
||||
}
|
||||
|
||||
static void copyBuilders(IBuilder b1, IBuilder b2) {
|
||||
try {
|
||||
b2.setUseDefaultBuildCmd(b1.isDefaultBuildCmd());
|
||||
if (!b1.isDefaultBuildCmd()) {
|
||||
b2.setCommand(b1.getCommand());
|
||||
b2.setArguments(b1.getArguments());
|
||||
} else {
|
||||
b2.setCommand(null);
|
||||
b2.setArguments(null);
|
||||
}
|
||||
b2.setStopOnError(b1.isStopOnError());
|
||||
b2.setParallelBuildOn(b1.isParallelBuildOn());
|
||||
b2.setParallelizationNum(b1.getParallelizationNum());
|
||||
if (b2.canKeepEnvironmentVariablesInBuildfile())
|
||||
b2.setKeepEnvironmentVariablesInBuildfile(b1.keepEnvironmentVariablesInBuildfile());
|
||||
((Builder)b2).setBuildPath(((Builder)b1).getBuildPathAttribute());
|
||||
|
||||
b2.setAutoBuildEnable((b1.isAutoBuildEnable()));
|
||||
b2.setBuildAttribute(IBuilder.BUILD_TARGET_AUTO, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_AUTO, EMPTY_STR)));
|
||||
b2.setCleanBuildEnable(b1.isCleanBuildEnabled());
|
||||
b2.setBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, EMPTY_STR)));
|
||||
b2.setIncrementalBuildEnable(b1.isIncrementalBuildEnabled());
|
||||
b2.setBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, (b1.getBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, EMPTY_STR)));
|
||||
|
||||
b2.setManagedBuildOn(b1.isManagedBuildOn());
|
||||
} catch (CoreException ex) {
|
||||
ManagedBuilderUIPlugin.log(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @param string
|
||||
|
@ -365,10 +331,10 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
IConfiguration[] cfs = (IConfiguration[])((IMultiConfiguration)icfg).getItems();
|
||||
for (int i=0; i<cfs.length; i++) {
|
||||
IBuilder b = cfs[i].getEditableBuilder();
|
||||
copyBuilders(b.getSuperClass(), b);
|
||||
BuildBehaviourTab.copyBuilders(b.getSuperClass(), b);
|
||||
}
|
||||
} else
|
||||
copyBuilders(bldr.getSuperClass(), bldr);
|
||||
BuildBehaviourTab.copyBuilders(bldr.getSuperClass(), bldr);
|
||||
updateData(getResDesc());
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
|||
private static final String PROFILE_PAGE = "profilePage"; //$NON-NLS-1$
|
||||
private static final String PROFILE_ID = "profileId"; //$NON-NLS-1$
|
||||
private static final String PROFILE_NAME = "name"; //$NON-NLS-1$
|
||||
// private static final String MULTI_MSG = Messages.getString("DiscoveryTab.4"); //$NON-NLS-1$
|
||||
private static final int DEFAULT_HEIGHT = 110;
|
||||
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 };
|
||||
private Table resTable;
|
||||
|
@ -561,7 +560,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
|||
}
|
||||
|
||||
public boolean canBeVisible() {
|
||||
if (page.isForProject() || page.isForPrefs()) return true;
|
||||
if (page.isMultiCfg()) {
|
||||
setAllVisible(false, null);
|
||||
return false;
|
||||
}
|
||||
setAllVisible(true, null);
|
||||
if (page.isForProject() || page.isForPrefs())
|
||||
return true;
|
||||
// Hide this page for folders and files
|
||||
// if Discovery scope is "per configuration", not "per resource"
|
||||
ICfgScannerConfigBuilderInfo2Set _cbi =
|
||||
|
|
|
@ -426,6 +426,8 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
}
|
||||
protected void performApply(ICResourceDescription src,
|
||||
ICResourceDescription dst) {
|
||||
if (mod == null)
|
||||
return;
|
||||
IConfiguration cfg = getCfg(dst.getConfiguration());
|
||||
try {
|
||||
IToolListModification tlm = (ri instanceof IFolderInfo) ?
|
||||
|
@ -438,9 +440,11 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
}
|
||||
|
||||
protected void performDefaults() {
|
||||
mod.restoreDefaults();
|
||||
apply();
|
||||
updateData();
|
||||
if (mod != null) {
|
||||
mod.restoreDefaults();
|
||||
apply();
|
||||
updateData();
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
|
|
|
@ -73,7 +73,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
private ToolListElement selectedElement;
|
||||
private ToolListContentProvider listprovider;
|
||||
private Object propertyObject;
|
||||
|
||||
|
||||
private IResourceInfo fInfo;
|
||||
|
||||
public void createControls(Composite par) {
|
||||
|
@ -400,13 +400,11 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
|
||||
*/
|
||||
public void performDefaults() {
|
||||
protected void performDefaults() {
|
||||
if (page.isForProject()) {
|
||||
ManagedBuildManager.resetConfiguration(page.getProject(), getCfg());
|
||||
} else {
|
||||
// ManagedBuildManager.resetResourceConfiguration(provider.getProject(), );
|
||||
// ManagedBuildManager.performValueHandlerEvent(fInfo, IManagedOptionValueHandler.EVENT_SETDEFAULT);
|
||||
|
||||
ManagedBuildManager.resetOptionSettings(fInfo);
|
||||
}
|
||||
ITool tools[];
|
||||
if (page.isForProject())
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 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
|
||||
|
@ -266,9 +266,14 @@ public class MultiConfigDescription extends MultiItemsHolder implements
|
|||
return null;
|
||||
if (lst.size() == 1)
|
||||
return (ICResourceDescription)lst.get(0);
|
||||
return new MultiResourceDescription(
|
||||
(ICResourceDescription[])lst.toArray(new ICResourceDescription[lst.size()]),
|
||||
if (isForFolder)
|
||||
return new MultiFolderDescription(
|
||||
(ICFolderDescription[])lst.toArray(new ICFolderDescription[lst.size()]),
|
||||
getStringListMode());
|
||||
else
|
||||
return new MultiFileDescription(
|
||||
(ICFileDescription[])lst.toArray(new ICFileDescription[lst.size()]),
|
||||
getStringListMode());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 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
|
||||
|
@ -29,8 +29,8 @@ public class MultiFileDescription extends MultiResourceDescription implements
|
|||
* @see org.eclipse.cdt.core.settings.model.ICFileDescription#getLanguageSetting()
|
||||
*/
|
||||
public ICLanguageSetting getLanguageSetting() {
|
||||
System.out.println("Bad multi access: MultiFileDescription.getLanguageSetting()");
|
||||
return null;
|
||||
System.out.println("Limited multi access: MultiFileDescription.getLanguageSetting()");
|
||||
return ((ICFileDescription)fRess[0]).getLanguageSetting();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 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
|
||||
|
@ -28,7 +28,7 @@ import org.eclipse.core.runtime.IPath;
|
|||
public class MultiFolderDescription extends MultiResourceDescription implements
|
||||
ICFolderDescription {
|
||||
|
||||
private static final Comparator comp = CDTListComparator.getInstance();
|
||||
private static final Comparator<Object> comp = CDTListComparator.getInstance();
|
||||
private ICLanguageSetting[] lsets = null;
|
||||
|
||||
public MultiFolderDescription(ICFolderDescription[] res, int mode) {
|
||||
|
@ -93,7 +93,7 @@ public class MultiFolderDescription extends MultiResourceDescription implements
|
|||
ICLanguageSetting[] fs = conv2LS(getListForDisplay(ls, comp));
|
||||
lsets = new ICLanguageSetting[fs.length];
|
||||
for (int i=0; i<fs.length; i++) {
|
||||
ArrayList list = new ArrayList(fRess.length);
|
||||
ArrayList<ICLanguageSetting> list = new ArrayList<ICLanguageSetting>(fRess.length);
|
||||
for (int j=0; j<ls.length; j++) {
|
||||
int x = Arrays.binarySearch(ls[j], fs[i], comp);
|
||||
if (x >= 0)
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IPath;
|
|||
/**
|
||||
* This class represents multi-resource holder
|
||||
*/
|
||||
public class MultiResourceDescription extends MultiItemsHolder implements ICMultiResourceDescription {
|
||||
public abstract class MultiResourceDescription extends MultiItemsHolder implements ICMultiResourceDescription {
|
||||
ICResourceDescription[] fRess = null;
|
||||
ICConfigurationDescription fCfg = null;
|
||||
|
||||
|
|
|
@ -619,6 +619,8 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
setBackgroundText(msg);
|
||||
usercomp.setVisible(visible);
|
||||
buttoncomp.setVisible(visible);
|
||||
page.getAButton().setVisible(visible);
|
||||
page.getDButton().setVisible(visible);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 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
|
||||
|
@ -167,7 +167,7 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab {
|
|||
* Called when item added/edited/removed.
|
||||
* Refreshes whole table contwnts
|
||||
*/
|
||||
public void update() {
|
||||
protected void update() {
|
||||
int x = table.getSelectionIndex();
|
||||
if (x == -1) x = 0;
|
||||
|
||||
|
@ -327,7 +327,7 @@ outer:
|
|||
return ein;
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
ICConfigurationDescription c1 = src.getConfiguration();
|
||||
ICConfigurationDescription c2 = dst.getConfiguration();
|
||||
c2.removeExternalSettings();
|
||||
|
@ -389,18 +389,9 @@ outer:
|
|||
}
|
||||
|
||||
public boolean canBeVisible() {
|
||||
if (! page.isForProject() ) return false;
|
||||
|
||||
if (! page.isForProject() )
|
||||
return false;
|
||||
return true;
|
||||
/*
|
||||
if (getResDesc() == null) return true;
|
||||
ICLanguageSetting [] ls = getLangSetting(getResDesc());
|
||||
for (int i=0; i<ls.length; i++) {
|
||||
if ((ls[i].getSupportedEntryKinds() & getKind()) != 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 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
|
||||
|
@ -468,7 +468,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
}
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
ICLanguageSetting [] sr = getLangSetting(src);
|
||||
ICLanguageSetting [] ds = getLangSetting(dst);
|
||||
if (sr == null || ds == null || sr.length != ds.length) return;
|
||||
|
|
|
@ -1033,5 +1033,12 @@ implements
|
|||
p1.y = Math.min(p1.y, (r.height - p0.y));
|
||||
sh.setSize(p1);
|
||||
}
|
||||
|
||||
|
||||
public Button getAButton() {
|
||||
return getApplyButton();
|
||||
}
|
||||
public Button getDButton() {
|
||||
return getDefaultsButton();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -300,7 +300,7 @@ public class BinaryParsTab extends AbstractCPropertyTab {
|
|||
return ((BinaryParserConfiguration)table.getItem(x).getData()).getID();
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
if (page.isMultiCfg()) {
|
||||
src = ((ICResourceDescription[])((ICMultiResourceDescription)src).getItems())[0];
|
||||
dst = ((ICResourceDescription[])((ICMultiResourceDescription)dst).getItems())[0];
|
||||
|
|
|
@ -221,7 +221,7 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
|
|||
}
|
||||
}
|
||||
|
||||
public void saveData() {
|
||||
private void saveData() {
|
||||
ICExclusionPatternPathEntry[] p = new ICExclusionPatternPathEntry[src.size()];
|
||||
Iterator it = src.iterator();
|
||||
int i=0;
|
||||
|
@ -257,7 +257,7 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
|
|||
protected abstract ICExclusionPatternPathEntry newEntry(IPath p, IPath[] ex, boolean workspacePath);
|
||||
protected abstract ICExclusionPatternPathEntry newEntry(IFolder f, IPath[] ex, boolean workspacePath);
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
setEntries(dst, getEntries(src));
|
||||
}
|
||||
|
||||
|
|
|
@ -344,7 +344,7 @@ public class EnvironmentTab extends AbstractCPropertyTab {
|
|||
updateButtons();
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription _src, ICResourceDescription _dst) {
|
||||
protected void performApply(ICResourceDescription _src, ICResourceDescription _dst) {
|
||||
ICConfigurationDescription src = _src.getConfiguration();
|
||||
ICConfigurationDescription dst = _dst.getConfiguration();
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ public class ErrorParsTab extends AbstractCPropertyTab {
|
|||
buttonSetEnabled(4, cnt > 0);
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
ICConfigurationDescription sd = src.getConfiguration();
|
||||
ICConfigurationDescription dd = dst.getConfiguration();
|
||||
String[] s = (sd instanceof ICMultiConfigDescription) ?
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 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
|
||||
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.ui.newui;
|
|||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
|
@ -64,5 +65,8 @@ public interface ICPropertyProvider extends ICOptionContainer {
|
|||
// Checks whether a project is new CDT model-style
|
||||
boolean isCDTProject(IProject p);
|
||||
boolean isMultiCfg();
|
||||
// Gives access to buttons
|
||||
Button getAButton();
|
||||
Button getDButton();
|
||||
|
||||
}
|
||||
|
|
|
@ -192,13 +192,13 @@ public class RefsTab extends AbstractCPropertyTab {
|
|||
}
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
dst.getConfiguration().setReferenceInfo(src.getConfiguration().getReferenceInfo());
|
||||
}
|
||||
|
||||
// This page can be displayed for project only
|
||||
public boolean canBeVisible() {
|
||||
return page.isForProject();
|
||||
return page.isForProject() && ! page.isMultiCfg();
|
||||
}
|
||||
|
||||
protected void performDefaults() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 2007, 2008 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
|
||||
|
@ -307,7 +307,7 @@ public class StructureTreeTab extends AbstractCPropertyTab {
|
|||
return x;
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src,ICResourceDescription dst) {}
|
||||
protected void performApply(ICResourceDescription src,ICResourceDescription dst) {}
|
||||
|
||||
protected void performDefaults() {}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue