Organized imports
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / viewsupport / ImageImageDescriptor.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation 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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.ui.viewsupport;
12
13 import org.eclipse.jface.resource.ImageDescriptor;
14 import org.eclipse.swt.graphics.Image;
15 import org.eclipse.swt.graphics.ImageData;
16
17 /**
18   */
19 public class ImageImageDescriptor extends ImageDescriptor {
20
21         private Image fImage;
22
23         /**
24          * Constructor for ImagImageDescriptor.
25          */
26         public ImageImageDescriptor(Image image) {
27                 super();
28                 fImage= image;
29         }
30
31         /* (non-Javadoc)
32          * @see ImageDescriptor#getImageData()
33          */
34         public ImageData getImageData() {
35                 return fImage.getImageData();
36         }
37
38         /* (non-Javadoc)
39          * @see Object#equals(Object)
40          */
41         public boolean equals(Object obj) {
42                 return (obj != null) && getClass().equals(obj.getClass()) && fImage.equals(((ImageImageDescriptor)obj).fImage);
43         }
44
45         /* (non-Javadoc)
46          * @see Object#hashCode()
47          */
48         public int hashCode() {
49                 return fImage.hashCode();
50         }
51
52 }