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.2 2006-10-21 23:13:53 pombredanne 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
25 public class ImageImageDescriptor extends ImageDescriptor {
27 // Instance Variables ------------------------------------------------------
29 /** The wrapped image. */
32 // Constructors ------------------------------------------------------------
40 public ImageImageDescriptor(Image image) {
44 // ImageDescriptor Implementation ------------------------------------------
47 * @see ImageDescriptor#getImageData()
49 public ImageData getImageData() {
50 return image.getImageData();
54 * @see Object#equals(Object)
56 public boolean equals(Object o) {
57 if (o instanceof ImageImageDescriptor) {
58 ImageImageDescriptor other = (ImageImageDescriptor) o;
59 if (image.equals(other.image)) {
67 * @see Object#hashCode()
69 public int hashCode() {
70 return image.hashCode();