2 * Copyright (c) 2004 Christopher Lenz and others
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * Christopher Lenz - initial version based on the Eclipse class of the same
10 * name in org.eclipse.jdt.internal.ui.viewsupport
12 * $Id: ImageImageDescriptor.java,v 1.1 2004-09-02 18:26:28 jsurfer Exp $
15 package net.sourceforge.phpeclipse.ui.views.util;
17 import org.eclipse.jface.resource.ImageDescriptor;
18 import org.eclipse.swt.graphics.Image;
19 import org.eclipse.swt.graphics.ImageData;
22 * <tt>ImageDescriptor</tt> implementation that wraps an existing {@link Image}.
24 public class ImageImageDescriptor extends ImageDescriptor {
26 // Instance Variables ------------------------------------------------------
28 /** The wrapped image. */
31 // Constructors ------------------------------------------------------------
36 * @param image the image to wrap
38 public ImageImageDescriptor(Image image) {
42 // ImageDescriptor Implementation ------------------------------------------
45 * @see ImageDescriptor#getImageData()
47 public ImageData getImageData() {
48 return image.getImageData();
52 * @see Object#equals(Object)
54 public boolean equals(Object o) {
55 if (o instanceof ImageImageDescriptor) {
56 ImageImageDescriptor other = (ImageImageDescriptor) o;
57 if (image.equals(other.image)) {
65 * @see Object#hashCode()
67 public int hashCode() {
68 return image.hashCode();