Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Thienel2016-01-28 13:29:00 -0500
committerFlorian Thienel2016-01-28 13:29:00 -0500
commitb6a201913886607edd33a400f2865cc844ed7373 (patch)
treed03198e4d853349b943bef13bcf84ee340cc434c
parentb36656260dfd846c4078815363263ab97307f96f (diff)
downloadorg.eclipse.mylyn.docs.vex-b6a201913886607edd33a400f2865cc844ed7373.tar.gz
org.eclipse.mylyn.docs.vex-b6a201913886607edd33a400f2865cc844ed7373.tar.xz
org.eclipse.mylyn.docs.vex-b6a201913886607edd33a400f2865cc844ed7373.zip
remove references to the document from EclipseContext on editor closing
Signed-off-by: Florian Thienel <florian@thienel.org>
-rw-r--r--org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/DocumentContextSourceProvider.java10
-rw-r--r--org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/VexEditor.java6
2 files changed, 15 insertions, 1 deletions
diff --git a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/DocumentContextSourceProvider.java b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/DocumentContextSourceProvider.java
index dfc0abe7..6f4f5132 100644
--- a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/DocumentContextSourceProvider.java
+++ b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/DocumentContextSourceProvider.java
@@ -108,6 +108,16 @@ public class DocumentContextSourceProvider extends AbstractSourceProvider {
return currentState;
}
+ public void resetContext() {
+ currentNode = null;
+ caretArea = null;
+
+ final Map<String, Object> changes = new HashMap<String, Object>();
+ changes.put(CURRENT_NODE, currentNode);
+ changes.put(CARET_AREA, caretArea);
+ fireSourceChanged(ISources.WORKBENCH, changes);
+ }
+
/**
* Synchronizes the variable values which will be exposed by this service with the specified {@link VexWidget}.
*
diff --git a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/VexEditor.java b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/VexEditor.java
index 9d4bc691..343fd12f 100644
--- a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/VexEditor.java
+++ b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/editor/VexEditor.java
@@ -233,10 +233,14 @@ public class VexEditor extends EditorPart {
document.removeDocumentListener(documentListener);
}
- if (style != null) {
+ if (style != null && document != null) {
style.getStyleSheet().flushAllStyles(document);
}
+ final ISourceProviderService service = (ISourceProviderService) getEditorSite().getWorkbenchWindow().getService(ISourceProviderService.class);
+ final DocumentContextSourceProvider contextProvider = (DocumentContextSourceProvider) service.getSourceProvider(DocumentContextSourceProvider.IS_COLUMN);
+ contextProvider.resetContext();
+
getEditorSite().getSelectionProvider().removeSelectionChangedListener(selectionChangedListener);
if (parentControl != null) {

Back to the top