/******************************************************************************* * Copyright (c) 2007, 2010 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; import java.util.Map; import org.eclipse.jface.resource.ImageDescriptor; import org.simantics.browsing.ui.BuiltinKeys.ImagerKey; import org.simantics.browsing.ui.NodeContext; import org.simantics.browsing.ui.PrimitiveQueryUpdater; import org.simantics.browsing.ui.common.imagers.ContainerImager; import org.simantics.browsing.ui.content.Imager; import org.simantics.browsing.ui.content.ImagerFactory; /** * A basic {@link ImagerFactory} that provides a constant set of images. The * images are keyed by columns. This factory never updates images. * * @author Tuukka Lehtonen */ public class ConstantImagerFactory implements ImagerFactory { private final Imager imager; public ConstantImagerFactory(Map constants) { this.imager = new ContainerImager(constants); } public ConstantImagerFactory(Imager imager) { this.imager = imager; } @Override public Imager create(final PrimitiveQueryUpdater updater, final NodeContext context, final ImagerKey key) { return imager; } }