Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2015-09-03 23:38:40 +0000
committerMatthias Sohn2015-09-07 09:14:24 +0000
commitfe7115a12667c31a66a8df347853561771d8a323 (patch)
tree80ab298e4c672c5489958513b763cf834ac2849d /org.eclipse.egit.ui.test
parentc715f4fcedca66cde53553c78528fc828d8ab194 (diff)
downloadegit-fe7115a12667c31a66a8df347853561771d8a323.tar.gz
egit-fe7115a12667c31a66a8df347853561771d8a323.tar.xz
egit-fe7115a12667c31a66a8df347853561771d8a323.zip
Use standard link colors in SpellcheckableMessageArea
There are at least three different color definitions for hyperlinks in Eclipse: JFacePreferences, EditorsUI, and a system hyperlink color. Use standard colors instead of hard-coded blue (0,0,255). Syntax-color hyperlinks using the JFace HYPERLINK color, and make the hyperlink presenter use the configured hyperlink color for editors. Both of these can be customized by the user through (already existing) preferences and thus can be adapted to the currently used theme. (Harmonizing the discrepancy between the JFace and the EditorsUI colors is bugs 199256/135224.) Change-Id: Id0d058018ee8f6fa2279371c3f5786a3dc24b690 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScannerTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScannerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScannerTest.java
index eb8cc96da7..041250ed5e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScannerTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScannerTest.java
@@ -101,7 +101,7 @@ public class HyperlinkTokenScannerTest {
when(viewer.getDocument()).thenReturn(testDocument);
HyperlinkTokenScanner scanner = new HyperlinkTokenScanner(detectors,
viewer);
- scanner.setRange(testDocument, offset, length);
+ scanner.setRangeAndColor(testDocument, offset, length, null);
IToken token = null;
char[] found = new char[text.length()];
Arrays.fill(found, ' ');
@@ -109,10 +109,11 @@ public class HyperlinkTokenScannerTest {
int tokenOffset = scanner.getTokenOffset();
int tokenLength = scanner.getTokenLength();
char ch = 'x';
- if (token == HyperlinkTokenScanner.HYPERLINK) {
- ch = 'H';
- } else if (token == HyperlinkTokenScanner.DEFAULT) {
+ if (token == HyperlinkTokenScanner.DEFAULT) {
ch = 'D';
+ } else if (token
+ .getData() instanceof HyperlinkDamagerRepairer.HyperlinkTextAttribute) {
+ ch = 'H';
}
Arrays.fill(found, tokenOffset, tokenOffset + tokenLength, ch);
}

Back to the top