Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.ant.internal.ui;
import  org.eclipse.swt.widgets.Display;

A registry that maps ImageDescriptors to Image.
public class ImageDescriptorRegistry {
	private HashMap fRegistrynew HashMap(10);
	private Display fDisplay;

Creates a new image descriptor registry for the current or default display, respectively.

Creates a new image descriptor registry for the given display. All images managed by this registry will be disposed when the display gets disposed.

display the display the images managed by this registry are allocated for
	public ImageDescriptorRegistry(Display display) {

Returns the image associated with the given image descriptor.

descriptor the image descriptor for which the registry manages an image
the image associated with the image descriptor or null if the image descriptor can't create the requested image.
	public Image get(ImageDescriptor descriptor) {
		if (descriptor == null)
			descriptor= ImageDescriptor.getMissingImageDescriptor();
		Image result= (Image).get(descriptor);
		if (result != null)
			return result;
		if (result != null)
		return result;

Disposes all images managed by this registry.
	public void dispose() {
		for (Iterator iter.values().iterator(); iter.hasNext(); ) {
			Image image= (Image);
	private void hookDisplay() {
		.disposeExec(new Runnable() {
			public void run() {
New to GrepCode? Check out our FAQ X