Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2009-10-22 13:43:00 +0000
committerDarin Wright2009-10-22 13:43:00 +0000
commit6418c272d352c8b4672f00b2ec433bd8b87b5e0b (patch)
tree094b0b8fb3e151e220cab072c9d70081f60f25af
parent55e5efa7d70615dcbe71e938f3edb6605a06238d (diff)
downloadeclipse.platform.debug-6418c272d352c8b4672f00b2ec433bd8b87b5e0b.tar.gz
eclipse.platform.debug-6418c272d352c8b4672f00b2ec433bd8b87b5e0b.tar.xz
eclipse.platform.debug-6418c272d352c8b4672f00b2ec433bd8b87b5e0b.zip
Bug 291339 - validateEdit not called for launch configuration stored locally
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties1
4 files changed, 16 insertions, 17 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index e61568368..4ad68114b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -16,6 +16,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -485,10 +487,6 @@ public class LaunchConfigurationTabGroupViewer {
if (fInitializingTabs) {
return;
}
- if(fOriginal != null && fOriginal.isReadOnly()) {
- updateButtons();
- return;
- }
ILaunchConfigurationTab[] tabs = getTabs();
if (tabs != null) {
// update the working copy from the active tab
@@ -1032,9 +1030,6 @@ public class LaunchConfigurationTabGroupViewer {
return false;
}
}
- if(getWorkingCopy() != null) {
- return !getWorkingCopy().isReadOnly();
- }
return true;
}
@@ -1176,9 +1171,6 @@ public class LaunchConfigurationTabGroupViewer {
return temp.toString();
}
}
- if(getWorkingCopy().isReadOnly()) {
- return LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9;
- }
if(!canLaunchWithModes()) {
Set modes = getCurrentModeSet();
List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
@@ -1311,7 +1303,13 @@ public class LaunchConfigurationTabGroupViewer {
/**
* Notification that the 'Apply' button has been pressed
*/
- protected void handleApplyPressed() {
+ protected boolean handleApplyPressed() {
+ if(fOriginal != null && fOriginal.isReadOnly()) {
+ IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {fOriginal.getFile()}, fViewerControl.getShell());
+ if(!status.isOK()) {
+ return false;
+ }
+ }
Exception exception = null;
try {
// update launch config
@@ -1348,7 +1346,9 @@ public class LaunchConfigurationTabGroupViewer {
catch (InterruptedException e) {exception = e;}
if(exception != null) {
DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Launch_Configuration_Error_46, LaunchConfigurationsMessages.LaunchConfigurationDialog_Exception_occurred_while_saving_launch_configuration_47, exception); //
- return;
+ return false;
+ } else {
+ return true;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index 7b513af40..336ecdd6c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -931,11 +931,12 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
protected void handleLaunchPressed() {
ILaunchConfiguration config = fTabViewer.getOriginal();
if (fTabViewer.isDirty() && fTabViewer.canSave()) {
- fTabViewer.handleApplyPressed();
- config = fTabViewer.getOriginal();
+ if (fTabViewer.handleApplyPressed())
+ config = fTabViewer.getOriginal();
+ else config = null;
}
- close();
if(config != null) {
+ close();
DebugUITools.launch(config, getMode());
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
index 6c88a6bcc..71bac4e32 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
@@ -96,7 +96,6 @@ public class LaunchConfigurationsMessages extends NLS {
public static String LaunchConfigurationTabGroupViewer_17;
public static String LaunchConfigurationTabGroupViewer_18;
- public static String LaunchConfigurationTabGroupViewer_9;
public static String LaunchConfigurationTabGroupViewer_13;
public static String LaunchConfigurationTabGroupViewer_19;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
index be41c0a7c..e472e436d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
@@ -55,7 +55,6 @@ LaunchConfigurationTabGroupViewer_4=- Press the 'Delete' button to remove the se
LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the selected configuration.
LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
LaunchConfigurationTabGroupViewer_8=- Press the 'Filter' button to configure filtering options.
-LaunchConfigurationTabGroupViewer_9=The file associated with this launch configuration is read-only and cannot be modified.\n
LaunchConfigurationTabGroupViewer_13=Select a supported <a>launch mode</a>.
LaunchConfigurationTabGroupViewer_14=Mixed launch mode not supported: {0}
LaunchConfigurationTabGroupViewer_15=More than one launcher available - <a>Select other...</a>

Back to the top