1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2012 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.sysdyn.ui.properties;
\r
14 import org.eclipse.jface.resource.ColorDescriptor;
\r
15 import org.eclipse.jface.resource.ResourceManager;
\r
16 import org.eclipse.swt.graphics.Color;
\r
17 import org.eclipse.swt.graphics.RGB;
\r
18 import org.simantics.browsing.ui.swt.widgets.impl.ITrackedColorProvider;
\r
21 * Color provider for sysdyn tool. Use this color provider to get a consistent look for the product.
\r
22 * @author Teemu Lempinen
\r
25 public class SysdynBasicColorProvider implements ITrackedColorProvider {
\r
27 private final ResourceManager resourceManager;
\r
29 private final ColorDescriptor highlightColor = ColorDescriptor.createFrom(new RGB(254, 255, 197));
\r
30 private final ColorDescriptor inactiveColor = ColorDescriptor.createFrom(new RGB(255, 255, 255));
\r
31 private final ColorDescriptor invalidInputColor = ColorDescriptor.createFrom(new RGB(255, 128, 128));
\r
33 public SysdynBasicColorProvider(ResourceManager resourceManager) {
\r
34 this.resourceManager = resourceManager;
\r
38 public Color getEditingBackground() {
\r
39 return resourceManager.createColor(inactiveColor);
\r
43 public Color getHoverBackground() {
\r
44 return resourceManager.createColor(highlightColor);
\r
48 public Color getInactiveBackground() {
\r
49 return resourceManager.createColor(inactiveColor);
\r
53 public Color getInvalidBackground() {
\r
54 return resourceManager.createColor(invalidInputColor);
\r