diff options
author | Andrew Gvozdev | 2012-01-27 19:21:25 +0000 |
---|---|---|
committer | Andrew Gvozdev | 2012-01-27 19:21:25 +0000 |
commit | 0b6b6c8b994538a2384003dff38f6aaff1471c23 (patch) | |
tree | e00b4ddddf1924bdd01c70efa289cff7c8cafd86 /xlc/org.eclipse.cdt.managedbuilder.xlc.ui | |
parent | 6fcb52fe97166e7599969eeada5ac3beeaec12a2 (diff) | |
download | org.eclipse.cdt-0b6b6c8b994538a2384003dff38f6aaff1471c23.tar.gz org.eclipse.cdt-0b6b6c8b994538a2384003dff38f6aaff1471c23.tar.xz org.eclipse.cdt-0b6b6c8b994538a2384003dff38f6aaff1471c23.zip |
@Override annotations and other cleanup
Diffstat (limited to 'xlc/org.eclipse.cdt.managedbuilder.xlc.ui')
15 files changed, 240 insertions, 188 deletions
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixConfigurationEnvironmentSupplier.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixConfigurationEnvironmentSupplier.java index 682ef830ab8..735e824ca9e 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixConfigurationEnvironmentSupplier.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixConfigurationEnvironmentSupplier.java @@ -20,32 +20,34 @@ import org.eclipse.cdt.managedbuilder.internal.envvar.BuildEnvVar; public class AixConfigurationEnvironmentSupplier implements IConfigurationEnvironmentVariableSupplier { static final String VARNAME = "PATH"; - static final String BINPATH = "/usr/vac/bin"; - static final String DELIMITER_AIX = ":"; - static final String PROPERTY_DELIMITER = "path.separator"; - static final String PROPERTY_OSNAME = "os.name"; + static final String BINPATH = "/usr/vac/bin"; + static final String DELIMITER_AIX = ":"; + static final String PROPERTY_DELIMITER = "path.separator"; + static final String PROPERTY_OSNAME = "os.name"; /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier#getVariable(java.lang.String, org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider) */ + @Override public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider) { - + if (variableName == null) return null; if (!VARNAME.equalsIgnoreCase(variableName)) return null; - return new BuildEnvVar(VARNAME, BINPATH, - IBuildEnvironmentVariable.ENVVAR_PREPEND, - System.getProperty(PROPERTY_DELIMITER, DELIMITER_AIX)); + return new BuildEnvVar(VARNAME, BINPATH, + IBuildEnvironmentVariable.ENVVAR_PREPEND, + System.getProperty(PROPERTY_DELIMITER, DELIMITER_AIX)); } /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier#getVariables(org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider) */ + @Override public IBuildEnvironmentVariable[] getVariables( IConfiguration configuration, IEnvironmentVariableProvider provider) { - - IBuildEnvironmentVariable[] tmp = new IBuildEnvironmentVariable[1]; + + IBuildEnvironmentVariable[] tmp = new IBuildEnvironmentVariable[1]; tmp[0] = getVariable(VARNAME, configuration, provider); - if (tmp[0] != null) return tmp; + if (tmp[0] != null) return tmp; return null; } } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixPathResolver.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixPathResolver.java index 1c3ab094429..ae2557c7434 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixPathResolver.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/aix/AixPathResolver.java @@ -16,10 +16,11 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration; public class AixPathResolver implements IBuildPathResolver { static final String DELIMITER_AIX = ":"; - + /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IBuildPathResolver#resolveBuildPaths(int, java.lang.String, java.lang.String, org.eclipse.cdt.managedbuilder.core.IConfiguration) */ + @Override public String[] resolveBuildPaths(int pathType, String variableName, String variableValue, IConfiguration configuration) { return variableValue.split(DELIMITER_AIX); diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCProjectMacroSupplier.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCProjectMacroSupplier.java index 80db6253dd7..4f614e44c67 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCProjectMacroSupplier.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCProjectMacroSupplier.java @@ -31,14 +31,15 @@ public class XLCProjectMacroSupplier implements IProjectBuildMacroSupplier { /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.macros.IProjectBuildMacroSupplier#getMacro(java.lang.String, org.eclipse.cdt.managedbuilder.core.IManagedProject, org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider) */ + @Override public IBuildMacro getMacro(String macroName, IManagedProject project, IBuildMacroProvider provider) { - + if(macroName.equals(PreferenceConstants.P_XL_COMPILER_ROOT)) { String compilerPath = null; - + // figure out compiler path from properties and preferences - + // search for property first IProject theProject = (IProject) project.getOwner(); try { @@ -48,19 +49,19 @@ public class XLCProjectMacroSupplier implements IProjectBuildMacroSupplier { // TODO Auto-generated catch block e.printStackTrace(); } - + if(compilerPath == null) { // use the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); compilerPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); } - - BuildMacro macro = new BuildMacro(macroName, ICdtVariable.VALUE_PATH_DIR, + + BuildMacro macro = new BuildMacro(macroName, ICdtVariable.VALUE_PATH_DIR, compilerPath); - + return macro; } - + else return provider.getMacro(macroName, IBuildMacroProvider.CONTEXT_PROJECT, project, true); } @@ -68,15 +69,16 @@ public class XLCProjectMacroSupplier implements IProjectBuildMacroSupplier { /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.macros.IProjectBuildMacroSupplier#getMacros(org.eclipse.cdt.managedbuilder.core.IManagedProject, org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider) */ + @Override public IBuildMacro[] getMacros(IManagedProject project, IBuildMacroProvider provider) { - + String macroName = PreferenceConstants.P_XL_COMPILER_ROOT; - + String compilerPath = null; - + // figure out compiler path from properties and preferences - + // search for property first IProject theProject = (IProject) project.getOwner(); try { @@ -86,31 +88,31 @@ public class XLCProjectMacroSupplier implements IProjectBuildMacroSupplier { // TODO Auto-generated catch block e.printStackTrace(); } - + if(compilerPath == null) { // use the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); compilerPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); } - - BuildMacro macro = new BuildMacro(macroName, ICdtVariable.VALUE_PATH_DIR, + + BuildMacro macro = new BuildMacro(macroName, ICdtVariable.VALUE_PATH_DIR, compilerPath); - + // our array consists of our macro, plus all the macros from our parent IBuildMacro[] parentMacros = provider.getMacros(IBuildMacroProvider.CONTEXT_PROJECT, project, true); - + int numMacros = parentMacros.length + 1; // +1 for our macro - + IBuildMacro[] macros = new IBuildMacro[numMacros]; - + macros[0] = macro; - + for(int k = 1; k < macros.length; k++) { macros[k] = parentMacros[k-1]; } - + return macros; - + } } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCUIPlugin.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCUIPlugin.java index b203d510be9..32980049dd1 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCUIPlugin.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCUIPlugin.java @@ -11,10 +11,11 @@ package org.eclipse.cdt.managedbuilder.xlc.ui; -import org.eclipse.core.runtime.Plugin; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import java.util.*; /** * The main plugin class to be used in the desktop. @@ -24,7 +25,7 @@ public class XLCUIPlugin extends AbstractUIPlugin { private static XLCUIPlugin plugin; //Resource bundle. private ResourceBundle resourceBundle; - + /** * The constructor. */ @@ -36,6 +37,7 @@ public class XLCUIPlugin extends AbstractUIPlugin { /** * This method is called upon plug-in activation */ + @Override public void start(BundleContext context) throws Exception { super.start(context); } @@ -43,6 +45,7 @@ public class XLCUIPlugin extends AbstractUIPlugin { /** * This method is called when the plug-in is stopped */ + @Override public void stop(BundleContext context) throws Exception { super.stop(context); plugin = null; diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java index a3e977c85d7..4dcc8f6607e 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java @@ -21,32 +21,32 @@ public class PreferenceConstants { public static final String P_XL_COMPILER_ROOT = "XL_compilerRoot"; //$NON-NLS-1$ public static final String P_XLC_COMPILER_VERSION = "XLC_compilerVersion"; //$NON-NLS-1$ - + public static final String P_XL_COMPILER_VERSION_8 = "v8.0"; //$NON-NLS-1$ public static final String P_XL_COMPILER_VERSION_9 = "v9.0"; //$NON-NLS-1$ public static final String P_XL_COMPILER_VERSION_10 = "v10.1"; //$NON-NLS-1$ public static final String P_XL_COMPILER_VERSION_11 = "v11.1"; //$NON-NLS-1$ - + public static final String P_XL_COMPILER_VERSION_8_NAME = Messages.XLCompiler_v8; public static final String P_XL_COMPILER_VERSION_9_NAME = Messages.XLCompiler_v9; public static final String P_XL_COMPILER_VERSION_10_NAME = Messages.XLCompiler_v10; public static final String P_XL_COMPILER_VERSION_11_NAME = Messages.XLCompiler_v11; - + public static String getVersion (String label) { if (label.equalsIgnoreCase(P_XL_COMPILER_VERSION_11_NAME)) return P_XL_COMPILER_VERSION_11; - else if (label.equalsIgnoreCase(P_XL_COMPILER_VERSION_10_NAME)) + else if (label.equalsIgnoreCase(P_XL_COMPILER_VERSION_10_NAME)) return P_XL_COMPILER_VERSION_10; else if (label.equalsIgnoreCase(P_XL_COMPILER_VERSION_9_NAME)) return P_XL_COMPILER_VERSION_9; else return P_XL_COMPILER_VERSION_8; } - + public static String getVersionLabel (String version) { if (version.equalsIgnoreCase(P_XL_COMPILER_VERSION_11)) return P_XL_COMPILER_VERSION_11_NAME; - else if (version.equalsIgnoreCase(P_XL_COMPILER_VERSION_10)) + else if (version.equalsIgnoreCase(P_XL_COMPILER_VERSION_10)) return P_XL_COMPILER_VERSION_10_NAME; else if (version.equalsIgnoreCase(P_XL_COMPILER_VERSION_9)) return P_XL_COMPILER_VERSION_9_NAME; diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java index ec82d79444e..fbb44af7ee8 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java @@ -11,11 +11,10 @@ package org.eclipse.cdt.managedbuilder.xlc.ui.preferences; +import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; - /** * Class used to initialize default preference values. */ @@ -23,9 +22,10 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { /* * (non-Javadoc) - * + * * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() */ + @Override public void initializeDefaultPreferences() { IPreferenceStore store = XLCUIPlugin.getDefault().getPreferenceStore(); store.setDefault(PreferenceConstants.P_XL_COMPILER_ROOT, "/usr/vacpp/bin"); //$NON-NLS-1$ diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java index 80d53ec3737..be341803369 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java @@ -11,19 +11,21 @@ package org.eclipse.cdt.managedbuilder.xlc.ui.preferences; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.preference.*; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.IWorkbench; import org.eclipse.cdt.managedbuilder.xlc.ui.Messages; import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; +import org.eclipse.jface.dialogs.IMessageProvider; +import org.eclipse.jface.preference.ComboFieldEditor; +import org.eclipse.jface.preference.DirectoryFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; /** * This class represents a preference page that - * is contributed to the Preferences dialog. By + * is contributed to the Preferences dialog. By * subclassing <samp>FieldEditorPreferencePage</samp>, we * can use the field support built into JFace that allows - * us to create a page that is small and knows how to + * us to create a page that is small and knows how to * save, restore and apply itself. * <p> * This page is used to modify preferences only. They @@ -43,18 +45,20 @@ public class XLCompilerPreferencePage setPreferenceStore(XLCUIPlugin.getDefault().getPreferenceStore()); setDescription(Messages.XLCompilerPreferencePage_0); } - + /** * Creates the field editors. Field editors are abstractions of * the common GUI blocks needed to manipulate various types * of preferences. Each field editor knows how to save and * restore itself. */ + @Override public void createFieldEditors() { - DirectoryFieldEditor pathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT, Messages.XLCompilerPreferencePage_1, getFieldEditorParent()) + DirectoryFieldEditor pathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT, Messages.XLCompilerPreferencePage_1, getFieldEditorParent()) { - protected boolean doCheckState() + @Override + protected boolean doCheckState() { // always return true, as we don't want to fail cases when compiler is installed remotely // just warn user @@ -66,35 +70,37 @@ public class XLCompilerPreferencePage { setMessage(originalMessage); } - + return true; } - protected boolean checkState() + @Override + protected boolean checkState() { return doCheckState(); } - + }; addField(pathEditor); - + String[][] versionEntries = {{PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_8}, {PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_9}, {PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_10}, {PreferenceConstants.P_XL_COMPILER_VERSION_11_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_11}}; - + addField(new ComboFieldEditor(PreferenceConstants.P_XLC_COMPILER_VERSION, Messages.XLCompilerPreferencePage_2, versionEntries, getFieldEditorParent())); - + } /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ - public void init(IWorkbench workbench) + @Override + public void init(IWorkbench workbench) { originalMessage = getMessage(); } - + }
\ No newline at end of file diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/HiddenOptionApplicabilityCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/HiddenOptionApplicabilityCalculator.java index 02da2ad7940..1998b865c3e 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/HiddenOptionApplicabilityCalculator.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/HiddenOptionApplicabilityCalculator.java @@ -24,30 +24,33 @@ public class HiddenOptionApplicabilityCalculator implements IOptionApplicability { /** - * This function decides if the option for which this class + * This function decides if the option for which this class * is option applicability calculator is enabled or not. */ + @Override public boolean isOptionEnabled(IBuildObject configuration, IHoldsOptions holder, IOption option) { return false; } /** - * This function decides if the option for which this class - * is option applicability calculator is used in command line + * This function decides if the option for which this class + * is option applicability calculator is used in command line * or not. */ + @Override public boolean isOptionUsedInCommandLine(IBuildObject configuration, IHoldsOptions holder, IOption option) { return true; } /** - * This function decides if the option for which this class + * This function decides if the option for which this class * is option applicability calculator is visible or not. */ + @Override public boolean isOptionVisible(IBuildObject configuration, IHoldsOptions holder, IOption option) { diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCApplicabilityCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCApplicabilityCalculator.java index a006f1ea5db..dc67c85acf6 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCApplicabilityCalculator.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCApplicabilityCalculator.java @@ -4,7 +4,7 @@ * 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: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -18,7 +18,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.ResourceBundle; import java.util.Set; import org.eclipse.cdt.managedbuilder.core.IBuildObject; @@ -37,30 +36,30 @@ import org.eclipse.jface.preference.IPreferenceStore; /** * @author rkerimov - * + * * This applicability calculator hides/shows options that are specific to the XL compiler versions * */ -public class XLCApplicabilityCalculator implements IOptionApplicability +public class XLCApplicabilityCalculator implements IOptionApplicability { private static final String BUNDLE_NAME = "org/eclipse/cdt/managedbuilder/xlc/ui/properties/applicability.properties"; private static final String PROP_NAME_VERSION_ORDER = "xlc.applicability.version.order"; private static final String PROP_VALUE_PLUS = "+"; - + private static boolean initialized; private static List versionOrder; private static Map applicabilityMap; - + public XLCApplicabilityCalculator() { if (!initialized) { Properties props = null; - + ClassLoader loader = this.getClass().getClassLoader(); - InputStream input = null; - + InputStream input = null; + if (loader != null) input = loader.getResourceAsStream(BUNDLE_NAME); @@ -73,24 +72,24 @@ public class XLCApplicabilityCalculator implements IOptionApplicability { props = new Properties(); props.load(input); - + Set entrySet = props.entrySet(); Iterator iterator = entrySet.iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); - + String key = (String) entry.getKey(); String value = (String) entry.getValue(); - + if (value == null) value = ""; - + if (key.equals(PROP_NAME_VERSION_ORDER)) { versionOrder = new ArrayList(); String[] versions = value.split(","); - + if (versions != null) { for (int i = 0; i < versions.length; i ++) @@ -103,14 +102,14 @@ public class XLCApplicabilityCalculator implements IOptionApplicability { if (applicabilityMap == null) applicabilityMap = new HashMap(); - + List applicList = (List) applicabilityMap.get(key); if (applicList == null) { applicList = new ArrayList(); applicabilityMap.put(key, applicList); } - + boolean hasGreaterOption = false; //find if ends with + and set as separate option if (value.endsWith(PROP_VALUE_PLUS)) @@ -118,16 +117,16 @@ public class XLCApplicabilityCalculator implements IOptionApplicability hasGreaterOption = true; value = value.substring(0, value.length() - PROP_VALUE_PLUS.length()); } - + String[] versions = value.split(","); - + if (versions != null) { for (int i = 0; i < versions.length; i ++) { applicList.add(versions[i].trim()); } - + } if (hasGreaterOption) @@ -140,49 +139,49 @@ public class XLCApplicabilityCalculator implements IOptionApplicability { e.printStackTrace(); } - finally + finally { if (input != null) { - try + try { input.close(); - } - catch (IOException e) + } + catch (IOException e) { // ignore } } } - + initialized = true; - + } } - - private boolean isApplicable(IBuildObject configuration, IHoldsOptions holder, IOption option) + + private boolean isApplicable(IBuildObject configuration, IHoldsOptions holder, IOption option) { // first we check the preference for this project, if it exists IProject project = null; - if(configuration instanceof IConfiguration) + if(configuration instanceof IConfiguration) { IConfiguration config = (IConfiguration) configuration; IManagedProject managedProject = config.getManagedProject(); - + project = (IProject) managedProject.getOwner(); } - else if(configuration instanceof IFolderInfo) + else if(configuration instanceof IFolderInfo) { IFolderInfo folderInfo = (IFolderInfo) configuration; - + IConfiguration config = folderInfo.getParent(); - + IManagedProject managedProject = config.getManagedProject(); - + project = (IProject) managedProject.getOwner(); - + } - + if (project == null) return false; @@ -193,8 +192,8 @@ public class XLCApplicabilityCalculator implements IOptionApplicability } catch (CoreException e) { e.printStackTrace(); } - - if(currentVersion == null) + + if(currentVersion == null) { // if the property isn't set, then use the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); @@ -204,20 +203,20 @@ public class XLCApplicabilityCalculator implements IOptionApplicability //if applicability list is empty that means all options applicable to all versions if (applicabilityMap == null) return true; - - //if applicability list for this option is not defined then option has no applicability restrictions + + //if applicability list for this option is not defined then option has no applicability restrictions List applicList = (List) applicabilityMap.get(option.getId()); if (applicList == null || applicList.isEmpty()) return true; - + //if version is defined in the list - perfect match if (applicList.contains(currentVersion)) return true; - + //if applicability is defined as 'starting from this version and greater', i.e. 'v8.0+', - //then we need to find out if current version is greater than the last valid in the list + //then we need to find out if current version is greater than the last valid in the list String lastOption = (String) applicList.get(applicList.size() - 1); - + if (lastOption != null && lastOption.equals(PROP_VALUE_PLUS)) { //if 'greater than' option is specified but no version order exists, consider config error and return false @@ -230,31 +229,32 @@ public class XLCApplicabilityCalculator implements IOptionApplicability for (int k = applicList.size() - 2; k >= 0; k --) { String version = (String) applicList.get(k); - + if (versionOrder.contains(version)) { validVersion = version; break; } } - + //if version that applicability starts with doesn't exist - config error if (validVersion == null) return false; - + //compare if current compiler version is greater than the applicability version if (versionOrder.indexOf(currentVersion) > versionOrder.indexOf(validVersion)) return true; } - - + + return false; - + } - + /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionEnabled(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionEnabled(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isApplicable(configuration, holder, option); @@ -263,6 +263,7 @@ public class XLCApplicabilityCalculator implements IOptionApplicability /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionUsedInCommandLine(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionUsedInCommandLine(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isApplicable(configuration, holder, option); @@ -271,6 +272,7 @@ public class XLCApplicabilityCalculator implements IOptionApplicability /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionVisible(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionVisible(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isApplicable(configuration, holder, option); diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java index 66d5b2365b4..dcd6d60190a 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java @@ -4,7 +4,7 @@ * 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: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -37,6 +37,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements /* (non-Javadoc) * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() */ + @Override protected void createFieldEditors() { createPathEditor(); createVersionEditor(); @@ -45,7 +46,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements /* * (non-Javadoc) - * + * * @see * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors * () @@ -56,6 +57,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements fPathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT, Messages.XLCompilerPropertyPage_0, parent) { + @Override protected boolean doCheckState() { // always return true, as we don't want to fail cases when // compiler is installed remotely @@ -69,6 +71,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements return true; } + @Override protected boolean checkState() { return doCheckState(); } @@ -147,6 +150,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements originalMessage = getMessage(); } + @Override protected void performDefaults() { // default to whatever is set on the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); @@ -168,9 +172,10 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements /* * (non-Javadoc) - * + * * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk() */ + @Override public boolean performOk() { // store the value in the owner text field try { @@ -200,19 +205,21 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements /* * (non-Javadoc) - * + * * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement() */ + @Override public IAdaptable getElement() { return element; } /** * Sets the element that owns properties shown on this page. - * + * * @param element * the element */ + @Override public void setElement(IAdaptable element) { this.element = element; } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java index 4d8ddd4242c..22357ff7c29 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java @@ -35,9 +35,9 @@ public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { if(configuration instanceof IConfiguration) { IConfiguration config = (IConfiguration) configuration; IManagedProject managedProject = config.getManagedProject(); - + IProject project = (IProject) managedProject.getOwner(); - + String currentVersion = null; try { currentVersion = project.getPersistentProperty(new QualifiedName("", @@ -46,26 +46,26 @@ public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { // TODO Auto-generated catch block e.printStackTrace(); } - + if(currentVersion == null) { // if the property isn't set, then use the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8)) return true; } - + if(configuration instanceof IFolderInfo) { IFolderInfo folderInfo = (IFolderInfo) configuration; - + IConfiguration config = folderInfo.getParent(); - + IManagedProject managedProject = config.getManagedProject(); - + IProject project = (IProject) managedProject.getOwner(); - + String currentVersion = null; try { currentVersion = project.getPersistentProperty(new QualifiedName("", @@ -74,25 +74,26 @@ public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { // TODO Auto-generated catch block e.printStackTrace(); } - + if(currentVersion == null) { // if the property isn't set, then use the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8)) return true; - + } - + return false; - + } - + /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionEnabled(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionEnabled(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isVersion8(configuration); @@ -101,6 +102,7 @@ public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionUsedInCommandLine(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionUsedInCommandLine(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isVersion8(configuration); @@ -109,6 +111,7 @@ public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionVisible(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionVisible(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isVersion8(configuration); diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java index 47d7201208b..3c12ce121dc 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java @@ -26,7 +26,7 @@ import org.eclipse.jface.preference.IPreferenceStore; /** * @author crecoskie - * + * * This applicability calculator hides/shows options that are specific to the XL compilers, v9.0 * */ @@ -37,9 +37,9 @@ public class XLCv9ApplicabilityCalculator implements IOptionApplicability { if(configuration instanceof IConfiguration) { IConfiguration config = (IConfiguration) configuration; IManagedProject managedProject = config.getManagedProject(); - + IProject project = (IProject) managedProject.getOwner(); - + String currentVersion = null; try { currentVersion = project.getPersistentProperty(new QualifiedName("", @@ -48,26 +48,26 @@ public class XLCv9ApplicabilityCalculator implements IOptionApplicability { // TODO Auto-generated catch block e.printStackTrace(); } - + if(currentVersion == null) { // if the property isn't set, then use the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9)) return true; } - + if(configuration instanceof IFolderInfo) { IFolderInfo folderInfo = (IFolderInfo) configuration; - + IConfiguration config = folderInfo.getParent(); - + IManagedProject managedProject = config.getManagedProject(); - + IProject project = (IProject) managedProject.getOwner(); - + String currentVersion = null; try { currentVersion = project.getPersistentProperty(new QualifiedName("", @@ -76,25 +76,26 @@ public class XLCv9ApplicabilityCalculator implements IOptionApplicability { // TODO Auto-generated catch block e.printStackTrace(); } - + if(currentVersion == null) { // if the property isn't set, then use the workbench preference IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9)) return true; - + } - + return false; - + } - + /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionEnabled(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionEnabled(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isVersion9(configuration); @@ -103,6 +104,7 @@ public class XLCv9ApplicabilityCalculator implements IOptionApplicability { /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionUsedInCommandLine(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionUsedInCommandLine(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isVersion9(configuration); @@ -111,6 +113,7 @@ public class XLCv9ApplicabilityCalculator implements IOptionApplicability { /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionVisible(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) */ + @Override public boolean isOptionVisible(IBuildObject configuration, IHoldsOptions holder, IOption option) { return isVersion9(configuration); diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java index 2943c09fe97..9b1fd9e8d8f 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java @@ -26,6 +26,7 @@ public class DynamicVariableResolver implements IDynamicVariableResolver { /* (non-Javadoc) * @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String) */ + @Override public String resolveValue(IDynamicVariable variable, String argument) throws CoreException { diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java index 9692b450bec..e1a41720c55 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java @@ -4,7 +4,7 @@ * 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: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -40,7 +40,7 @@ import org.eclipse.swt.widgets.Text; public class XLCSettingsWizardPage extends MBSCustomPage { public static final String PAGE_ID = "org.eclipse.cdt.managedbuilder.xlc.ui.XlcSettingsWizardPage"; //$NON-NLS-1$ - + private final class BrowseButtonSelectionListener implements SelectionListener { private final Composite composite; @@ -49,26 +49,28 @@ public class XLCSettingsWizardPage extends MBSCustomPage { this.composite = composite; } + @Override public void widgetDefaultSelected(SelectionEvent e) { // meaningless for a button... do nothing - + } + @Override public void widgetSelected(SelectionEvent e) { // open a browse dialog DirectoryDialog dirDialog = new DirectoryDialog(composite.getShell(), SWT.APPLICATION_MODAL); String browsedDirectory = dirDialog.open(); fDirTextBox.setText(browsedDirectory); - + } } - + private Composite fComposite = null; private Text fDirTextBox; private Combo fVersionCombo; - + /** * @param pageID */ @@ -78,13 +80,13 @@ public class XLCSettingsWizardPage extends MBSCustomPage { } /** - * + * */ public XLCSettingsWizardPage() { super(PAGE_ID); setDefaultPreferences(PAGE_ID); } - + private void setDefaultPreferences(String pageID) { String compilerPath = XLCUIPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.P_XL_COMPILER_ROOT); MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XL_COMPILER_ROOT, compilerPath); @@ -94,6 +96,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPage#isCustomPageComplete() */ + @Override protected boolean isCustomPageComplete() { return true; } @@ -101,6 +104,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.wizard.IWizardPage#getName() */ + @Override public String getName() { String name = Messages.XLCSettingsWizardPage_0; return name; @@ -109,6 +113,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { // create a new composite fComposite = new Composite(parent, SWT.NONE); @@ -116,12 +121,12 @@ public class XLCSettingsWizardPage extends MBSCustomPage { GridLayout layout = new GridLayout(3, false); fComposite.setLayout(layout); fComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - + // create the first label Label label1 = new Label(fComposite, SWT.NONE); label1.setText(Messages.XLCSettingsWizardPage_1); label1.setVisible(true); - + // create the text box for the path GridData dirBoxGridData = new GridData(); dirBoxGridData.grabExcessHorizontalSpace = true; @@ -129,25 +134,26 @@ public class XLCSettingsWizardPage extends MBSCustomPage { fDirTextBox = new Text(fComposite, SWT.SINGLE | SWT.BORDER); fDirTextBox.setLayoutData(dirBoxGridData); fDirTextBox.setVisible(true); - + // set the default compiler location based on preferences IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); String compilerPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); fDirTextBox.setText(compilerPath); - + // update the page manager with the setting MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText()); - + fDirTextBox.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // update the page manager with the setting MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText()); - + } - + }); - + // create the browse button //String selectedPath = null; GridData buttonData = new GridData(); @@ -157,53 +163,55 @@ public class XLCSettingsWizardPage extends MBSCustomPage { browseButton.setText(Messages.XLCSettingsWizardPage_2); browseButton.addSelectionListener(new BrowseButtonSelectionListener(fComposite) ); - + browseButton.setVisible(true); - + // create the second label Label label2 = new Label(fComposite, SWT.NONE); label2.setText(Messages.XLCSettingsWizardPage_3); - + label2.setVisible(true); - + // create the version dropdown GridData comboData = new GridData(); comboData.grabExcessHorizontalSpace = true; comboData.horizontalAlignment = SWT.FILL; - + fVersionCombo = new Combo(fComposite, SWT.READ_ONLY); fVersionCombo.setLayoutData(comboData); - + // populate the combo fVersionCombo.add(PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME); fVersionCombo.add(PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME); fVersionCombo.add(PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME); fVersionCombo.add(PreferenceConstants.P_XL_COMPILER_VERSION_11_NAME); - + // set the default based on the workbench preference String compilerVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); fVersionCombo.setText(PreferenceConstants.getVersionLabel(compilerVersion)); - + // update the page manager with the setting MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.getVersion(fVersionCombo.getText())); - + fVersionCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // update the page manager with the setting MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.getVersion(fVersionCombo.getText())); - + } - + }); - + fVersionCombo.setVisible(true); - + } /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#dispose() */ + @Override public void dispose() { fComposite.dispose(); } @@ -211,6 +219,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#getControl() */ + @Override public Control getControl() { return fComposite; } @@ -218,6 +227,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#getDescription() */ + @Override public String getDescription() { return Messages.XLCSettingsWizardPage_4; } @@ -225,6 +235,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage() */ + @Override public String getErrorMessage() { // TODO Auto-generated method stub return null; @@ -233,6 +244,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#getImage() */ + @Override public Image getImage() { return wizard.getDefaultPageImage(); } @@ -240,6 +252,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#getMessage() */ + @Override public String getMessage() { return null; } @@ -247,6 +260,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#getTitle() */ + @Override public String getTitle() { return Messages.XLCSettingsWizardPage_5; } @@ -254,6 +268,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#performHelp() */ + @Override public void performHelp() { // TODO Auto-generated method stub @@ -262,6 +277,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#setDescription(java.lang.String) */ + @Override public void setDescription(String description) { // TODO Auto-generated method stub @@ -270,6 +286,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) */ + @Override public void setImageDescriptor(ImageDescriptor image) { // TODO Auto-generated method stub @@ -278,6 +295,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#setTitle(java.lang.String) */ + @Override public void setTitle(String title) { // TODO Auto-generated method stub @@ -286,6 +304,7 @@ public class XLCSettingsWizardPage extends MBSCustomPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean) */ + @Override public void setVisible(boolean visible) { fComposite.setVisible(visible); } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardRunnable.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardRunnable.java index 5a71a9d6a09..4c47bd297d8 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardRunnable.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardRunnable.java @@ -21,7 +21,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.QualifiedName; import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.IWizardPage; /** @@ -35,6 +34,7 @@ public class XLCSettingsWizardRunnable implements IRunnableWithProgress { public XLCSettingsWizardRunnable() { } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { // take the data from the page manager, and set the project properties with it String compilerPath = MBSCustomPageManager.getPageProperty(pageId, PreferenceConstants.P_XL_COMPILER_ROOT).toString(); @@ -42,19 +42,19 @@ public class XLCSettingsWizardRunnable implements IRunnableWithProgress { // get a handle to the wizard IWizardPage[] pages = MBSCustomPageManager.getPages(); - + if(pages != null && pages.length > 0) { - + ICDTCommonProjectWizard wizard = (ICDTCommonProjectWizard) pages[0].getWizard(); IProject project = wizard.getLastProject(); - + try { project.setPersistentProperty(new QualifiedName("", PreferenceConstants.P_XL_COMPILER_ROOT), compilerPath); project.setPersistentProperty(new QualifiedName("", PreferenceConstants.P_XLC_COMPILER_VERSION), compilerVersion); - + } catch (CoreException e) { CCorePlugin.log(e); - } + } } } |