1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

RESOLVED - bug 237176: XL C/C++ Compiler Preferences page is annoying

https://bugs.eclipse.org/bugs/show_bug.cgi?id=237176
This commit is contained in:
Chris Recoskie 2008-11-06 14:50:44 +00:00
parent bb8d3bd8a4
commit 31a7ae9a20
3 changed files with 36 additions and 2 deletions

View file

@ -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;

View file

@ -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...

View file

@ -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();
}