KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > ui > refactoring > history > RefactoringImageDescriptor


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ltk.internal.ui.refactoring.history;
12
13 import org.eclipse.swt.graphics.Image;
14 import org.eclipse.swt.graphics.ImageData;
15
16 import org.eclipse.jface.resource.ImageDescriptor;
17
18 /**
19  * Image descriptor which encapsulates an image.
20  *
21  * @since 3.2
22  */

23 public final class RefactoringImageDescriptor extends ImageDescriptor {
24
25     /** The image */
26     private Image fImage;
27
28     /**
29      * Creates a new refactoring image descriptor.
30      *
31      * @param image
32      * the image to describe
33      */

34     public RefactoringImageDescriptor(final Image image) {
35         fImage= image;
36     }
37
38     /**
39      * {@inheritDoc}
40      */

41     public boolean equals(final Object JavaDoc object) {
42         return (object != null) && getClass().equals(object.getClass()) && fImage.equals(((RefactoringImageDescriptor) object).fImage);
43     }
44
45     /**
46      * {@inheritDoc}
47      */

48     public ImageData getImageData() {
49         return fImage.getImageData();
50     }
51
52     /**
53      * {@inheritDoc}
54      */

55     public int hashCode() {
56         return fImage.hashCode();
57     }
58 }
Popular Tags