summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Trimble2012-10-16 12:13:00 (EDT)
committerIan Trimble2012-10-16 12:13:00 (EDT)
commit960f588193faabbe8f4ff9be8773218a47a7138e (patch)
tree295e8c93b78212958fe913884c00e737888a9a45
parente172355cd7f3acc5f0afdb6429e9b288a839d243 (diff)
downloadwebtools.jsf-960f588193faabbe8f4ff9be8773218a47a7138e.zip
webtools.jsf-960f588193faabbe8f4ff9be8773218a47a7138e.tar.gz
webtools.jsf-960f588193faabbe8f4ff9be8773218a47a7138e.tar.bz2
Bug 391923
Error message shown when write the CSS background image code by typing
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundImageMeta.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundImageMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundImageMeta.java
index ac1acac..92aeaa0 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundImageMeta.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundImageMeta.java
@@ -24,6 +24,7 @@ import org.eclipse.jst.pagedesigner.IHTMLConstants;
import org.eclipse.jst.pagedesigner.PDPlugin;
import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
import org.eclipse.jst.pagedesigner.utils.DOMUtil;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
@@ -169,6 +170,13 @@ public class BackgroundImageMeta extends CSSPropertyMeta {
}
}
}
+ } catch(SWTException swtEx) {
+ /*
+ * We're probably trying to create an image from a valid URL to an invalid
+ * resource (such as a URL to a folder or to a file that is not an image file);
+ * ignoring the exception will result in a return of null, which is what we want
+ * in this case.
+ */
}
} else if (image.isDisposed()) {
//shouldn't be able to get here from there, but...just in case