Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-12-20 17:02:46 +0000
committerAndrey Loskutov2020-01-03 11:28:39 +0000
commitba62205c35495a3b7a395c97d5e761ae98892ef9 (patch)
tree1603af49772015406051dc02a811020c21e0b0d4
parent5d4c228ec0fc2924113fcae24519fb1b9c1094ce (diff)
downloadeclipse.platform.text-ba62205c35495a3b7a395c97d5e761ae98892ef9.tar.gz
eclipse.platform.text-ba62205c35495a3b7a395c97d5e761ae98892ef9.tar.xz
eclipse.platform.text-ba62205c35495a3b7a395c97d5e761ae98892ef9.zip
revert https://git.eclipse.org/r/#/c/152786/ Change-Id: I5cea88489165cc8741bd55efb05b5e9993fac355 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
index bc84985a2..099931c48 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
@@ -2633,7 +2633,8 @@ public class TextViewer extends Viewer implements
List<ISelectionChangedListener> listeners= fPostSelectionChangedListeners;
if (listeners != null) {
listeners= new ArrayList<>(listeners);
- for (ISelectionChangedListener l : listeners) {
+ for (int i= 0; i < listeners.size(); i++) {
+ ISelectionChangedListener l= listeners.get(i);
l.selectionChanged(event);
}
}
@@ -2703,7 +2704,8 @@ public class TextViewer extends Viewer implements
event= ((SlaveDocumentEvent) event).getMasterEvent();
TextEvent e= new TextEvent(cmd.start, cmd.length, cmd.text, cmd.preservedText, event, redraws());
- for (ITextListener l : textListeners) {
+ for (int i= 0; i < textListeners.size(); i++) {
+ ITextListener l= textListeners.get(i);
l.textChanged(e);
}
}
@@ -2745,7 +2747,8 @@ public class TextViewer extends Viewer implements
protected void fireInputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
List<ITextInputListener> listener= fTextInputListeners;
if (listener != null) {
- for (ITextInputListener l : listener) {
+ for (int i= 0; i < listener.size(); i++) {
+ ITextInputListener l= listener.get(i);
l.inputDocumentAboutToBeChanged(oldInput, newInput);
}
}
@@ -2761,7 +2764,8 @@ public class TextViewer extends Viewer implements
protected void fireInputDocumentChanged(IDocument oldInput, IDocument newInput) {
List<ITextInputListener> listener= fTextInputListeners;
if (listener != null) {
- for (ITextInputListener l : listener) {
+ for (int i= 0; i < listener.size(); i++) {
+ ITextInputListener l= listener.get(i);
l.inputDocumentChanged(oldInput, newInput);
}
}
@@ -2978,7 +2982,8 @@ public class TextViewer extends Viewer implements
int topPixel= fTextWidget.getTopPixel();
if (topPixel >= 0 && topPixel != fLastTopPixel) {
if (fViewportListeners != null) {
- for (IViewportListener l : fViewportListeners) {
+ for (int i= 0; i < fViewportListeners.size(); i++) {
+ IViewportListener l= fViewportListeners.get(i);
l.viewportChanged(topPixel);
}
}
@@ -4746,7 +4751,9 @@ public class TextViewer extends Viewer implements
* and let them apply their presentation.
*/
if (fTextPresentationListeners != null) {
- for (ITextPresentationListener listener : new ArrayList<>(fTextPresentationListeners)) {
+ ArrayList<ITextPresentationListener> listeners= new ArrayList<>(fTextPresentationListeners);
+ for (int i= 0, size= listeners.size(); i < size; i++) {
+ ITextPresentationListener listener= listeners.get(i);
listener.applyTextPresentation(presentation);
}
}

Back to the top