1 /*******************************************************************************
2 * Copyright (c) 2012 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.browsing.ui.swt.widgets;
14 import org.eclipse.jface.resource.ColorDescriptor;
15 import org.eclipse.jface.resource.ResourceManager;
16 import org.eclipse.swt.graphics.Color;
17 import org.eclipse.swt.graphics.RGB;
18 import org.simantics.browsing.ui.swt.widgets.impl.ITrackedColorProvider;
20 public class DefaultColorProvider implements ITrackedColorProvider {
22 private final ResourceManager resourceManager;
24 private final ColorDescriptor highlightColor = ColorDescriptor.createFrom(new RGB(254, 255, 197));
25 private final ColorDescriptor inactiveColor = ColorDescriptor.createFrom(new RGB(245, 246, 190));
26 private final ColorDescriptor invalidInputColor = ColorDescriptor.createFrom(new RGB(255, 128, 128));
28 public DefaultColorProvider(ResourceManager resourceManager) {
29 this.resourceManager = resourceManager;
33 public Color getEditingBackground() {
38 public Color getHoverBackground() {
39 return resourceManager.createColor(highlightColor);
43 public Color getInactiveBackground() {
44 return resourceManager.createColor(inactiveColor);
48 public Color getInvalidBackground() {
49 return resourceManager.createColor(invalidInputColor);