Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-07-25 12:26:20 +0000
committerAlexander Kurtakov2017-07-25 12:29:43 +0000
commit30c01e1e4b9f3f6feb22bf12a7248de589b24b9b (patch)
tree2416c300df9a310f20e9590706f7120dcf97a944
parent5c8cf37fee9b51ed5761d1de73d1d840d40739e7 (diff)
downloadeclipse.platform.text-30c01e1e4b9f3f6feb22bf12a7248de589b24b9b.tar.gz
eclipse.platform.text-30c01e1e4b9f3f6feb22bf12a7248de589b24b9b.tar.xz
eclipse.platform.text-30c01e1e4b9f3f6feb22bf12a7248de589b24b9b.zip
colors. Don't define new Colors as they need disposing which is done automatically for system colors. The colors used map exactly to BLUE and DARK_GRAY here. Change-Id: I81752e6f426d3efbfcc247309acb8b0155581b07 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/BlueTagsPresentationReconciler.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/BlueTagsPresentationReconciler.java b/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/BlueTagsPresentationReconciler.java
index fd2400544dc..1cfcf1eba33 100644
--- a/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/BlueTagsPresentationReconciler.java
+++ b/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/BlueTagsPresentationReconciler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 Red Hat Inc. and others
+ * Copyright (c) 2016, 2017 Red Hat Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,6 @@
*******************************************************************************/
package org.eclipse.ui.genericeditor.examples.dotproject;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.presentation.PresentationReconciler;
@@ -22,11 +18,13 @@ import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
public class BlueTagsPresentationReconciler extends PresentationReconciler {
- private final TextAttribute tagAttribute = new TextAttribute(new Color(Display.getCurrent(), new RGB(0,0, 255)));
- private final TextAttribute headerAttribute = new TextAttribute(new Color(Display.getCurrent(), new RGB(128,128,128)));
+ private final TextAttribute tagAttribute = new TextAttribute(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ private final TextAttribute headerAttribute = new TextAttribute(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
public BlueTagsPresentationReconciler() {
RuleBasedScanner scanner= new RuleBasedScanner();

Back to the top