mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Bug #182450 : Multi cfg support
This commit is contained in:
parent
ada2cc0c2c
commit
e88356657e
9 changed files with 126 additions and 95 deletions
|
@ -47,19 +47,19 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
private static final int TRI_STATES_SIZE = 4;
|
private static final int TRI_STATES_SIZE = 4;
|
||||||
// Widgets
|
// Widgets
|
||||||
//3
|
//3
|
||||||
private Button b_stopOnError;
|
private Button b_stopOnError; // 3
|
||||||
private Button b_parallel;
|
private Button b_parallel; // 3
|
||||||
|
|
||||||
private Button b_parallelOpt;
|
private Button b_parallelOpt;
|
||||||
private Button b_parallelNum;
|
private Button b_parallelNum;
|
||||||
private Spinner parallelProcesses;
|
private Spinner parallelProcesses;
|
||||||
|
|
||||||
private Label title2;
|
private Label title2;
|
||||||
private Button b_autoBuild;
|
private Button b_autoBuild; //3
|
||||||
private Text t_autoBuild;
|
private Text t_autoBuild;
|
||||||
private Button b_cmdBuild;
|
private Button b_cmdBuild; //3
|
||||||
private Text t_cmdBuild;
|
private Text t_cmdBuild;
|
||||||
private Button b_cmdClean;
|
private Button b_cmdClean; // 3
|
||||||
private Text t_cmdClean;
|
private Text t_cmdClean;
|
||||||
|
|
||||||
private IBuilder bldr;
|
private IBuilder bldr;
|
||||||
|
@ -186,32 +186,46 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
* 1: supportsStopOnError(true)
|
* 1: supportsStopOnError(true)
|
||||||
* 2: bld.supportsStopOnError(false)
|
* 2: bld.supportsStopOnError(false)
|
||||||
* 3: cfg.getInternalBuilderParallel()
|
* 3: cfg.getInternalBuilderParallel()
|
||||||
|
* Mode 2:
|
||||||
|
* 0: b.isAutoBuildEnable()
|
||||||
|
* 1: b.isIncrementalBuildEnabled()
|
||||||
|
* 2: b.isCleanBuildEnabled()
|
||||||
|
* 3: getParallelDef()
|
||||||
*/
|
*/
|
||||||
static int[] calc3states(ICPropertyProvider p,
|
static int[] calc3states(ICPropertyProvider p,
|
||||||
IConfiguration c,
|
IConfiguration c,
|
||||||
boolean p0) {
|
int mode) {
|
||||||
if (p.isMultiCfg() &&
|
if (p.isMultiCfg() &&
|
||||||
c instanceof ICMultiItemsHolder)
|
c instanceof ICMultiItemsHolder)
|
||||||
{
|
{
|
||||||
|
boolean p0 = (mode == 0);
|
||||||
|
boolean p1 = (mode == 1);
|
||||||
|
|
||||||
IConfiguration[] cfs = (IConfiguration[])((ICMultiItemsHolder)c).getItems();
|
IConfiguration[] cfs = (IConfiguration[])((ICMultiItemsHolder)c).getItems();
|
||||||
IBuilder b = cfs[0].getBuilder();
|
IBuilder b = cfs[0].getBuilder();
|
||||||
int[] res = new int[TRI_STATES_SIZE];
|
int[] res = new int[TRI_STATES_SIZE];
|
||||||
boolean[] x = new boolean[TRI_STATES_SIZE];
|
boolean[] x = new boolean[TRI_STATES_SIZE];
|
||||||
x[0] = p0 ? b.isManagedBuildOn() : b.isStopOnError();
|
x[0] = p0 ? b.isManagedBuildOn() :
|
||||||
x[1] = p0 ? b.isDefaultBuildCmd(): b.supportsStopOnError(true);
|
(p1 ? b.isStopOnError() : b.isAutoBuildEnable());
|
||||||
|
x[1] = p0 ? b.isDefaultBuildCmd():
|
||||||
|
(p1 ? b.supportsStopOnError(true) : b.isIncrementalBuildEnabled() );
|
||||||
x[2] = p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
|
x[2] = p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
|
||||||
b.supportsStopOnError(false);
|
(p1 ? b.supportsStopOnError(false) : b.isCleanBuildEnabled());
|
||||||
x[3] = p0 ? b.keepEnvironmentVariablesInBuildfile() :
|
x[3] = p0 ? b.keepEnvironmentVariablesInBuildfile() :
|
||||||
((Configuration)cfs[0]).getInternalBuilderParallel();
|
( p1 ? ((Configuration)cfs[0]).getInternalBuilderParallel() : getParallelDef(c));
|
||||||
for (int i=1; i<cfs.length; i++) {
|
for (int i=1; i<cfs.length; i++) {
|
||||||
b = cfs[i].getBuilder();
|
b = cfs[i].getBuilder();
|
||||||
if (x[0] != (p0 ? b.isManagedBuildOn() : b.isStopOnError()))
|
if (x[0] != (p0 ? b.isManagedBuildOn() :
|
||||||
|
(p1 ? b.isStopOnError() : b.isAutoBuildEnable())))
|
||||||
res[0] = TRI_UNKNOWN;
|
res[0] = TRI_UNKNOWN;
|
||||||
if (x[1] != (p0 ? b.isDefaultBuildCmd() : b.supportsStopOnError(true)))
|
if (x[1] != (p0 ? b.isDefaultBuildCmd() :
|
||||||
|
(p1 ? b.supportsStopOnError(true) : b.isIncrementalBuildEnabled())))
|
||||||
res[1] = TRI_UNKNOWN;
|
res[1] = TRI_UNKNOWN;
|
||||||
if (x[2] != (p0 ? b.canKeepEnvironmentVariablesInBuildfile() : b.supportsStopOnError(false)))
|
if (x[2] != (p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
|
||||||
|
(p1 ? b.supportsStopOnError(false) : b.isCleanBuildEnabled())))
|
||||||
res[2] = TRI_UNKNOWN;
|
res[2] = TRI_UNKNOWN;
|
||||||
if (x[3] != (p0 ? b.keepEnvironmentVariablesInBuildfile() : ((Configuration)cfs[i]).getInternalBuilderParallel()))
|
if (x[3] != (p0 ? b.keepEnvironmentVariablesInBuildfile() :
|
||||||
|
(p1 ? ((Configuration)cfs[i]).getInternalBuilderParallel() : getParallelDef(c))))
|
||||||
res[3] = TRI_UNKNOWN;
|
res[3] = TRI_UNKNOWN;
|
||||||
}
|
}
|
||||||
for (int i=0; i<TRI_STATES_SIZE; i++) {
|
for (int i=0; i<TRI_STATES_SIZE; i++) {
|
||||||
|
@ -229,7 +243,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
protected void updateButtons() {
|
protected void updateButtons() {
|
||||||
bldr = icfg.getEditableBuilder();
|
bldr = icfg.getEditableBuilder();
|
||||||
|
|
||||||
int[] extStates = calc3states(page, icfg, false);
|
int[] extStates = calc3states(page, icfg, 1);
|
||||||
|
|
||||||
if (extStates != null) {
|
if (extStates != null) {
|
||||||
setTriSelection(b_stopOnError, extStates[0]);
|
setTriSelection(b_stopOnError, extStates[0]);
|
||||||
|
@ -237,19 +251,17 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
extStates[1] == TRI_YES &&
|
extStates[1] == TRI_YES &&
|
||||||
extStates[2] == TRI_YES);
|
extStates[2] == TRI_YES);
|
||||||
} else {
|
} else {
|
||||||
setTriSelection(b_stopOnError, bldr.isStopOnError() ? TRI_YES : TRI_NO);
|
setTriSelection(b_stopOnError, bldr.isStopOnError());
|
||||||
b_stopOnError.setEnabled(
|
b_stopOnError.setEnabled(
|
||||||
bldr.supportsStopOnError(true) &&
|
bldr.supportsStopOnError(true) &&
|
||||||
bldr.supportsStopOnError(false));
|
bldr.supportsStopOnError(false));
|
||||||
}
|
}
|
||||||
// parallel
|
// parallel
|
||||||
if (extStates == null) // no extended states
|
if (extStates == null) // no extended states
|
||||||
setTriSelection(b_parallel, getInternalBuilderParallel() ? TRI_YES : TRI_NO);
|
setTriSelection(b_parallel, getInternalBuilderParallel());
|
||||||
else
|
else
|
||||||
setTriSelection(b_parallel, extStates[3]);
|
setTriSelection(b_parallel, extStates[3]);
|
||||||
|
|
||||||
b_parallelOpt.setSelection(getParallelDef());
|
|
||||||
b_parallelNum.setSelection(!getParallelDef());
|
|
||||||
int n = getParallelNumber();
|
int n = getParallelNumber();
|
||||||
if (n < 0) n = -n;
|
if (n < 0) n = -n;
|
||||||
parallelProcesses.setSelection(n);
|
parallelProcesses.setSelection(n);
|
||||||
|
@ -259,11 +271,27 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
b_parallelNum.setVisible(bldr.supportsParallelBuild());
|
b_parallelNum.setVisible(bldr.supportsParallelBuild());
|
||||||
parallelProcesses.setVisible(bldr.supportsParallelBuild());
|
parallelProcesses.setVisible(bldr.supportsParallelBuild());
|
||||||
|
|
||||||
b_autoBuild.setSelection(bldr.isAutoBuildEnable());
|
extStates = calc3states(page, icfg, 2);
|
||||||
|
if (extStates == null) {
|
||||||
|
setTriSelection(b_autoBuild, bldr.isAutoBuildEnable());
|
||||||
|
setTriSelection(b_cmdBuild, bldr.isIncrementalBuildEnabled());
|
||||||
|
setTriSelection(b_cmdClean, bldr.isCleanBuildEnabled());
|
||||||
|
b_parallelOpt.setSelection(getParallelDef(icfg));
|
||||||
|
b_parallelNum.setSelection(!getParallelDef(icfg));
|
||||||
|
} else {
|
||||||
|
setTriSelection(b_autoBuild, extStates[0]);
|
||||||
|
setTriSelection(b_cmdBuild, extStates[1]);
|
||||||
|
setTriSelection(b_cmdClean, extStates[2]);
|
||||||
|
if (extStates[3] == TRI_UNKNOWN) {
|
||||||
|
b_parallelOpt.setSelection(false);
|
||||||
|
b_parallelNum.setSelection(false);
|
||||||
|
} else {
|
||||||
|
b_parallelOpt.setSelection(getParallelDef(icfg));
|
||||||
|
b_parallelNum.setSelection(!getParallelDef(icfg));
|
||||||
|
}
|
||||||
|
}
|
||||||
t_autoBuild.setText(bldr.getBuildAttribute(IBuilder.BUILD_TARGET_AUTO, EMPTY_STR));
|
t_autoBuild.setText(bldr.getBuildAttribute(IBuilder.BUILD_TARGET_AUTO, EMPTY_STR));
|
||||||
b_cmdBuild.setSelection(bldr.isIncrementalBuildEnabled());
|
|
||||||
t_cmdBuild.setText(bldr.getBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, EMPTY_STR));
|
t_cmdBuild.setText(bldr.getBuildAttribute(IBuilder.BUILD_TARGET_INCREMENTAL, EMPTY_STR));
|
||||||
b_cmdClean.setSelection(bldr.isCleanBuildEnabled());
|
|
||||||
t_cmdClean.setText(bldr.getBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, EMPTY_STR));
|
t_cmdClean.setText(bldr.getBuildAttribute(IBuilder.BUILD_TARGET_CLEAN, EMPTY_STR));
|
||||||
|
|
||||||
boolean external = ! isInternalBuilderEnabled();
|
boolean external = ! isInternalBuilderEnabled();
|
||||||
|
@ -282,9 +310,9 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
((Control)t_cmdClean.getData()).setVisible(external);
|
((Control)t_cmdClean.getData()).setVisible(external);
|
||||||
|
|
||||||
if (external) {
|
if (external) {
|
||||||
checkPressed(b_autoBuild);
|
checkPressed(b_autoBuild, false);
|
||||||
checkPressed(b_cmdBuild);
|
checkPressed(b_cmdBuild, false);
|
||||||
checkPressed(b_cmdClean);
|
checkPressed(b_cmdClean, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,11 +346,11 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkPressed(SelectionEvent e) {
|
public void checkPressed(SelectionEvent e) {
|
||||||
checkPressed((Control)e.widget);
|
checkPressed((Control)e.widget, true);
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkPressed(Control b) {
|
private void checkPressed(Control b, boolean needsUpdate) {
|
||||||
if (b == null) return;
|
if (b == null) return;
|
||||||
|
|
||||||
boolean val = false;
|
boolean val = false;
|
||||||
|
@ -336,7 +364,8 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
c.setEnabled(val);
|
c.setEnabled(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setValue(b, val);
|
if (needsUpdate)
|
||||||
|
setValue(b, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -379,11 +408,11 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
updateData(getResDesc());
|
updateData(getResDesc());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getParallelDef() {
|
private static boolean getParallelDef(IConfiguration cfg) {
|
||||||
if (icfg instanceof Configuration)
|
if (cfg instanceof Configuration)
|
||||||
return ((Configuration)icfg).getParallelDef();
|
return ((Configuration)cfg).getParallelDef();
|
||||||
if (icfg instanceof IMultiConfiguration)
|
if (cfg instanceof IMultiConfiguration)
|
||||||
return ((IMultiConfiguration)icfg).getParallelDef();
|
return ((IMultiConfiguration)cfg).getParallelDef();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,13 +95,13 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
//tool command-line-pattern field
|
//tool command-line-pattern field
|
||||||
private StringFieldEditor commandLinePatternField;
|
private StringFieldEditor commandLinePatternField;
|
||||||
// A list of safe options to put unrecognized values in
|
// A list of safe options to put unrecognized values in
|
||||||
private Vector defaultOptionNames;
|
private Vector<String> defaultOptionNames;
|
||||||
// Map that holds all string options and its values
|
// Map that holds all string options and its values
|
||||||
private HashMap stringOptionsMap;
|
private HashMap<String, String> stringOptionsMap;
|
||||||
|
|
||||||
private ITool fTool;
|
private ITool fTool;
|
||||||
// Map that holds all user object options and its values
|
// Map that holds all user object options and its values
|
||||||
private HashMap userObjsMap;
|
private HashMap<String, String> userObjsMap;
|
||||||
|
|
||||||
public BuildToolSettingUI(AbstractCBuildPropertyTab page,
|
public BuildToolSettingUI(AbstractCBuildPropertyTab page,
|
||||||
IResourceInfo info, ITool _tool) {
|
IResourceInfo info, ITool _tool) {
|
||||||
|
@ -110,8 +110,8 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
super(info);
|
super(info);
|
||||||
this.fTool = _tool;
|
this.fTool = _tool;
|
||||||
buildPropPage = page;
|
buildPropPage = page;
|
||||||
stringOptionsMap = new HashMap();
|
stringOptionsMap = new HashMap<String, String>();
|
||||||
userObjsMap = new HashMap();
|
userObjsMap = new HashMap<String, String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -173,9 +173,9 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Vector getDefaultOptionNames() {
|
private Vector<String> getDefaultOptionNames() {
|
||||||
if (defaultOptionNames == null) {
|
if (defaultOptionNames == null) {
|
||||||
defaultOptionNames = new Vector();
|
defaultOptionNames = new Vector<String>();
|
||||||
defaultOptionNames.add("Other flags"); //$NON-NLS-1$
|
defaultOptionNames.add("Other flags"); //$NON-NLS-1$
|
||||||
defaultOptionNames.add("Linker flags"); //$NON-NLS-1$
|
defaultOptionNames.add("Linker flags"); //$NON-NLS-1$
|
||||||
defaultOptionNames.add("Archiver flags"); //$NON-NLS-1$
|
defaultOptionNames.add("Archiver flags"); //$NON-NLS-1$
|
||||||
|
@ -201,11 +201,11 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
* @param rawOptionString
|
* @param rawOptionString
|
||||||
* @return Vector containing all options
|
* @return Vector containing all options
|
||||||
*/
|
*/
|
||||||
private Vector getOptionVector(String rawOptionString){
|
private Vector<String> getOptionVector(String rawOptionString){
|
||||||
Vector tokens = new Vector(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$
|
Vector<String> tokens = new Vector<String>(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$
|
||||||
Vector output = new Vector(tokens.size());
|
Vector<String> output = new Vector<String>(tokens.size());
|
||||||
|
|
||||||
Iterator iter = tokens.iterator();
|
Iterator<String> iter = tokens.iterator();
|
||||||
while(iter.hasNext()){
|
while(iter.hasNext()){
|
||||||
String token = (String)iter.next();
|
String token = (String)iter.next();
|
||||||
int firstIndex = token.indexOf("\""); //$NON-NLS-1$
|
int firstIndex = token.indexOf("\""); //$NON-NLS-1$
|
||||||
|
@ -254,30 +254,25 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
String alloptions = getToolSettingsPrefStore().getString(ToolSettingsPrefStore.ALL_OPTIONS_ID);
|
String alloptions = getToolSettingsPrefStore().getString(ToolSettingsPrefStore.ALL_OPTIONS_ID);
|
||||||
// list that holds the options for the option type other than
|
// list that holds the options for the option type other than
|
||||||
// boolean,string and enumerated
|
// boolean,string and enumerated
|
||||||
List optionsList = new ArrayList();
|
List<String> optionsList = new ArrayList<String>();
|
||||||
// additional options buffer
|
// additional options buffer
|
||||||
StringBuffer addnOptions = new StringBuffer();
|
StringBuffer addnOptions = new StringBuffer();
|
||||||
// split all build options string
|
// split all build options string
|
||||||
Vector optionsArr = getOptionVector(alloptions);
|
Vector<String> optionsArr = getOptionVector(alloptions);
|
||||||
Iterator optIter = optionsArr.iterator();
|
for (String optionValue : optionsArr) {
|
||||||
while(optIter.hasNext()) {
|
|
||||||
String optionValue = (String)optIter.next();
|
|
||||||
boolean optionValueExist = false;
|
boolean optionValueExist = false;
|
||||||
// get the options for this tool
|
// get the options for this tool
|
||||||
IOption[] options = fTool.getOptions();
|
IOption[] options = fTool.getOptions();
|
||||||
for (int k = 0; k < options.length; ++k) {
|
for (IOption opt : options) {
|
||||||
IOption opt = options[k];
|
|
||||||
//String name = opt.getId();
|
//String name = opt.getId();
|
||||||
// check whether the option value is "STRING" type
|
// check whether the option value is "STRING" type
|
||||||
Iterator stringOptsIter = stringOptionsMap.values().iterator();
|
for (String s : stringOptionsMap.values()) {
|
||||||
while (stringOptsIter.hasNext()) {
|
if (s.indexOf(optionValue) != -1)
|
||||||
if (((String) stringOptsIter.next()).indexOf(optionValue) != -1)
|
|
||||||
optionValueExist = true;
|
optionValueExist = true;
|
||||||
}
|
}
|
||||||
// check whether the option value is "OBJECTS" type
|
// check whether the option value is "OBJECTS" type
|
||||||
Iterator userObjsIter = userObjsMap.values().iterator();
|
for (String s : userObjsMap.values()) {
|
||||||
while (userObjsIter.hasNext()) {
|
if (s.indexOf(optionValue) != -1)
|
||||||
if (((String) userObjsIter.next()).indexOf(optionValue) != -1)
|
|
||||||
optionValueExist = true;
|
optionValueExist = true;
|
||||||
}
|
}
|
||||||
// if the value does not exist in string option or user objects
|
// if the value does not exist in string option or user objects
|
||||||
|
@ -350,9 +345,9 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
// check whether some of the "STRING" option value or "OBJECTS" type
|
// check whether some of the "STRING" option value or "OBJECTS" type
|
||||||
// option value removed
|
// option value removed
|
||||||
// by the user from all build option field
|
// by the user from all build option field
|
||||||
Set set = stringOptionsMap.keySet();
|
Set<String> set = stringOptionsMap.keySet();
|
||||||
for (int s = 0; s < set.size(); s++) {
|
for (int i = 0; i < set.size(); i++) {
|
||||||
Iterator iterator = set.iterator();
|
Iterator<String> iterator = set.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Object key = iterator.next();
|
Object key = iterator.next();
|
||||||
String val = (String) stringOptionsMap.get(key);
|
String val = (String) stringOptionsMap.get(key);
|
||||||
|
@ -369,13 +364,13 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// "OBJECTS" type
|
// "OBJECTS" type
|
||||||
Set objSet = userObjsMap.keySet();
|
Set<String> objSet = userObjsMap.keySet();
|
||||||
for (int s = 0; s < objSet.size(); s++) {
|
for (int s = 0; s < objSet.size(); s++) {
|
||||||
Iterator iterator = objSet.iterator();
|
Iterator iterator = objSet.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Object key = iterator.next();
|
Object key = iterator.next();
|
||||||
String val = (String) userObjsMap.get(key);
|
String val = (String) userObjsMap.get(key);
|
||||||
ArrayList list = new ArrayList();
|
ArrayList<String> list = new ArrayList<String>();
|
||||||
String[] vals = parseString(val);
|
String[] vals = parseString(val);
|
||||||
for (int t = 0; t < vals.length; t++) {
|
for (int t = 0; t < vals.length; t++) {
|
||||||
if (alloptions.indexOf(vals[t]) != -1)
|
if (alloptions.indexOf(vals[t]) != -1)
|
||||||
|
@ -397,7 +392,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
try {
|
try {
|
||||||
switch (opt.getValueType()) {
|
switch (opt.getValueType()) {
|
||||||
case IOption.BOOLEAN :
|
case IOption.BOOLEAN :
|
||||||
ArrayList optsList = new ArrayList(optionsArr);
|
ArrayList<String> optsList = new ArrayList<String>(optionsArr);
|
||||||
if (opt.getCommand() != null
|
if (opt.getCommand() != null
|
||||||
&& opt.getCommand().length() > 0
|
&& opt.getCommand().length() > 0
|
||||||
&& !optsList.contains(opt.getCommand()))
|
&& !optsList.contains(opt.getCommand()))
|
||||||
|
@ -422,7 +417,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
||||||
case IOption.INCLUDE_PATH :
|
case IOption.INCLUDE_PATH :
|
||||||
case IOption.PREPROCESSOR_SYMBOLS :
|
case IOption.PREPROCESSOR_SYMBOLS :
|
||||||
case IOption.LIBRARIES :
|
case IOption.LIBRARIES :
|
||||||
ArrayList newList = new ArrayList();
|
ArrayList<String> newList = new ArrayList<String>();
|
||||||
for (int i = 0; i < optionsList.size(); i++) {
|
for (int i = 0; i < optionsList.size(); i++) {
|
||||||
if (opt.getCommand() != null
|
if (opt.getCommand() != null
|
||||||
&& ((String) optionsList.get(i)).startsWith(opt
|
&& ((String) optionsList.get(i)).startsWith(opt
|
||||||
|
|
|
@ -126,27 +126,21 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
protected void updateButtons() {
|
protected void updateButtons() {
|
||||||
bldr = icfg.getEditableBuilder();
|
bldr = icfg.getEditableBuilder();
|
||||||
|
|
||||||
int[] extStates = BuildBehaviourTab.calc3states(page, icfg, true);
|
int[] extStates = BuildBehaviourTab.calc3states(page, icfg, 0);
|
||||||
|
|
||||||
b_genMakefileAuto.setEnabled(icfg.supportsBuild(true));
|
b_genMakefileAuto.setEnabled(icfg.supportsBuild(true));
|
||||||
if (extStates == null) { // no extended states available
|
if (extStates == null) { // no extended states available
|
||||||
BuildBehaviourTab.setTriSelection(b_genMakefileAuto,
|
BuildBehaviourTab.setTriSelection(b_genMakefileAuto,
|
||||||
bldr.isManagedBuildOn() ?
|
bldr.isManagedBuildOn());
|
||||||
BuildBehaviourTab.TRI_YES :
|
|
||||||
BuildBehaviourTab.TRI_NO);
|
|
||||||
BuildBehaviourTab.setTriSelection(b_useDefault,
|
BuildBehaviourTab.setTriSelection(b_useDefault,
|
||||||
bldr.isDefaultBuildCmd() ?
|
bldr.isDefaultBuildCmd());
|
||||||
BuildBehaviourTab.TRI_YES :
|
|
||||||
BuildBehaviourTab.TRI_NO);
|
|
||||||
// b_expandVars.setGrayed(false);
|
// b_expandVars.setGrayed(false);
|
||||||
if(!bldr.canKeepEnvironmentVariablesInBuildfile())
|
if(!bldr.canKeepEnvironmentVariablesInBuildfile())
|
||||||
b_expandVars.setEnabled(false);
|
b_expandVars.setEnabled(false);
|
||||||
else {
|
else {
|
||||||
b_expandVars.setEnabled(true);
|
b_expandVars.setEnabled(true);
|
||||||
BuildBehaviourTab.setTriSelection(b_expandVars,
|
BuildBehaviourTab.setTriSelection(b_expandVars,
|
||||||
!bldr.keepEnvironmentVariablesInBuildfile() ?
|
!bldr.keepEnvironmentVariablesInBuildfile());
|
||||||
BuildBehaviourTab.TRI_YES :
|
|
||||||
BuildBehaviourTab.TRI_NO);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BuildBehaviourTab.setTriSelection(b_genMakefileAuto, extStates[0]);
|
BuildBehaviourTab.setTriSelection(b_genMakefileAuto, extStates[0]);
|
||||||
|
@ -186,8 +180,8 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
if (b_expandVars.getEnabled())
|
if (b_expandVars.getEnabled())
|
||||||
b_expandVars.setEnabled(external && b_genMakefileAuto.getSelection());
|
b_expandVars.setEnabled(external && b_genMakefileAuto.getSelection());
|
||||||
|
|
||||||
if (external) {
|
if (external) { // just set relatet text widget state,
|
||||||
checkPressed(b_useDefault);
|
checkPressed(b_useDefault, false); // do not update
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,11 +238,11 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkPressed(SelectionEvent e) {
|
public void checkPressed(SelectionEvent e) {
|
||||||
checkPressed((Control)e.widget);
|
checkPressed((Control)e.widget, true);
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkPressed(Control b) {
|
private void checkPressed(Control b, boolean needUpdate) {
|
||||||
if (b == null) return;
|
if (b == null) return;
|
||||||
|
|
||||||
boolean val = false;
|
boolean val = false;
|
||||||
|
@ -263,6 +257,11 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
c.setEnabled(val);
|
c.setEnabled(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// call may be used just to set text state above
|
||||||
|
// in this case, settings update is not required
|
||||||
|
if (! needUpdate)
|
||||||
|
return;
|
||||||
|
|
||||||
if (b == b_useDefault) {
|
if (b == b_useDefault) {
|
||||||
setUseDefaultBuildCmd(!val);
|
setUseDefaultBuildCmd(!val);
|
||||||
} else if (b == b_genMakefileAuto) {
|
} else if (b == b_genMakefileAuto) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<classpathentry kind="src" path="utils.ui"/>
|
<classpathentry kind="src" path="utils.ui"/>
|
||||||
<classpathentry kind="src" path="browser"/>
|
<classpathentry kind="src" path="browser"/>
|
||||||
<classpathentry kind="src" path="templateengine"/>
|
<classpathentry kind="src" path="templateengine"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#Wed Nov 28 11:20:40 CET 2007
|
#Thu Jan 31 11:29:21 MSK 2008
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.4
|
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
@ -16,7 +16,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
|
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
|
||||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
|
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||||
|
@ -77,7 +77,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.4
|
org.eclipse.jdt.core.compiler.source=1.5
|
||||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||||
|
@ -121,11 +121,9 @@ org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
|
|
||||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||||
org.eclipse.jdt.core.formatter.comment.format_comments=true
|
|
||||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||||
|
|
|
@ -84,5 +84,5 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)",
|
||||||
org.eclipse.ltk.core.refactoring,
|
org.eclipse.ltk.core.refactoring,
|
||||||
org.eclipse.ui.views.log;bundle-version="1.0.0"
|
org.eclipse.ui.views.log;bundle-version="1.0.0"
|
||||||
Eclipse-LazyStart: true
|
Eclipse-LazyStart: true
|
||||||
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||||
Import-Package: com.ibm.icu.text
|
Import-Package: com.ibm.icu.text
|
||||||
|
|
|
@ -531,6 +531,16 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
||||||
return fFontMetrics;
|
return fFontMetrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets checkbox to appropriate state:
|
||||||
|
* unchecked or checked
|
||||||
|
* @param b - checkbox to set
|
||||||
|
* @param state
|
||||||
|
*/
|
||||||
|
public static void setTriSelection(Button b, boolean state) {
|
||||||
|
setTriSelection(b, state ? TRI_YES : TRI_NO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets checkbox to appropriate state:
|
* Sets checkbox to appropriate state:
|
||||||
* unchecked, checked or unknown (grayed)
|
* unchecked, checked or unknown (grayed)
|
||||||
|
|
|
@ -154,7 +154,7 @@ implements
|
||||||
|
|
||||||
// tabs
|
// tabs
|
||||||
protected TabFolder folder;
|
protected TabFolder folder;
|
||||||
protected ArrayList itabs = new ArrayList();
|
protected ArrayList<InternalTab> itabs = new ArrayList<InternalTab>();
|
||||||
protected ICPropertyTab currentTab;
|
protected ICPropertyTab currentTab;
|
||||||
|
|
||||||
private static boolean isNewOpening = true;
|
private static boolean isNewOpening = true;
|
||||||
|
@ -915,7 +915,7 @@ implements
|
||||||
if (folder == null) {
|
if (folder == null) {
|
||||||
if (itabs == null || itabs.size() == 0)
|
if (itabs == null || itabs.size() == 0)
|
||||||
return;
|
return;
|
||||||
ICPropertyTab t = ((InternalTab)itabs.get(0)).tab;
|
ICPropertyTab t = itabs.get(0).tab;
|
||||||
if (! t.canBeVisible())
|
if (! t.canBeVisible())
|
||||||
t.handleTabEvent(ICPropertyTab.VISIBLE, null);
|
t.handleTabEvent(ICPropertyTab.VISIBLE, null);
|
||||||
return;
|
return;
|
||||||
|
@ -925,7 +925,7 @@ implements
|
||||||
int x = folder.getSelectionIndex();
|
int x = folder.getSelectionIndex();
|
||||||
String currHeader = (x == -1) ? null : ts[x].getText();
|
String currHeader = (x == -1) ? null : ts[x].getText();
|
||||||
for (int i=0; i<itabs.size(); i++) {
|
for (int i=0; i<itabs.size(); i++) {
|
||||||
InternalTab itab = (InternalTab)itabs.get(i);
|
InternalTab itab = itabs.get(i);
|
||||||
TabItem ti = null;
|
TabItem ti = null;
|
||||||
for (int j=0; j<ts.length; j++) {
|
for (int j=0; j<ts.length; j++) {
|
||||||
if (ts[j].isDisposed()) continue;
|
if (ts[j].isDisposed()) continue;
|
||||||
|
@ -951,7 +951,7 @@ implements
|
||||||
ts[j].dispose();
|
ts[j].dispose();
|
||||||
TabItem ti = null;
|
TabItem ti = null;
|
||||||
for (int i=0; i<itabs.size(); i++) {
|
for (int i=0; i<itabs.size(); i++) {
|
||||||
InternalTab itab = (InternalTab)itabs.get(i);
|
InternalTab itab = itabs.get(i);
|
||||||
if (itab.tab.canBeVisible()) {
|
if (itab.tab.canBeVisible()) {
|
||||||
TabItem currTI = itab.createOn(folder);
|
TabItem currTI = itab.createOn(folder);
|
||||||
if (currHeader != null && currHeader.equals(itab.text))
|
if (currHeader != null && currHeader.equals(itab.text))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 Intel Corporation and others
|
* Copyright (c) 2005, 2008 Intel Corporation and others
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -18,10 +18,10 @@ import org.eclipse.cdt.core.model.util.CDTListComparator;
|
||||||
import org.eclipse.cdt.ui.newui.AbstractExportTab.ExtData;
|
import org.eclipse.cdt.ui.newui.AbstractExportTab.ExtData;
|
||||||
import org.eclipse.cdt.ui.wizards.EntryDescriptor;
|
import org.eclipse.cdt.ui.wizards.EntryDescriptor;
|
||||||
|
|
||||||
public class CDTUIListComparator extends CDTListComparator implements Comparator {
|
public class CDTUIListComparator extends CDTListComparator implements Comparator<Object> {
|
||||||
private static Comparator comparator = null;
|
private static Comparator<Object> comparator = null;
|
||||||
|
|
||||||
public static Comparator getInstance() {
|
public static Comparator<Object> getInstance() {
|
||||||
if (comparator == null)
|
if (comparator == null)
|
||||||
comparator = new CDTUIListComparator();
|
comparator = new CDTUIListComparator();
|
||||||
return comparator;
|
return comparator;
|
||||||
|
|
Loading…
Add table
Reference in a new issue