Skip to main content
summaryrefslogtreecommitdiffstats
path: root/xlc
diff options
context:
space:
mode:
authorChris Recoskie2008-11-06 09:50:44 -0500
committerChris Recoskie2008-11-06 09:50:44 -0500
commit31a7ae9a20ba6c85b7f40fcbeb5f24ae23515d44 (patch)
treeb9270671d98fd0242357913e157dd77e4ede99a0 /xlc
parentbb8d3bd8a4f286989da49c044fc7fa0f7ce396f4 (diff)
downloadorg.eclipse.cdt-31a7ae9a20ba6c85b7f40fcbeb5f24ae23515d44.tar.gz
org.eclipse.cdt-31a7ae9a20ba6c85b7f40fcbeb5f24ae23515d44.tar.xz
org.eclipse.cdt-31a7ae9a20ba6c85b7f40fcbeb5f24ae23515d44.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/properties/XLCompilerPropertyPage.java36
3 files changed, 36 insertions, 2 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 6f25494565..35fd16fff9 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
@@ -22,6 +22,7 @@ public class Messages extends NLS {
public static String XLCompilerPreferencePage_2;
public static String XLCompilerPropertyPage_0;
public static String XLCompilerPropertyPage_1;
+ public static String XLCompilerPropertyPage_2;
public static String XLCSettingsWizardPage_0;
public static String XLCSettingsWizardPage_1;
public static String XLCSettingsWizardPage_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 4811c0920b..cec1f7aafd 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
@@ -16,6 +16,7 @@ XLCompilerPreferencePage_1=Compiler Root Path:
XLCompilerPreferencePage_2=Compiler Version:
XLCompilerPropertyPage_0=Compiler Root Path:
XLCompilerPropertyPage_1=Compiler Version:
+XLCompilerPropertyPage_2=Compiler path does not exist on the local machine.
XLCSettingsWizardPage_0=XL C/C++ Settings
XLCSettingsWizardPage_1=Compiler Root Path:
XLCSettingsWizardPage_2=Browse...
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 823d53ec81..a7ba60a341 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
@@ -19,15 +19,19 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPropertyPage;
public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
+ private String originalMessage;
+
/* (non-Javadoc)
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
@@ -35,8 +39,34 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
Composite parent = getFieldEditorParent();
- fPathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT,
- Messages.XLCompilerPropertyPage_0, parent);
+ fPathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT, Messages.XLCompilerPropertyPage_0, parent)
+ {
+ 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.XLCompilerPropertyPage_2, IMessageProvider.WARNING);
+ }
+ else
+ {
+ getPage().setMessage(originalMessage, 0);
+ }
+ }
+
+ return true;
+ }
+
+ protected boolean checkState()
+ {
+ return doCheckState();
+ }
+
+ };
+
addField(fPathEditor);
IProject project = ((IResource) getElement()).getProject();
@@ -101,6 +131,8 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
*/
public XLCompilerPropertyPage() {
super(FieldEditorPreferencePage.FLAT);
+
+ originalMessage = getMessage();
}

Back to the top