0
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 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.appdep.ui.views.listview;
|
|
20 |
|
|
21 |
import org.eclipse.jface.viewers.ITableLabelProvider;
|
|
22 |
import org.eclipse.jface.viewers.LabelProvider;
|
|
23 |
import org.eclipse.swt.graphics.Image;
|
|
24 |
|
|
25 |
import com.nokia.s60tools.appdep.core.model.ComponentPropertiesData;
|
|
26 |
import com.nokia.s60tools.appdep.resources.Messages;
|
|
27 |
import com.nokia.s60tools.appdep.util.AppDepConsole;
|
|
28 |
import com.nokia.s60tools.util.console.IConsolePrintUtility;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Label provider for Import Functions tab item.
|
|
32 |
*/
|
|
33 |
class ListViewLabelProvider extends LabelProvider
|
|
34 |
implements ITableLabelProvider {
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Constructor
|
|
38 |
*/
|
|
39 |
public ListViewLabelProvider() {
|
|
40 |
super();
|
|
41 |
}
|
|
42 |
|
|
43 |
/* (non-Javadoc)
|
|
44 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
|
|
45 |
*/
|
|
46 |
public Image getColumnImage(Object element, int columnIndex) {
|
|
47 |
|
|
48 |
// Currently no images is used
|
|
49 |
Image img = null;
|
|
50 |
|
|
51 |
switch (columnIndex) {
|
|
52 |
|
|
53 |
case ComponentPropertiesData.NAME_COLUMN_INDEX:
|
|
54 |
case ComponentPropertiesData.BIN_FORMAT_COLUMN_INDEX:
|
|
55 |
case ComponentPropertiesData.UID1_COLUMN_INDEX:
|
|
56 |
case ComponentPropertiesData.UID2_COLUMN_INDEX:
|
|
57 |
case ComponentPropertiesData.UID3_COLUMN_INDEX:
|
|
58 |
case ComponentPropertiesData.SECURE_ID_COLUMN_INDEX:
|
|
59 |
case ComponentPropertiesData.VENDOR_ID_COLUMN_INDEX:
|
|
60 |
case ComponentPropertiesData.MIN_HEAP_COLUMN_INDEX:
|
|
61 |
case ComponentPropertiesData.MAX_HEAP_COLUMN_INDEX:
|
|
62 |
case ComponentPropertiesData.STACK_SIZE_COLUMN_INDEX:
|
|
63 |
break;
|
|
64 |
|
|
65 |
default:
|
|
66 |
AppDepConsole.getInstance().println(Messages.getString("GeneralMessages.Unexpected_Column_Index_ErrMsg"), IConsolePrintUtility.MSG_ERROR); //$NON-NLS-1$
|
|
67 |
break;
|
|
68 |
}
|
|
69 |
|
|
70 |
return img;
|
|
71 |
}
|
|
72 |
|
|
73 |
/* (non-Javadoc)
|
|
74 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
|
|
75 |
*/
|
|
76 |
public String getColumnText(Object element, int columnIndex) {
|
|
77 |
|
|
78 |
String label = element.toString();
|
|
79 |
|
|
80 |
ComponentPropertiesData propData = (ComponentPropertiesData) element;
|
|
81 |
|
|
82 |
switch (columnIndex) {
|
|
83 |
|
|
84 |
case ComponentPropertiesData.NAME_COLUMN_INDEX:
|
|
85 |
label = propData.getFilename();
|
|
86 |
break;
|
|
87 |
|
|
88 |
case ComponentPropertiesData.BIN_FORMAT_COLUMN_INDEX:
|
|
89 |
label = propData.getBinaryFormat();
|
|
90 |
break;
|
|
91 |
|
|
92 |
case ComponentPropertiesData.UID1_COLUMN_INDEX:
|
|
93 |
label = propData.getUid1();
|
|
94 |
break;
|
|
95 |
|
|
96 |
case ComponentPropertiesData.UID2_COLUMN_INDEX:
|
|
97 |
label = propData.getUid2();
|
|
98 |
break;
|
|
99 |
|
|
100 |
case ComponentPropertiesData.UID3_COLUMN_INDEX:
|
|
101 |
label = propData.getUid3();
|
|
102 |
break;
|
|
103 |
|
|
104 |
case ComponentPropertiesData.SECURE_ID_COLUMN_INDEX:
|
|
105 |
label = propData.getSecureId();
|
|
106 |
break;
|
|
107 |
|
|
108 |
case ComponentPropertiesData.VENDOR_ID_COLUMN_INDEX:
|
|
109 |
label = propData.getVendorId();
|
|
110 |
break;
|
|
111 |
|
|
112 |
case ComponentPropertiesData.MIN_HEAP_COLUMN_INDEX:
|
|
113 |
label = propData.getMinHeapSize();
|
|
114 |
break;
|
|
115 |
|
|
116 |
case ComponentPropertiesData.MAX_HEAP_COLUMN_INDEX:
|
|
117 |
label = propData.getMaxHeapSize();
|
|
118 |
break;
|
|
119 |
|
|
120 |
case ComponentPropertiesData.STACK_SIZE_COLUMN_INDEX:
|
|
121 |
label = propData.getStackSize();
|
|
122 |
break;
|
|
123 |
|
|
124 |
default:
|
|
125 |
AppDepConsole.getInstance().println(Messages.getString("GeneralMessages.Unexpected_Column_Index_ErrMsg"), IConsolePrintUtility.MSG_ERROR); //$NON-NLS-1$
|
|
126 |
break;
|
|
127 |
}
|
|
128 |
|
|
129 |
return label;
|
|
130 |
}
|
|
131 |
|
|
132 |
}
|