[288120] Double clicking to insert a snippet can modify a read-only file
diff --git a/org.eclipse.wst.common.snippets/META-INF/MANIFEST.MF b/org.eclipse.wst.common.snippets/META-INF/MANIFEST.MF
index e3ae98d..dd00830 100644
--- a/org.eclipse.wst.common.snippets/META-INF/MANIFEST.MF
+++ b/org.eclipse.wst.common.snippets/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Snippets_View.name
 Bundle-SymbolicName: org.eclipse.wst.common.snippets; singleton:=true
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.1.201.qualifier
 Bundle-Activator: org.eclipse.wst.common.snippets.internal.SnippetsPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java
index 629e6d0..c01de1d 100644
--- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java
+++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -28,6 +28,7 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension2;
 import org.eclipse.wst.common.snippets.core.ISnippetItem;
 import org.eclipse.wst.common.snippets.internal.Logger;
 import org.eclipse.wst.common.snippets.internal.SnippetsPlugin;
@@ -234,7 +235,7 @@
 
 	private void insertIntoTextEditor(ITextEditor editor) {
 		// find the text widget, its Document, and the current selection
-		if (editor.isEditable()) {
+		if (isEditable(editor)) {
 			IDocumentProvider docprovider = editor.getDocumentProvider();
 			ISelectionProvider selprovider = editor.getSelectionProvider();
 			if (docprovider != null && selprovider != null) {
@@ -254,6 +255,13 @@
 		}
 	}
 
+	private boolean isEditable(ITextEditor editor) {
+		if (editor instanceof ITextEditorExtension2)
+			return ((ITextEditorExtension2) editor).validateEditorInputState();
+
+		return editor.isEditable();
+	}
+
 
 	/*
 	 * (non-Javadoc)