From 1a8fe002955f50773b3d7ca6b0e8793ed2df01e2 Mon Sep 17 00:00:00 2001 From: Ted Williams Date: Tue, 19 Aug 2008 20:09:35 +0000 Subject: [PATCH] [244608] [memory] import dialog needs better validation --- .../debug/ui/memory/transport/PlainTextImporter.java | 9 +++++++++ .../dd/debug/ui/memory/transport/SRecordImporter.java | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/PlainTextImporter.java b/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/PlainTextImporter.java index 23692b72e83..8e5f953b1b8 100644 --- a/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/PlainTextImporter.java +++ b/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/PlainTextImporter.java @@ -219,6 +219,13 @@ public class PlainTextImporter implements IMemoryImporter { composite.pack(); parent.pack(); + + Display.getDefault().asyncExec(new Runnable(){ + public void run() + { + validate(); + } + }); return composite; } @@ -230,6 +237,8 @@ public class PlainTextImporter implements IMemoryImporter { try { getStartAddress(); + if(!getFile().exists()) + isValid = false; } catch(Exception e) { diff --git a/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/SRecordImporter.java b/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/SRecordImporter.java index 965cbe2e1e0..9fcef67f40c 100644 --- a/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/SRecordImporter.java +++ b/plugins/org.eclipse.dd.debug.ui.memory.transport/src/org/eclipse/dd/debug/ui/memory/transport/SRecordImporter.java @@ -92,6 +92,7 @@ public class SRecordImporter implements IMemoryImporter { // restore to file address fComboRestoreToFileAddress = new Button(composite, SWT.RADIO); + fComboRestoreToFileAddress.setSelection(true); fComboRestoreToFileAddress.setText("Restore to address specified in the file"); //comboRestoreToFileAddress.setLayoutData(data); @@ -217,6 +218,13 @@ public class SRecordImporter implements IMemoryImporter { composite.pack(); parent.pack(); + Display.getDefault().asyncExec(new Runnable(){ + public void run() + { + validate(); + } + }); + return composite; } @@ -227,6 +235,8 @@ public class SRecordImporter implements IMemoryImporter { try { getStartAddress(); + if(!getFile().exists()) + isValid = false; } catch(Exception e) {