diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvDialog.java index 9a46b0993d7..f04c303bf50 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2008 Intel Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -124,7 +124,8 @@ public class EnvDialog extends Dialog { text1.setText(var.getName()); text1.setEnabled(false); // don't change name - text2.setText(var.getValue()); + String s = var.getValue(); + text2.setText(s == null ? AbstractCPropertyTab.EMPTY_STR : s); } gd.horizontalSpan = 3; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java index 256fb7eba02..3fee728cf25 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java @@ -354,6 +354,8 @@ public class EnvironmentTab extends AbstractCPropertyTab { vars.createVariable(dlg.t1.trim(), dlg.t2.trim(), IEnvironmentVariable.ENVVAR_REPLACE, var.getDelimiter()); updateData(); + table.setSelection(n); + updateButtons(); } } @@ -376,6 +378,8 @@ public class EnvironmentTab extends AbstractCPropertyTab { var.getDelimiter(), cfgd); } updateData(); + table.setSelection(n); + updateButtons(); } private void handleEnvDelButtonSelected(int n) {