Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarendt2014-04-15 10:58:41 -0400
committertarendt2014-04-15 10:58:41 -0400
commitabcc85dae181b54e9a86776dac2c0eec54363a6b (patch)
tree899717f5b97536ad54a3a487541f854bd7f46fd5
parent16f43f87178d6d0eff8a6e288d1663ee5332e750 (diff)
downloadorg.eclipse.emf.refactor.refactoring-abcc85dae181b54e9a86776dac2c0eec54363a6b.tar.gz
org.eclipse.emf.refactor.refactoring-abcc85dae181b54e9a86776dac2c0eec54363a6b.tar.xz
org.eclipse.emf.refactor.refactoring-abcc85dae181b54e9a86776dac2c0eec54363a6b.zip
bug xtextdocument null fixed
-rw-r--r--org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1$1.classbin5038 -> 5038 bytes
-rw-r--r--org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1.classbin2683 -> 3490 bytes
-rw-r--r--org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.classbin3395 -> 3395 bytes
-rw-r--r--org.eclipse.emf.refactor.refactoring.xtext/src/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.java20
4 files changed, 17 insertions, 3 deletions
diff --git a/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1$1.class b/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1$1.class
index 7241b4d..6d16047 100644
--- a/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1$1.class
+++ b/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1$1.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1.class b/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1.class
index 259edc6..5e5ccf9 100644
--- a/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1.class
+++ b/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu$1.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.class b/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.class
index 0816e91..793f58b 100644
--- a/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.class
+++ b/org.eclipse.emf.refactor.refactoring.xtext/bin/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactoring.xtext/src/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.java b/org.eclipse.emf.refactor.refactoring.xtext/src/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.java
index 1669366..9470e26 100644
--- a/org.eclipse.emf.refactor.refactoring.xtext/src/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.java
+++ b/org.eclipse.emf.refactor.refactoring.xtext/src/org/eclipse/emf/refactor/refactoring/xtext/ui/XtextApplicationMenu.java
@@ -23,7 +23,9 @@ import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.ui.editor.model.XtextDocument;
+import org.eclipse.xtext.ui.editor.utils.EditorUtils;
import org.eclipse.xtext.util.concurrent.IUnitOfWork;
public class XtextApplicationMenu extends ContributionItem {
@@ -54,9 +56,15 @@ public class XtextApplicationMenu extends ContributionItem {
menuItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
try {
- IXtextDataManagement dm = (IXtextDataManagement) r.getController()
- .getDataManagementObject();
- XtextDocument doc = dm.getXtextDocument();
+ XtextDocument doc = null;
+ if (r.getController().getDataManagementObject()
+ instanceof IXtextDataManagement) {
+ IXtextDataManagement dm = (IXtextDataManagement) r.getController()
+ .getDataManagementObject();
+ doc = dm.getXtextDocument();
+ } else {
+ doc = getXtextDocument();
+ }
doc.modify(new IUnitOfWork.Void<XtextResource>() {
@Override
@@ -97,6 +105,12 @@ public class XtextApplicationMenu extends ContributionItem {
.openError(null, "Error", e2.getMessage());
}
}
+
+ private XtextDocument getXtextDocument() {
+ XtextEditor editor = EditorUtils.getActiveXtextEditor();
+ System.out.println("XtextEditor: " + editor);
+ return (XtextDocument) editor.getDocument();
+ }
});
}
}

Back to the top