Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompositeContextInformationValidator.java')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompositeContextInformationValidator.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompositeContextInformationValidator.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompositeContextInformationValidator.java
index 1f2bd35cfd6..31ac39e2cfb 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompositeContextInformationValidator.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompositeContextInformationValidator.java
@@ -13,8 +13,9 @@ package org.eclipse.jface.text.contentassist;
import java.util.Arrays;
import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextPresentation;
-class CompositeContextInformationValidator implements IContextInformationValidator {
+class CompositeContextInformationValidator implements IContextInformationValidator, IContextInformationPresenter {
private final IContextInformationValidator[] children;
@@ -32,4 +33,12 @@ class CompositeContextInformationValidator implements IContextInformationValidat
return Arrays.stream(children).anyMatch(child -> child.isContextInformationValid(offset));
}
+ @Override
+ public boolean updatePresentation(int offset, TextPresentation presentation) {
+ if (children.length == 1 && children[0] instanceof IContextInformationPresenter) {
+ return ((IContextInformationPresenter) children[0]).updatePresentation(offset, presentation);
+ }
+ return false;
+ }
+
}

Back to the top