X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2Fwidgets%2FDefaultColorProvider.java;h=ee0132fd661d940f06a00fab4d3196d717c0cac9;hp=69198cf9f3631ba7317114aa35ca3000a03fe84e;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/DefaultColorProvider.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/DefaultColorProvider.java index 69198cf9f..ee0132fd6 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/DefaultColorProvider.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/DefaultColorProvider.java @@ -1,54 +1,54 @@ -/******************************************************************************* - * Copyright (c) 2012 Association for Decentralized Information Management in - * Industry THTH ry. - * 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.browsing.ui.swt.widgets; - -import org.eclipse.jface.resource.ColorDescriptor; -import org.eclipse.jface.resource.ResourceManager; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.simantics.browsing.ui.swt.widgets.impl.ITrackedColorProvider; - -public class DefaultColorProvider implements ITrackedColorProvider { - - private final ResourceManager resourceManager; - - private final ColorDescriptor highlightColor = ColorDescriptor.createFrom(new RGB(254, 255, 197)); - private final ColorDescriptor inactiveColor = ColorDescriptor.createFrom(new RGB(245, 246, 190)); - private final ColorDescriptor invalidInputColor = ColorDescriptor.createFrom(new RGB(255, 128, 128)); - - public DefaultColorProvider(ResourceManager resourceManager) { - this.resourceManager = resourceManager; - } - - @Override - public Color getEditingBackground() { - return null; - } - - @Override - public Color getHoverBackground() { - return resourceManager.createColor(highlightColor); - } - - @Override - public Color getInactiveBackground() { - return resourceManager.createColor(inactiveColor); - } - - @Override - public Color getInvalidBackground() { - return resourceManager.createColor(invalidInputColor); - } - -} - - +/******************************************************************************* + * Copyright (c) 2012 Association for Decentralized Information Management in + * Industry THTH ry. + * 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.browsing.ui.swt.widgets; + +import org.eclipse.jface.resource.ColorDescriptor; +import org.eclipse.jface.resource.ResourceManager; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.RGB; +import org.simantics.browsing.ui.swt.widgets.impl.ITrackedColorProvider; + +public class DefaultColorProvider implements ITrackedColorProvider { + + private final ResourceManager resourceManager; + + private final ColorDescriptor highlightColor = ColorDescriptor.createFrom(new RGB(254, 255, 197)); + private final ColorDescriptor inactiveColor = ColorDescriptor.createFrom(new RGB(245, 246, 190)); + private final ColorDescriptor invalidInputColor = ColorDescriptor.createFrom(new RGB(255, 128, 128)); + + public DefaultColorProvider(ResourceManager resourceManager) { + this.resourceManager = resourceManager; + } + + @Override + public Color getEditingBackground() { + return null; + } + + @Override + public Color getHoverBackground() { + return resourceManager.createColor(highlightColor); + } + + @Override + public Color getInactiveBackground() { + return resourceManager.createColor(inactiveColor); + } + + @Override + public Color getInvalidBackground() { + return resourceManager.createColor(invalidInputColor); + } + +} + +