|
1 /* |
|
2 * ============================================================================ |
|
3 * Revision : $Rev:$ |
|
4 * |
|
5 * Copyright © 2009 Nokia. All rights reserved. |
|
6 * This material, including documentation and any related computer |
|
7 * programs, is protected by copyright controlled by Nokia. All |
|
8 * rights are reserved. Copying, including reproducing, storing, |
|
9 * adapting or translating, any or all of this material requires the |
|
10 * prior written consent of Nokia. This material also contains |
|
11 * confidential information which may not be disclosed to others |
|
12 * without the prior written consent of Nokia. |
|
13 ============================================================================ |
|
14 */ |
|
15 |
|
16 package com.nokia.s60tools.traceanalyser.resources; |
|
17 |
|
18 import org.eclipse.jface.resource.ImageDescriptor; |
|
19 import org.eclipse.jface.resource.ImageRegistry; |
|
20 import org.eclipse.jface.resource.JFaceResources; |
|
21 import org.eclipse.swt.graphics.Image; |
|
22 import org.eclipse.swt.widgets.Display; |
|
23 |
|
24 |
|
25 /** |
|
26 * Class for handling Trace Analyser icons. |
|
27 * |
|
28 */ |
|
29 public class ImageResourceManager { |
|
30 |
|
31 public static void loadImages(String imagesPath){ |
|
32 |
|
33 Display disp = Display.getCurrent(); |
|
34 |
|
35 ImageRegistry imgReg = JFaceResources.getImageRegistry(); |
|
36 |
|
37 // |
|
38 // Storing images to image registry |
|
39 // |
|
40 |
|
41 /******************************************************************************* |
|
42 * Copyright for the following group of images. |
|
43 * Copyright ©2009 Nokia Corporation. All rights reserved. |
|
44 *******************************************************************************/ |
|
45 Image img = new Image( disp, imagesPath + "\\TraceAnalyser.png" ); |
|
46 imgReg.put( ImageKeys.IMG_APP_ICON, img ); |
|
47 |
|
48 img = new Image( disp, imagesPath + "\\ClearAllCounters.png" ); |
|
49 imgReg.put( ImageKeys.IMG_CLEAR_ALL, img ); |
|
50 |
|
51 img = new Image( disp, imagesPath + "\\CreateNewRule.png" ); |
|
52 imgReg.put( ImageKeys.IMG_CREATE_NEW, img ); |
|
53 |
|
54 img = new Image( disp, imagesPath + "\\FailReceived.png" ); |
|
55 imgReg.put( ImageKeys.IMG_FAIL_RECEIVED, img ); |
|
56 |
|
57 img = new Image( disp, imagesPath + "\\ClearFailLog.png" ); |
|
58 imgReg.put( ImageKeys.IMG_CLEAR_FAIL_LOG, img ); |
|
59 |
|
60 img = new Image( disp, imagesPath + "\\TraceAnalyser_banner.png" ); |
|
61 imgReg.put( ImageKeys.IMG_TRACE_ANALYSER_BANNER, img ); |
|
62 |
|
63 } |
|
64 |
|
65 public static ImageDescriptor getImageDescriptor( String key ){ |
|
66 ImageRegistry imgReg = JFaceResources.getImageRegistry(); |
|
67 return imgReg.getDescriptor( key ); |
|
68 } |
|
69 |
|
70 public static Image getImage( String key ){ |
|
71 ImageRegistry imgReg = JFaceResources.getImageRegistry(); |
|
72 return imgReg.get(key); |
|
73 } |
|
74 } |