diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java index 3b4b09da2bd..c2045279e7e 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildBehaviourTab.java @@ -47,19 +47,19 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab { private static final int TRI_STATES_SIZE = 4; // Widgets //3 - private Button b_stopOnError; - private Button b_parallel; + private Button b_stopOnError; // 3 + private Button b_parallel; // 3 private Button b_parallelOpt; private Button b_parallelNum; private Spinner parallelProcesses; private Label title2; - private Button b_autoBuild; + private Button b_autoBuild; //3 private Text t_autoBuild; - private Button b_cmdBuild; + private Button b_cmdBuild; //3 private Text t_cmdBuild; - private Button b_cmdClean; + private Button b_cmdClean; // 3 private Text t_cmdClean; private IBuilder bldr; @@ -186,32 +186,46 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab { * 1: supportsStopOnError(true) * 2: bld.supportsStopOnError(false) * 3: cfg.getInternalBuilderParallel() + * Mode 2: + * 0: b.isAutoBuildEnable() + * 1: b.isIncrementalBuildEnabled() + * 2: b.isCleanBuildEnabled() + * 3: getParallelDef() */ static int[] calc3states(ICPropertyProvider p, IConfiguration c, - boolean p0) { + int mode) { if (p.isMultiCfg() && c instanceof ICMultiItemsHolder) { + boolean p0 = (mode == 0); + boolean p1 = (mode == 1); + IConfiguration[] cfs = (IConfiguration[])((ICMultiItemsHolder)c).getItems(); IBuilder b = cfs[0].getBuilder(); int[] res = new int[TRI_STATES_SIZE]; boolean[] x = new boolean[TRI_STATES_SIZE]; - x[0] = p0 ? b.isManagedBuildOn() : b.isStopOnError(); - x[1] = p0 ? b.isDefaultBuildCmd(): b.supportsStopOnError(true); + x[0] = p0 ? b.isManagedBuildOn() : + (p1 ? b.isStopOnError() : b.isAutoBuildEnable()); + x[1] = p0 ? b.isDefaultBuildCmd(): + (p1 ? b.supportsStopOnError(true) : b.isIncrementalBuildEnabled() ); x[2] = p0 ? b.canKeepEnvironmentVariablesInBuildfile() : - b.supportsStopOnError(false); + (p1 ? b.supportsStopOnError(false) : b.isCleanBuildEnabled()); x[3] = p0 ? b.keepEnvironmentVariablesInBuildfile() : - ((Configuration)cfs[0]).getInternalBuilderParallel(); + ( p1 ? ((Configuration)cfs[0]).getInternalBuilderParallel() : getParallelDef(c)); for (int i=1; i defaultOptionNames; // Map that holds all string options and its values - private HashMap stringOptionsMap; + private HashMap stringOptionsMap; private ITool fTool; // Map that holds all user object options and its values - private HashMap userObjsMap; + private HashMap userObjsMap; public BuildToolSettingUI(AbstractCBuildPropertyTab page, IResourceInfo info, ITool _tool) { @@ -110,8 +110,8 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { super(info); this.fTool = _tool; buildPropPage = page; - stringOptionsMap = new HashMap(); - userObjsMap = new HashMap(); + stringOptionsMap = new HashMap(); + userObjsMap = new HashMap(); } /* (non-Javadoc) @@ -173,9 +173,9 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { /** * @return */ - private Vector getDefaultOptionNames() { + private Vector getDefaultOptionNames() { if (defaultOptionNames == null) { - defaultOptionNames = new Vector(); + defaultOptionNames = new Vector(); defaultOptionNames.add("Other flags"); //$NON-NLS-1$ defaultOptionNames.add("Linker flags"); //$NON-NLS-1$ defaultOptionNames.add("Archiver flags"); //$NON-NLS-1$ @@ -201,11 +201,11 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { * @param rawOptionString * @return Vector containing all options */ - private Vector getOptionVector(String rawOptionString){ - Vector tokens = new Vector(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$ - Vector output = new Vector(tokens.size()); + private Vector getOptionVector(String rawOptionString){ + Vector tokens = new Vector(Arrays.asList(rawOptionString.split("\\s"))); //$NON-NLS-1$ + Vector output = new Vector(tokens.size()); - Iterator iter = tokens.iterator(); + Iterator iter = tokens.iterator(); while(iter.hasNext()){ String token = (String)iter.next(); int firstIndex = token.indexOf("\""); //$NON-NLS-1$ @@ -254,30 +254,25 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { String alloptions = getToolSettingsPrefStore().getString(ToolSettingsPrefStore.ALL_OPTIONS_ID); // list that holds the options for the option type other than // boolean,string and enumerated - List optionsList = new ArrayList(); + List optionsList = new ArrayList(); // additional options buffer StringBuffer addnOptions = new StringBuffer(); // split all build options string - Vector optionsArr = getOptionVector(alloptions); - Iterator optIter = optionsArr.iterator(); - while(optIter.hasNext()) { - String optionValue = (String)optIter.next(); + Vector optionsArr = getOptionVector(alloptions); + for (String optionValue : optionsArr) { boolean optionValueExist = false; // get the options for this tool IOption[] options = fTool.getOptions(); - for (int k = 0; k < options.length; ++k) { - IOption opt = options[k]; + for (IOption opt : options) { //String name = opt.getId(); // check whether the option value is "STRING" type - Iterator stringOptsIter = stringOptionsMap.values().iterator(); - while (stringOptsIter.hasNext()) { - if (((String) stringOptsIter.next()).indexOf(optionValue) != -1) + for (String s : stringOptionsMap.values()) { + if (s.indexOf(optionValue) != -1) optionValueExist = true; } // check whether the option value is "OBJECTS" type - Iterator userObjsIter = userObjsMap.values().iterator(); - while (userObjsIter.hasNext()) { - if (((String) userObjsIter.next()).indexOf(optionValue) != -1) + for (String s : userObjsMap.values()) { + if (s.indexOf(optionValue) != -1) optionValueExist = true; } // 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 // option value removed // by the user from all build option field - Set set = stringOptionsMap.keySet(); - for (int s = 0; s < set.size(); s++) { - Iterator iterator = set.iterator(); + Set set = stringOptionsMap.keySet(); + for (int i = 0; i < set.size(); i++) { + Iterator iterator = set.iterator(); while (iterator.hasNext()) { Object key = iterator.next(); String val = (String) stringOptionsMap.get(key); @@ -369,13 +364,13 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { } } // "OBJECTS" type - Set objSet = userObjsMap.keySet(); + Set objSet = userObjsMap.keySet(); for (int s = 0; s < objSet.size(); s++) { Iterator iterator = objSet.iterator(); while (iterator.hasNext()) { Object key = iterator.next(); String val = (String) userObjsMap.get(key); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); String[] vals = parseString(val); for (int t = 0; t < vals.length; t++) { if (alloptions.indexOf(vals[t]) != -1) @@ -397,7 +392,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { try { switch (opt.getValueType()) { case IOption.BOOLEAN : - ArrayList optsList = new ArrayList(optionsArr); + ArrayList optsList = new ArrayList(optionsArr); if (opt.getCommand() != null && opt.getCommand().length() > 0 && !optsList.contains(opt.getCommand())) @@ -422,7 +417,7 @@ public class BuildToolSettingUI extends AbstractToolSettingUI { case IOption.INCLUDE_PATH : case IOption.PREPROCESSOR_SYMBOLS : case IOption.LIBRARIES : - ArrayList newList = new ArrayList(); + ArrayList newList = new ArrayList(); for (int i = 0; i < optionsList.size(); i++) { if (opt.getCommand() != null && ((String) optionsList.get(i)).startsWith(opt diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java index 32a10bd9967..c1bed12e586 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuilderSettingsTab.java @@ -126,27 +126,21 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab { protected void updateButtons() { bldr = icfg.getEditableBuilder(); - int[] extStates = BuildBehaviourTab.calc3states(page, icfg, true); + int[] extStates = BuildBehaviourTab.calc3states(page, icfg, 0); b_genMakefileAuto.setEnabled(icfg.supportsBuild(true)); if (extStates == null) { // no extended states available BuildBehaviourTab.setTriSelection(b_genMakefileAuto, - bldr.isManagedBuildOn() ? - BuildBehaviourTab.TRI_YES : - BuildBehaviourTab.TRI_NO); + bldr.isManagedBuildOn()); BuildBehaviourTab.setTriSelection(b_useDefault, - bldr.isDefaultBuildCmd() ? - BuildBehaviourTab.TRI_YES : - BuildBehaviourTab.TRI_NO); + bldr.isDefaultBuildCmd()); // b_expandVars.setGrayed(false); if(!bldr.canKeepEnvironmentVariablesInBuildfile()) b_expandVars.setEnabled(false); else { b_expandVars.setEnabled(true); BuildBehaviourTab.setTriSelection(b_expandVars, - !bldr.keepEnvironmentVariablesInBuildfile() ? - BuildBehaviourTab.TRI_YES : - BuildBehaviourTab.TRI_NO); + !bldr.keepEnvironmentVariablesInBuildfile()); } } else { BuildBehaviourTab.setTriSelection(b_genMakefileAuto, extStates[0]); @@ -186,8 +180,8 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab { if (b_expandVars.getEnabled()) b_expandVars.setEnabled(external && b_genMakefileAuto.getSelection()); - if (external) { - checkPressed(b_useDefault); + if (external) { // just set relatet text widget state, + checkPressed(b_useDefault, false); // do not update } } @@ -244,11 +238,11 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab { } public void checkPressed(SelectionEvent e) { - checkPressed((Control)e.widget); + checkPressed((Control)e.widget, true); updateButtons(); } - private void checkPressed(Control b) { + private void checkPressed(Control b, boolean needUpdate) { if (b == null) return; boolean val = false; @@ -263,6 +257,11 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab { 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) { setUseDefaultBuildCmd(!val); } else if (b == b_genMakefileAuto) { diff --git a/core/org.eclipse.cdt.ui/.classpath b/core/org.eclipse.cdt.ui/.classpath index 07ee51f5d6a..7eaf69875e9 100644 --- a/core/org.eclipse.cdt.ui/.classpath +++ b/core/org.eclipse.cdt.ui/.classpath @@ -4,7 +4,7 @@ - + diff --git a/core/org.eclipse.cdt.ui/.settings/org.eclipse.jdt.core.prefs b/core/org.eclipse.cdt.ui/.settings/org.eclipse.jdt.core.prefs index 3dad84d7196..c5d5e882e5a 100644 --- a/core/org.eclipse.cdt.ui/.settings/org.eclipse.jdt.core.prefs +++ b/core/org.eclipse.cdt.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ -#Wed Nov 28 11:20:40 CET 2007 +#Thu Jan 31 11:29:21 MSK 2008 eclipse.preferences.version=1 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.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.localVariable=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.discouragedReference=error 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.fatalOptionalError=enabled 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.unusedWarningToken=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.alignment_for_arguments_in_allocation_expression=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_switch=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_javadoc_comment=false 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_html=true org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true diff --git a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF index 2230991781d..b35f7790c2e 100644 --- a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF +++ b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF @@ -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.ui.views.log;bundle-version="1.0.0" Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: com.ibm.icu.text diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java index 60ae30598c9..1e12da69b6a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractCPropertyTab.java @@ -531,6 +531,16 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab { 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: * unchecked, checked or unknown (grayed) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java index 3f44c46f45d..15bcd6bf8d2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java @@ -154,7 +154,7 @@ implements // tabs protected TabFolder folder; - protected ArrayList itabs = new ArrayList(); + protected ArrayList itabs = new ArrayList(); protected ICPropertyTab currentTab; private static boolean isNewOpening = true; @@ -915,7 +915,7 @@ implements if (folder == null) { if (itabs == null || itabs.size() == 0) return; - ICPropertyTab t = ((InternalTab)itabs.get(0)).tab; + ICPropertyTab t = itabs.get(0).tab; if (! t.canBeVisible()) t.handleTabEvent(ICPropertyTab.VISIBLE, null); return; @@ -925,7 +925,7 @@ implements int x = folder.getSelectionIndex(); String currHeader = (x == -1) ? null : ts[x].getText(); for (int i=0; i { + private static Comparator comparator = null; - public static Comparator getInstance() { + public static Comparator getInstance() { if (comparator == null) comparator = new CDTUIListComparator(); return comparator;