1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 21:05:37 +02:00

Build error reported for new browse functionality. Corrected the "problem" by calling a more explicit version of getShell()

This commit is contained in:
Sean Evoy 2004-04-06 13:42:03 +00:00
parent f7ff3c2496
commit 8ae9494db3
2 changed files with 10 additions and 6 deletions

View file

@ -28,7 +28,10 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
*
* An <code>OptionReference</code> plays two roles in the managed build model.
* It is used to store overridden option values in a toolchain specification at
* the level of a <code>Configuration</code> and it stores user option settings
* between sessions.
*/
public class OptionReference implements IOption {

View file

@ -54,7 +54,7 @@ public class BuildOptionListFieldEditor extends FieldEditor {
// Constants for externalized strings
private static final String BROWSE = "BuildPropertyCommon.label.browse"; //$NON-NLS-1$
private int type;
/**
* @param parentShell
* @param dialogTitle
@ -81,7 +81,7 @@ public class BuildOptionListFieldEditor extends FieldEditor {
String result;
switch (type) {
case IOption.BROWSE_DIR :
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.OPEN);
DirectoryDialog dialog = new DirectoryDialog(getParentShell(), SWT.OPEN);
currentName = getText().getText();
if(currentName != null && currentName.trim().length() != 0) {
dialog.setFilterPath(currentName);
@ -92,7 +92,7 @@ public class BuildOptionListFieldEditor extends FieldEditor {
}
break;
case IOption.BROWSE_FILE:
FileDialog browseDialog = new FileDialog(getShell());
FileDialog browseDialog = new FileDialog(getParentShell());
currentName = getText().getText();
if (currentName != null && currentName.trim().length() != 0) {
browseDialog.setFilterPath(currentName);
@ -478,10 +478,11 @@ public class BuildOptionListFieldEditor extends FieldEditor {
// Prompt for value
SelectPathInputDialog dialog = new SelectPathInputDialog(getShell(), title, message, initVal, null, browseType);
if (dialog.open() == SelectPathInputDialog.OK) {
input = dialog.getValue().trim();
input = dialog.getValue();
if (input == null || input.length() == 0) return ""; //$NON-NLS-1$
}
// Convert the value based on the type of input we expect
// Double-quote the spaces in paths (if any)
switch (browseType) {
case IOption.BROWSE_DIR:
case IOption.BROWSE_FILE: