|
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 |
|
20 package com.nokia.s60tools.traceanalyser.ui.views; |
|
21 |
|
22 import org.eclipse.jface.viewers.ITableLabelProvider; |
|
23 import org.eclipse.jface.viewers.LabelProvider; |
|
24 import org.eclipse.swt.graphics.Image; |
|
25 import org.eclipse.ui.ISharedImages; |
|
26 import org.eclipse.ui.PlatformUI; |
|
27 |
|
28 import com.nokia.s60tools.traceanalyser.containers.RuleInformation; |
|
29 |
|
30 /** |
|
31 * class RuleTableLabelProvider |
|
32 * label provider for rule table. |
|
33 * |
|
34 */ |
|
35 |
|
36 class RuleTableLabelProvider extends LabelProvider implements ITableLabelProvider { |
|
37 |
|
38 /* |
|
39 * (non-Javadoc) |
|
40 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) |
|
41 */ |
|
42 public String getColumnText(Object obj, int index) { |
|
43 RuleInformation rule = (RuleInformation)obj; |
|
44 return rule.getText(index); |
|
45 |
|
46 |
|
47 } |
|
48 /* |
|
49 * (non-Javadoc) |
|
50 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) |
|
51 */ |
|
52 public Image getColumnImage(Object obj, int index) { |
|
53 /*if (index == MemSpyFileBundle.INDEX_FILE_TYPE){ |
|
54 return getImage(obj); |
|
55 } |
|
56 else{ |
|
57 return null; |
|
58 }*/ |
|
59 return null; |
|
60 |
|
61 } |
|
62 |
|
63 |
|
64 /* |
|
65 * (non-Javadoc) |
|
66 * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) |
|
67 */ |
|
68 |
|
69 public Image getImage(Object obj) { |
|
70 /*MemSpyFileBundle bundle = (MemSpyFileBundle)obj; |
|
71 if( bundle.isHeapDumpFile() ){ |
|
72 return ImageResourceManager.getImage(ImageKeys.IMG_HEAP_DUMP); |
|
73 } |
|
74 else{ |
|
75 return ImageResourceManager.getImage(ImageKeys.IMG_SWMT_LOG); |
|
76 }*/ |
|
77 return PlatformUI.getWorkbench(). |
|
78 getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT); |
|
79 } |
|
80 } |