Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2007-06-07 20:56:24 +0000
committernhauge2007-06-07 20:56:24 +0000
commit3c20340649cbc6f67cc57c7139bd8ab875bea1c8 (patch)
tree6fa8e7d29a830b012f85e47e170a86ea21c2da29
parenta8a7aa5fe84a61b1a3a5c6bcba91d1c00dc7e5fc (diff)
downloadwebtools.dali-3c20340649cbc6f67cc57c7139bd8ab875bea1c8.tar.gz
webtools.dali-3c20340649cbc6f67cc57c7139bd8ab875bea1c8.tar.xz
webtools.dali-3c20340649cbc6f67cc57c7139bd8ab875bea1c8.zip
190692 - File not found on xml file deletion.
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java26
2 files changed, 31 insertions, 20 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java
index 35e36f183e..bc1aeefa8e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmXmlJpaFileContentProvider.java
@@ -29,6 +29,9 @@ public class OrmXmlJpaFileContentProvider implements IJpaFileContentProvider
public static OrmXmlJpaFileContentProvider INSTANCE = new OrmXmlJpaFileContentProvider();
+ private IFile resourceFile;
+
+
/**
* Restrict access
*/
@@ -38,7 +41,7 @@ public class OrmXmlJpaFileContentProvider implements IJpaFileContentProvider
public IJpaRootContentNode buildRootContent(IFile resourceFile) {
OrmXmlResourceFactory.register();
-
+ this.resourceFile = resourceFile;
URI fileURI = URI.createPlatformResourceURI(resourceFile.getFullPath().toString());
OrmXmlResource resource = (OrmXmlResource) getResourceSet(resourceFile).getResource(fileURI, true);
XmlRootContentNode root = OrmFactory.eINSTANCE.createXmlRootContentNode();
@@ -78,15 +81,17 @@ public class OrmXmlJpaFileContentProvider implements IJpaFileContentProvider
}
}
else if (featureId == Resource.RESOURCE__IS_LOADED) {
- // dumb translator is unloading my resource, reload it
- if (notification.getNewBooleanValue() == false) {
- OrmXmlResource resource = (OrmXmlResource) notification.getNotifier();
- try {
- resource.load(Collections.EMPTY_MAP);
- }
- catch (IOException ioe) {
- // hmmm, log for now
- JptCorePlugin.log(ioe);
+ if (resourceFile.exists()) {
+ // dumb translator is unloading my resource, reload it
+ if (notification.getNewBooleanValue() == false) {
+ OrmXmlResource resource = (OrmXmlResource) notification.getNotifier();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException ioe) {
+ // hmmm, log for now
+ JptCorePlugin.log(ioe);
+ }
}
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java
index 15f32de191..c5e5322634 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/PersistenceXmlJpaFileContentProvider.java
@@ -29,6 +29,10 @@ public class PersistenceXmlJpaFileContentProvider implements IJpaFileContentProv
{
public static PersistenceXmlJpaFileContentProvider INSTANCE = new PersistenceXmlJpaFileContentProvider();
+
+ private IFile resourceFile;
+
+
/**
* Restrict access
*/
@@ -38,7 +42,7 @@ public class PersistenceXmlJpaFileContentProvider implements IJpaFileContentProv
public IJpaRootContentNode buildRootContent(IFile resourceFile) {
PersistenceXmlResourceFactory.register();
-
+ this.resourceFile = resourceFile;
URI fileURI = URI.createPlatformResourceURI(resourceFile.getFullPath().toString());
PersistenceResource resource = (PersistenceResource) getResourceSet(resourceFile).getResource(fileURI, true);
PersistenceXmlRootContentNode root = PersistenceFactory.eINSTANCE.createPersistenceXmlRootContentNode();
@@ -79,15 +83,17 @@ public class PersistenceXmlJpaFileContentProvider implements IJpaFileContentProv
}
}
else if (featureId == Resource.RESOURCE__IS_LOADED) {
- // dumb translator is unloading my resource, reload it
- if (notification.getNewBooleanValue() == false) {
- PersistenceResource resource = (PersistenceResource) notification.getNotifier();
- try {
- resource.load(Collections.EMPTY_MAP);
- }
- catch (IOException ioe) {
- // hmmm, log for now
- JptCorePlugin.log(ioe);
+ if (resourceFile.exists()) {
+ // dumb translator is unloading my resource, reload it
+ if (notification.getNewBooleanValue() == false) {
+ PersistenceResource resource = (PersistenceResource) notification.getNotifier();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException ioe) {
+ // hmmm, log for now
+ JptCorePlugin.log(ioe);
+ }
}
}
}

Back to the top