Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Maetzel2004-04-07 19:20:58 +0000
committerKai Maetzel2004-04-07 19:20:58 +0000
commitab975efef515e8e7e895f34c09c893fbe4befff6 (patch)
treebf3b0e11eff40bed5ffe2c8a6e8e366c56785ce9
parent83a3bd5223d79ab0953745980f5095b04019781d (diff)
downloadeclipse.platform.text-ab975efef515e8e7e895f34c09c893fbe4befff6.tar.gz
eclipse.platform.text-ab975efef515e8e7e895f34c09c893fbe4befff6.tar.xz
eclipse.platform.text-ab975efef515e8e7e895f34c09c893fbe4befff6.zip
added master ranges to projection change events
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java6
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentEvent.java14
2 files changed, 16 insertions, 4 deletions
diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java
index 20906e906..7ee6a0163 100644
--- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java
+++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java
@@ -259,7 +259,7 @@ public class ProjectionDocument extends AbstractDocument {
offsetInSlave= segment.getOffset() + segment.getLength();
}
- ProjectionDocumentEvent event= new ProjectionDocumentEvent(this, offsetInSlave, 0, fMasterDocument.get(offsetInMaster, lengthInMaster));
+ ProjectionDocumentEvent event= new ProjectionDocumentEvent(this, offsetInSlave, 0, fMasterDocument.get(offsetInMaster, lengthInMaster), offsetInMaster, lengthInMaster);
super.fireDocumentAboutToBeChanged(event);
// check for neighboring fragment
@@ -339,7 +339,7 @@ public class ProjectionDocument extends AbstractDocument {
if (fragment == null)
throw new IllegalArgumentException();
- ProjectionDocumentEvent event= new ProjectionDocumentEvent(this, imageRegion.getOffset(), imageRegion.getLength(), null);
+ ProjectionDocumentEvent event= new ProjectionDocumentEvent(this, imageRegion.getOffset(), imageRegion.getLength(), null, offsetInMaster, lengthInMaster);
super.fireDocumentAboutToBeChanged(event);
if (fragment.getOffset() == offsetInMaster) {
@@ -754,7 +754,7 @@ public class ProjectionDocument extends AbstractDocument {
public void replaceMasterDocumentRanges(int offsetInMaster, int lengthInMaster) throws BadLocationException {
try {
- ProjectionDocumentEvent event= new ProjectionDocumentEvent(this, 0, fMapping.getImageLength(), fMasterDocument.get(offsetInMaster, lengthInMaster));
+ ProjectionDocumentEvent event= new ProjectionDocumentEvent(this, 0, fMapping.getImageLength(), fMasterDocument.get(offsetInMaster, lengthInMaster), offsetInMaster, lengthInMaster);
super.fireDocumentAboutToBeChanged(event);
Position[] fragments= getFragments();
diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentEvent.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentEvent.java
index f443d5177..5040d17bf 100644
--- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentEvent.java
+++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentEvent.java
@@ -25,18 +25,30 @@ public class ProjectionDocumentEvent extends SlaveDocumentEvent {
public final static Object CONTENT_CHANGE= new Object();
private Object fChangeType;
+ private int fMasterOffset= -1;
+ private int fMasterLength= -1;
public ProjectionDocumentEvent(IDocument doc, int offset, int length, String text, DocumentEvent masterEvent) {
super(doc, offset, length, text, masterEvent);
fChangeType= CONTENT_CHANGE;
}
- public ProjectionDocumentEvent(IDocument doc, int offset, int length, String text) {
+ public ProjectionDocumentEvent(IDocument doc, int offset, int length, String text, int masterOffset, int masterLength) {
super(doc, offset, length, text, null);
fChangeType= PROJECTION_CHANGE;
+ fMasterOffset= masterOffset;
+ fMasterLength= masterLength;
}
public Object getChangeType() {
return fChangeType;
}
+
+ public int getMasterOffset() {
+ return fMasterOffset;
+ }
+
+ public int getMasterLength() {
+ return fMasterLength;
+ }
}

Back to the top