Author: dgolovin
Date: 2011-07-31 23:20:03 -0400 (Sun, 31 Jul 2011)
New Revision: 33397
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
https://issues.jboss.org/browse/JBIDE-9339 VPE should have better exceptions handling
related to third party templates
added safe wrapper for template's calls
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-08-01
00:34:11 UTC (rev 33396)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-08-01
03:20:03 UTC (rev 33397)
@@ -525,7 +525,7 @@
}
//Create a composite to the Editor
- Composite cmpEd = new Composite (cmpEdTl, SWT.NATIVE);
+ final Composite cmpEd = new Composite (cmpEdTl, SWT.NATIVE);
GridLayout layoutEd = new GridLayout(1, false);
layoutEd.marginBottom = 0;
layoutEd.marginHeight = 1;
@@ -587,11 +587,15 @@
}
public void completed(ProgressEvent event) {
- if(MozillaEditor.this.getXulRunnerEditor().getWebBrowser()!=null){
- //process this code only in case when editor hasn't been disposed,
- //see
https://jira.jboss.org/browse/JBIDE-6373
- MozillaEditor.this.onLoadWindow();
- xulRunnerEditor.getBrowser().removeProgressListener(this);
+ try {
+ if (MozillaEditor.this.getXulRunnerEditor().getWebBrowser() != null) {
+ //process this code only in case when editor hasn't been disposed,
+ //see
https://jira.jboss.org/browse/JBIDE-6373
+ MozillaEditor.this.onLoadWindow();
+ xulRunnerEditor.getBrowser().removeProgressListener(this);
+ }
+ } catch (Exception ex) {
+ showXulRunnerError(cmpEd, ex);
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2011-08-01
00:34:11 UTC (rev 33396)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2011-08-01
03:20:03 UTC (rev 33397)
@@ -1053,6 +1053,7 @@
}
if (template != null) {
template.init(templateElement, caseSensitive);
+ template = new VpeTemplateSafeWrapper(template);
}
return template;
}