Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
blob: fbf6d7f3fe8dd9122d3d6e27f976e360152f782f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/********************************************************************************
 * Copyright (c) 2008 IBM Corporation. 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 http://www.eclipse.org/legal/epl-v10.html
 * 
 * Initial Contributors:
 * The following IBM employees contributed to the Remote System Explorer
 * component that contains this file: David McKnight.
 * 
 * Contributors:
 * David McKnight    (IBM)     - [236505] Remote systems dialog not working
 ********************************************************************************/
package org.eclipse.rse.internal.ui;

import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;

import org.eclipse.swt.graphics.Image;

public class RSEImageMap {

    private static Map _imageTable = new Hashtable(100);
      
    public static Image get(Object key) {
    	if (_imageTable != null){
    		return (Image)_imageTable.get(key);
    	}
    	return null;
    }
    
    public static void put(Object key, Image image) {
    	if (_imageTable == null){
    		_imageTable = new Hashtable(100);
    	}
 	
    	_imageTable.put(key, image);
    }
    
    public static final void shutdown() {
        if (_imageTable != null) {
            for (Iterator i = _imageTable.values().iterator(); i.hasNext();) {
                ((Image) i.next()).dispose();
            }
            _imageTable = null;
        }
    }
}

Back to the top