Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2009-10-22 14:47:43 +0000
committerDarin Wright2009-10-22 14:47:43 +0000
commit03d8f35c6b1dbc7d5eb60a2e4efb90dce023ae71 (patch)
treef480ba7bad4751837b521467d1a04d7e43da8ba7
parent7a3ff2b25a990f089c997e890c3681d370b6a45d (diff)
downloadeclipse.platform.debug-03d8f35c6b1dbc7d5eb60a2e4efb90dce023ae71.tar.gz
eclipse.platform.debug-03d8f35c6b1dbc7d5eb60a2e4efb90dce023ae71.tar.xz
eclipse.platform.debug-03d8f35c6b1dbc7d5eb60a2e4efb90dce023ae71.zip
[r34x] 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.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties3
4 files changed, 20 insertions, 21 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 ad98d93da..72fb25d5a 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM 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
@@ -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;
@@ -490,10 +492,6 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
if (fInitializingTabs) {
return;
}
- if(fOriginal != null && fOriginal.isReadOnly()) {
- updateButtons();
- return;
- }
ILaunchConfigurationTab[] tabs = getTabs();
if (tabs != null) {
// update the working copy from the active tab
@@ -1050,9 +1048,6 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
return false;
}
}
- if(getWorkingCopy() != null) {
- return !getWorkingCopy().isReadOnly();
- }
return true;
}
@@ -1190,9 +1185,6 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
return temp.toString();
}
}
- if(getWorkingCopy().isReadOnly()) {
- return LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9;
- }
if(!canLaunchWithModes()) {
Set modes = getCurrentModeSet();
List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
@@ -1345,7 +1337,13 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
/**
* 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
@@ -1382,7 +1380,9 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
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 b5779b1a4..7e597b70f 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM 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
@@ -974,11 +974,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 645bc96d6..0b3e36ffb 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM 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
@@ -102,7 +102,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 dd8d68558..6cb00560f 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
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2008 IBM Corporation and others.
+# Copyright (c) 2000, 2009 IBM 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
@@ -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