1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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;
16 import org.eclipse.jface.resource.ImageDescriptor;
17 import org.simantics.browsing.ui.BuiltinKeys.ImagerKey;
18 import org.simantics.browsing.ui.NodeContext;
19 import org.simantics.browsing.ui.PrimitiveQueryUpdater;
20 import org.simantics.browsing.ui.common.imagers.ContainerImager;
21 import org.simantics.browsing.ui.content.Imager;
22 import org.simantics.browsing.ui.content.ImagerFactory;
25 * A basic {@link ImagerFactory} that provides a constant set of images. The
26 * images are keyed by columns. This factory never updates images.
28 * @author Tuukka Lehtonen
30 public class ConstantImagerFactory implements ImagerFactory {
32 private final Imager imager;
34 public ConstantImagerFactory(Map<String, ImageDescriptor> constants) {
35 this.imager = new ContainerImager<ImageDescriptor>(constants);
38 public ConstantImagerFactory(Imager imager) {
43 public Imager create(final PrimitiveQueryUpdater updater, final NodeContext context, final ImagerKey key) {