Bug 488825 - Ant runtime preferences page has weird colors

Don't use COLOR_INFO_* which varies really widely - yellow, black and so
on. Enabling/disabling the buttons which is also done is enough.

Change-Id: I9a3ed804f7dd7e0127c31f55dc24624c04599716
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathLabelProvider.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathLabelProvider.java
index a03afd3..ac19258 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathLabelProvider.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathLabelProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation 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
@@ -16,20 +16,16 @@
 import org.eclipse.ant.internal.ui.AntUIImages;
 import org.eclipse.ant.internal.ui.IAntUIConstants;
 import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.viewers.IColorProvider;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
 
 /**
  * Label provider for classpath elements
  */
-public class AntClasspathLabelProvider implements ILabelProvider, IColorProvider {
+public class AntClasspathLabelProvider implements ILabelProvider {
 
 	private AntClasspathBlock fBlock;
 
@@ -104,46 +100,6 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
-	 */
-	@Override
-	public Color getBackground(Object element) {
-		if (isUnmodifiable(element)) {
-			Display display = Display.getCurrent();
-			return display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
-		}
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
-	 */
-	@Override
-	public Color getForeground(Object element) {
-		if (isUnmodifiable(element)) {
-			Display display = Display.getCurrent();
-			return display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
-		}
-		return null;
-	}
-
-	private boolean isUnmodifiable(Object element) {
-		if (element instanceof GlobalClasspathEntries) {
-			int type = ((GlobalClasspathEntries) element).getType();
-			if (type == ClasspathModel.CONTRIBUTED) {
-				return true;
-			}
-		} else if (element instanceof ClasspathEntry) {
-			return isUnmodifiable(((ClasspathEntry) element).getParent());
-		}
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
 	 * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
 	 */
 	@Override
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntObjectLabelProvider.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntObjectLabelProvider.java
index 12c1a17..06e41d5 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntObjectLabelProvider.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntObjectLabelProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation 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
@@ -16,13 +16,9 @@
 import org.eclipse.ant.internal.core.IAntCoreConstants;
 import org.eclipse.ant.internal.ui.AntUIImages;
 import org.eclipse.ant.internal.ui.IAntUIConstants;
-import org.eclipse.jface.viewers.IColorProvider;
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
@@ -30,7 +26,7 @@
 /**
  * Label provider for type elements
  */
-public class AntObjectLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider {
+public class AntObjectLabelProvider extends LabelProvider implements ITableLabelProvider {
 
 	/*
 	 * (non-Javadoc) Method declared on IBaseLabelProvider.
@@ -121,45 +117,4 @@
 	public static Image getPropertyImage() {
 		return AntUIImages.getImage(IAntUIConstants.IMG_PROPERTY);
 	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
-	 */
-	@Override
-	public Color getForeground(Object element) {
-		if (isUnmodifiable(element)) {
-			Display display = Display.getCurrent();
-			return display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
-		}
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
-	 */
-	@Override
-	public Color getBackground(Object element) {
-		if (isUnmodifiable(element)) {
-			Display display = Display.getCurrent();
-			return display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
-		}
-		return null;
-	}
-
-	private boolean isUnmodifiable(Object element) {
-		if (element instanceof AntObject) {
-			if (((AntObject) element).isDefault()) {
-				return true;
-			}
-		} else if (element instanceof Property) {
-			if (((Property) element).isDefault()) {
-				return true;
-			}
-		}
-		return false;
-	}
 }
\ No newline at end of file