sysperfana/memspyext/com.nokia.s60tools.memspy/src/com/nokia/s60tools/memspy/resources/ImageResourceManager.java
changeset 7 8e12a575a9b5
equal deleted inserted replaced
6:f65f740e69f9 7:8e12a575a9b5
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 package com.nokia.s60tools.memspy.resources;
       
    20 
       
    21 import org.eclipse.jface.resource.ImageDescriptor;
       
    22 import org.eclipse.jface.resource.ImageRegistry;
       
    23 import org.eclipse.jface.resource.JFaceResources;
       
    24 import org.eclipse.swt.graphics.Image;
       
    25 import org.eclipse.swt.widgets.Display;
       
    26 
       
    27 
       
    28 /**
       
    29  * Class for handling MemSpy icons.
       
    30  *
       
    31  */
       
    32 public class ImageResourceManager {
       
    33 
       
    34 	/**
       
    35 	 * Load images
       
    36 	 * @param imagesPath
       
    37 	 */
       
    38 	public static void loadImages(String imagesPath){
       
    39 		
       
    40     	Display disp = Display.getCurrent();
       
    41     	
       
    42     	ImageRegistry imgReg = JFaceResources.getImageRegistry();
       
    43     	
       
    44     	//
       
    45     	// Storing images to image registry
       
    46     	//    	
       
    47     	Image img = new Image( disp, imagesPath + "\\memspy_16.png" );
       
    48         imgReg.put( ImageKeys.IMG_APP_ICON, img );
       
    49 
       
    50         img = new Image( disp, imagesPath + "\\Launch_SWMT.png" );
       
    51         imgReg.put( ImageKeys.IMG_LAUNCH_SWMT, img );
       
    52 
       
    53         img = new Image( disp, imagesPath + "\\Export_To_html.png" );
       
    54         imgReg.put( ImageKeys.IMG_EXPORT_TO_HTML, img );
       
    55 
       
    56         img = new Image( disp, imagesPath + "\\Compare_2_Heaps.png" ); 
       
    57         imgReg.put( ImageKeys.IMG_COMPARE_2_HEAP, img );
       
    58 
       
    59         img = new Image( disp, imagesPath + "\\Analyse_Heap.png" );
       
    60         imgReg.put( ImageKeys.IMG_ANALYZE_HEAP, img );
       
    61 
       
    62         img = new Image( disp, imagesPath + "\\Launch_SWMT.png" );
       
    63         imgReg.put( ImageKeys.IMG_SWMT_LOG, img );
       
    64         
       
    65         img = new Image( disp, imagesPath + "\\Analyse_Heap.png" );
       
    66         imgReg.put( ImageKeys.IMG_HEAP_DUMP, img );
       
    67 
       
    68         img = new Image( disp, imagesPath + "\\Memspy_45.png" );
       
    69         imgReg.put( ImageKeys.IMG_WIZARD, img );
       
    70 
       
    71 	}
       
    72 	
       
    73 	public static ImageDescriptor getImageDescriptor( String key ){
       
    74     	ImageRegistry imgReg = JFaceResources.getImageRegistry();
       
    75     	return  imgReg.getDescriptor( key );		
       
    76 	}	
       
    77 
       
    78 	public static Image getImage( String key ){
       
    79     	ImageRegistry imgReg = JFaceResources.getImageRegistry();    	
       
    80     	return  imgReg.get(key);		
       
    81 	}	
       
    82 }