Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2015-06-19 09:09:16 +0000
committerTom Schindl2015-06-19 09:09:34 +0000
commita2d188ee1edc4223f619cea22c153a84525e7622 (patch)
tree7ed26ea094fba158ac01ad15a8cb4bd584cf1701 /experimental
parent5b25227758172e96b1c3a65cec1313f92aa80c11 (diff)
downloadorg.eclipse.efxclipse-a2d188ee1edc4223f619cea22c153a84525e7622.tar.gz
org.eclipse.efxclipse-a2d188ee1edc4223f619cea22c153a84525e7622.tar.xz
org.eclipse.efxclipse-a2d188ee1edc4223f619cea22c153a84525e7622.zip
fire a new event when the document is modified and pass on the
modification
Diffstat (limited to 'experimental')
-rw-r--r--experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/Constants.java1
-rw-r--r--experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/SourceChange.java15
-rw-r--r--experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java1
3 files changed, 17 insertions, 0 deletions
diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/Constants.java b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/Constants.java
index 8a4d7f0a6..4c1b5afe1 100644
--- a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/Constants.java
+++ b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/Constants.java
@@ -2,6 +2,7 @@ package org.eclipse.fx.code.compensator.editor;
public class Constants {
public static final String EDITOR_DOCUMENT_MODIFIED = "org/eclipse/fx/code/compansator/editor/documentModified";
+ public static final String EDITOR_DOCUMENT_MODIFICATION = "org/eclipse/fx/code/compansator/editor/documentModification";
public static final String EDITOR_DOCUMENT_SAVED = "org/eclipse/fx/code/compansator/editor/documentSaved";
public static final String OUTLINE_RELOAD = "org/eclipse/fx/code/compensator/editor/Outline/reload";
diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/SourceChange.java b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/SourceChange.java
new file mode 100644
index 000000000..3fa115873
--- /dev/null
+++ b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/SourceChange.java
@@ -0,0 +1,15 @@
+package org.eclipse.fx.code.compensator.editor;
+
+public class SourceChange {
+ public final Input<?> input;
+ public final int offset;
+ public final int length;
+ public final String replacement;
+
+ public SourceChange(Input<?> input, int offset, int length, String replacement) {
+ this.input = input;
+ this.offset = offset;
+ this.length = length;
+ this.replacement = replacement;
+ }
+}
diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java
index 9374ef2b9..861573c04 100644
--- a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java
+++ b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java
@@ -79,6 +79,7 @@ public class TextEditor {
@Override
public void documentChanged(DocumentEvent event) {
broker.send(org.eclipse.fx.code.compensator.editor.Constants.EDITOR_DOCUMENT_MODIFIED, TextEditor.this);
+ broker.send(org.eclipse.fx.code.compensator.editor.Constants.EDITOR_DOCUMENT_MODIFICATION, new SourceChange(input, event.fOffset, event.fLength, event.fText));
}
@Override

Back to the top