Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2017-05-10 18:36:19 +0000
committerLeo Ufimtsev2017-05-11 13:54:55 +0000
commit9f24457091da000f694220f098c177d686ab0952 (patch)
tree69f2ba081eb4613a169750f91014f67f3ace2eff
parent37dd64af3ce572c7755b1bb2f8887ff6ebcc87c0 (diff)
downloadeclipse.jdt.ui-9f24457091da000f694220f098c177d686ab0952.tar.gz
eclipse.jdt.ui-9f24457091da000f694220f098c177d686ab0952.tar.xz
eclipse.jdt.ui-9f24457091da000f694220f098c177d686ab0952.zip
content Adding missing set*Color() calls to fix reported bug. Cause: AbstractAnnotationHover extends AbstractInformationControl and does some setColoring for it's private child composite without updating the color of the parent structure. Test: - Change information hover colors in preference - Hover over snippet described in bug description Before: Strip at the bottom was of different color. After: Strip at the bottom is the same color as inner content. (see attached screenshot in bug). Reviewer note: - I investigated private setColorAndFont(..). It is only used for coloring of child elements, and only in deferredCreateContent(). As such, there is no situation where setColorAndFont(..) would be called without set*Color() being called first. This ensures consistent colors for this class. Note, after doing a root-cause analysis, I found the same sort-of issue in a few other classes that extend AbstractInformationControl, namely: - BrowserInformationControl - ExpressionInformationControl - LinkListInformationControl I will address those in separate bug because they 1) need the new INFORMATION_ api (instead of further using HOVER_) 2) some are in separate repositories. (jdt/platform) Change-Id: I837eceaf00b8ab8162f8490a1b48425bfc38210d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=516420 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
index b86a83ab50..6c4f3d2af0 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
@@ -293,7 +293,10 @@ public abstract class AbstractAnnotationHover extends AbstractJavaEditorTextHove
if (background == null) {
background= fParent.getBackground();
}
- setColorAndFont(fParent, foreground, background, JFaceResources.getDialogFont());
+
+ setForegroundColor(foreground); // For main composite.
+ setBackgroundColor(background);
+ setColorAndFont(fParent, foreground, background, JFaceResources.getDialogFont()); // For child elements.
ICompletionProposal[] proposals= getAnnotationInfo().getCompletionProposals();
if (proposals.length > 0)

Back to the top