Skip to main content
summaryrefslogtreecommitdiffstats
path: root/xlc
diff options
context:
space:
mode:
authorChris Recoskie2008-11-07 09:25:20 -0500
committerChris Recoskie2008-11-07 09:25:20 -0500
commit42cf48b2e89ab63a4bb77ab267c62652c1c19649 (patch)
tree4205a1b3e40d1c89756b0326fd13bd4749502a16 /xlc
parente7d2658df6f787bb0a3b8f699e2df5b2f21767cb (diff)
downloadorg.eclipse.cdt-42cf48b2e89ab63a4bb77ab267c62652c1c19649.tar.gz
org.eclipse.cdt-42cf48b2e89ab63a4bb77ab267c62652c1c19649.tar.xz
org.eclipse.cdt-42cf48b2e89ab63a4bb77ab267c62652c1c19649.zip
RESOLVED - bug 237176: XL C/C++ Compiler Preferences page is annoying
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237176
Diffstat (limited to 'xlc')
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java1
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties1
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java39
3 files changed, 38 insertions, 3 deletions
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java
index 35fd16fff9..2694d0a7de 100644
--- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java
+++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java
@@ -20,6 +20,7 @@ public class Messages extends NLS {
public static String XLCompilerPreferencePage_0;
public static String XLCompilerPreferencePage_1;
public static String XLCompilerPreferencePage_2;
+ public static String XLCompilerPreferencePage_3;
public static String XLCompilerPropertyPage_0;
public static String XLCompilerPropertyPage_1;
public static String XLCompilerPropertyPage_2;
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties
index cec1f7aafd..ffaa03b58c 100644
--- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties
+++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties
@@ -14,6 +14,7 @@ XLCompiler_v9=v9.0
XLCompilerPreferencePage_0=XL C/C++ Compiler Preferences
XLCompilerPreferencePage_1=Compiler Root Path:
XLCompilerPreferencePage_2=Compiler Version:
+XLCompilerPreferencePage_3=Compiler path does not exist on the local machine.
XLCompilerPropertyPage_0=Compiler Root Path:
XLCompilerPropertyPage_1=Compiler Version:
XLCompilerPropertyPage_2=Compiler path does not exist on the local machine.
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 0d6b8f288f..625fe1f109 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,6 +11,7 @@
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;
@@ -35,6 +36,8 @@ public class XLCompilerPreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
+ private String originalMessage;
+
public XLCompilerPreferencePage() {
super(FLAT);
setPreferenceStore(XLCUIPlugin.getDefault().getPreferenceStore());
@@ -48,8 +51,36 @@ public class XLCompilerPreferencePage
* restore itself.
*/
public void createFieldEditors() {
- addField(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()
+ {
+ // always return true, as we don't want to fail cases when compiler is installed remotely
+ // just warn user
+ if (getPage() != null)
+ {
+ if (!super.doCheckState())
+ {
+ getPage().setMessage(Messages.XLCompilerPreferencePage_3, IMessageProvider.WARNING);
+ }
+ else
+ {
+ getPage().setMessage(originalMessage, 0);
+ }
+ }
+
+ return true;
+ }
+
+ protected boolean checkState()
+ {
+ return doCheckState();
+ }
+
+ };
+
+ addField(pathEditor);
String[][] versionEntries = {{PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, Messages.XLCompiler_v8},
{PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, Messages.XLCompiler_v9}};
@@ -62,7 +93,9 @@ public class XLCompilerPreferencePage
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
- public void init(IWorkbench workbench) {
+ public void init(IWorkbench workbench)
+ {
+ originalMessage = getMessage();
}
} \ No newline at end of file

Back to the top