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.graph.impl;
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.swt.graphics.ImageData;
16 import org.eclipse.swt.graphics.PaletteData;
17 import org.eclipse.swt.graphics.RGB;
20 * A simple 16x16 white image descriptor for a missing image.
22 * Use <code>MissingImageDescriptor.getInstance</code> to
23 * access the singleton instance maintained in an
24 * internal state variable.
27 public class MissingImageDescriptor extends ImageDescriptor {
28 private static MissingImageDescriptor instance;
30 protected static final ImageData IMAGE_DATA = new ImageData(16, 16,
31 1, new PaletteData(new RGB[] { new RGB(255, 255, 255) }));
34 * Constructs a new default image descriptor.
36 private MissingImageDescriptor() {
41 * Method declared on ImageDesciptor.
44 public ImageData getImageData() {
49 * Returns the shared default image descriptor instance.
51 * @return the image descriptor for a default image
53 public static MissingImageDescriptor getInstance() {
54 if (instance == null) {
55 instance = new MissingImageDescriptor();