Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Pontesegger2012-10-25 14:19:29 +0000
committerBrian de Alwis2012-10-25 14:20:39 +0000
commitf67a21e05ad34b4c494893e4c98618baabe62468 (patch)
treefe35f9e2246b222b9950de7e29d07f6eb69a4fb1 /bundles
parentbdc5129ba5bac8adfc9bb422d22ee7b93dcb9fda (diff)
downloadeclipse.platform.ui-f67a21e05ad34b4c494893e4c98618baabe62468.tar.gz
eclipse.platform.ui-f67a21e05ad34b4c494893e4c98618baabe62468.tar.xz
eclipse.platform.ui-f67a21e05ad34b4c494893e4c98618baabe62468.zip
Bug 392066 - add toString method to XMLMemento
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java
index 7a138515e13..c3e68927ece 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java
@@ -13,6 +13,7 @@ package org.eclipse.ui;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Reader;
+import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
@@ -607,6 +608,22 @@ public final class XMLMemento implements IMemento {
}
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ try {
+ StringWriter writer = new StringWriter();
+ save(writer);
+ return writer.toString();
+ } catch (IOException e) {
+ return super.toString();
+ }
+ }
+
/**
* A simple XML writer. Using this instead of the javax.xml.transform classes allows
* compilation against JCL Foundation (bug 80053).

Back to the top