Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2001-09-13 12:36:05 +0000
committerDarin Swanson2001-09-13 12:36:05 +0000
commit663398e6c0249743f098cec7fb9e28a268a2bd86 (patch)
tree0c8bd764d84f69bdae717916c834532f4425d46f
parentbbbe955aa31e37d56bf93a2fbeb284f8d52ed8db (diff)
downloadeclipse.platform.debug-663398e6c0249743f098cec7fb9e28a268a2bd86.tar.gz
eclipse.platform.debug-663398e6c0249743f098cec7fb9e28a268a2bd86.tar.xz
eclipse.platform.debug-663398e6c0249743f098cec7fb9e28a268a2bd86.zip
1GJV1G9: ITPDUI:ALL - Can inadvertantly change value of null String to "null"
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ChangeVariableValueAction.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ChangeVariableValueAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ChangeVariableValueAction.java
index 868d459ea..bcd655f88 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ChangeVariableValueAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ChangeVariableValueAction.java
@@ -19,7 +19,8 @@ public class ChangeVariableValueAction extends SelectionProviderAction {
protected Text fEditorText;
protected TreeEditor fTreeEditor;
protected IVariable fVariable;
-
+ protected boolean fKeyReleased= false;
+
private static final String PREFIX= "change_variable_value_action.";
private static final String ERROR= PREFIX + "error.";
private static final String DIALOG_TITLE= PREFIX + "dialog.title";
@@ -89,22 +90,31 @@ public class ChangeVariableValueAction extends SelectionProviderAction {
fComposite.setVisible(true);
fEditorText.setFocus();
- // CR means commit the change, ESC means abort changing the value
+ // CR means commit the changes, ESC means abort changing the value
fEditorText.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent event) {
if (event.character == SWT.CR) {
- saveChangesAndCleanup(fVariable, activeShell);
+ if (fKeyReleased) {
+ saveChangesAndCleanup(fVariable, activeShell);
+ } else {
+ cleanup();
+ }
}
if (event.character == SWT.ESC) {
cleanup();
}
+ fKeyReleased= true;
}
});
- // If the focus is lost, then act as if user hit CR and commit change
+ // If the focus is lost, then act as if user hit CR and commit changes
fEditorText.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent fe) {
- saveChangesAndCleanup(fVariable, activeShell);
+ if (fKeyReleased) {
+ saveChangesAndCleanup(fVariable, activeShell);
+ } else {
+ cleanup();
+ }
}
});
}
@@ -131,6 +141,7 @@ public class ChangeVariableValueAction extends SelectionProviderAction {
* Tidy up the widgets that were used
*/
private void cleanup() {
+ fKeyReleased= false;
if (fEditorText != null) {
fEditorText.dispose();
fEditorText = null;

Back to the top