refactory: added UI removed from core plugin.
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / 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         /*
32          * (non-Javadoc)
33          * 
34          * @see ImageDescriptor#getImageData()
35          */
36         public ImageData getImageData() {
37                 return fImage.getImageData();
38         }
39
40         /*
41          * (non-Javadoc)
42          * 
43          * @see Object#equals(Object)
44          */
45         public boolean equals(Object obj) {
46                 return (obj != null) && getClass().equals(obj.getClass())
47                                 && fImage.equals(((ImageImageDescriptor) obj).fImage);
48         }
49
50         /*
51          * (non-Javadoc)
52          * 
53          * @see Object#hashCode()
54          */
55         public int hashCode() {
56                 return fImage.hashCode();
57         }
58
59 }