Extensibility for external storage serialization

Change-Id: Ie8445bcf53eb59ba8c4ee1bbcd705bd00e70e779
Signed-off-by: Vasili Gulevich <vasili.gulevich@xored.com>
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/ExternalSourceModuleEditorInputFactory.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/ExternalSourceModuleEditorInputFactory.java
index 32a6828..e3315ef 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/ExternalSourceModuleEditorInputFactory.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/ExternalSourceModuleEditorInputFactory.java
@@ -13,6 +13,8 @@
 
 import org.eclipse.core.resources.IStorage;
 import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.dltk.core.DLTKCore;
 import org.eclipse.dltk.core.IExternalSourceModule;
 import org.eclipse.dltk.core.IModelElement;
@@ -51,6 +53,12 @@
 
 	public static IPersistableElement createPersistableElement(
 			final IExternalSourceModule module) {
+		IAdapterManager ADAPTERS = Platform.getAdapterManager();
+		final IPersistableElement element = (IPersistableElement) ADAPTERS
+				.getAdapter(module, IPersistableElement.class);
+		if (element != null)
+			return element;
+
 		return new IPersistableElement() {
 
 			public String getFactoryId() {