Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java b/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java
index 8b77def..0ee16bb 100644
--- a/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java
+++ b/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java
@@ -10,6 +10,9 @@
package org.eclipse.virgo.ide.manifest.core.editor.model;
+import java.lang.reflect.Method;
+import java.nio.charset.Charset;
+
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.pde.internal.core.ibundle.IBundleModelFactory;
@@ -38,4 +41,26 @@ public class SpringBundleModel extends BundleModel {
return this.fFactory;
}
+ public void setCharset(String charset) {
+ Method m;
+ try {
+ m = getClass().getSuperclass().getMethod("setCharset", Charset.class);
+ try {
+ m.invoke(this, Charset.forName(charset));
+ return;
+ } catch (Exception e) {
+ }
+ } catch (NoSuchMethodException e) {
+ try {
+ m = getClass().getSuperclass().getMethod("setCharset", String.class);
+ m.invoke(this, charset);
+ return;
+ } catch (Exception e1) {
+ }
+ } catch (Exception e) {
+ }
+
+ throw new RuntimeException("Cannot set file charset");
+ }
+
}

Back to the top