Author: yradtsevich
Date: 2009-11-24 10:47:34 -0500 (Tue, 24 Nov 2009)
New Revision: 18802
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4345
Workaround for
https://bugs.eclipse.org/278370 reverted since the bug is fixed in Eclipse
3.5.1.
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 2009-11-24
15:23:48 UTC (rev 18801)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-11-24
15:47:34 UTC (rev 18802)
@@ -594,39 +594,10 @@
protected void setInitialContent() {
final String html = DocTypeUtil.prepareInitFile(
INIT_FILE, getEditorInput());
-
- // Workaround of JBIDE-4345.
- // Due to a bug in org.eclipse.swt.browser.Mozilla we cannot simply
- // set initial html code as xulRunnerEditor.setText(html).
- // Instead of it we create a temporary file containing
- // the html code and set it to the Mozilla browser as URL.
- File tmp = null;
- Writer out = null;
- try {
- tmp = File.createTempFile(
- "temp", ".html"); //$NON-NLS-1$//$NON-NLS-2$
- tmp.deleteOnExit();
- out = new FileWriter(tmp);
- out.write(html);
- } catch (IOException e) {
- VpePlugin.getPluginLog().logError(e);
- } finally {
- try {
- if (out != null) {
- out.close();
- if (tmp != null) {
- xulRunnerEditor.setURL("file://" //$NON-NLS-1$
- + tmp.getCanonicalPath());
- }
- }
- } catch (IOException e) {
- VpePlugin.getPluginLog().logError(e);
- } finally {
- if (tmp != null) {
- tmp.delete();
- }
- }
- }
+
+ // there was a problem with setText in eclipse 3.5.0 (JBIDE-4345),
+ // but since 3.5.1 it should work
+ xulRunnerEditor.setText(html);
}
/**