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.main;
|
|
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.ui.views.data.PropertyData;
|
|
28 |
import com.nokia.s60tools.appdep.util.AppDepConsole;
|
|
29 |
import com.nokia.s60tools.util.console.IConsolePrintUtility;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Label provider class for Component Properties
|
|
33 |
* tab item.
|
|
34 |
*/
|
|
35 |
class MainViewComponentPropertiesTabLabelProvider extends LabelProvider
|
|
36 |
implements ITableLabelProvider {
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Constructor.
|
|
40 |
*/
|
|
41 |
public MainViewComponentPropertiesTabLabelProvider() {
|
|
42 |
super();
|
|
43 |
}
|
|
44 |
|
|
45 |
/* (non-Javadoc)
|
|
46 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
|
|
47 |
*/
|
|
48 |
public Image getColumnImage(Object element, int columnIndex) {
|
|
49 |
// Property view does not use images
|
|
50 |
return null;
|
|
51 |
}
|
|
52 |
|
|
53 |
/* (non-Javadoc)
|
|
54 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
|
|
55 |
*/
|
|
56 |
public String getColumnText(Object element, int columnIndex) {
|
|
57 |
|
|
58 |
String label = element.toString();
|
|
59 |
|
|
60 |
PropertyData propData = (PropertyData) element;
|
|
61 |
|
|
62 |
switch (columnIndex) {
|
|
63 |
|
|
64 |
case ComponentPropertiesData.PROPERTY_COLUMN_INDEX:
|
|
65 |
label = propData.getPropertyDescription();
|
|
66 |
break;
|
|
67 |
|
|
68 |
case ComponentPropertiesData.VALUE_COLUMN_INDEX:
|
|
69 |
label = propData.getPropertyValue();
|
|
70 |
break;
|
|
71 |
|
|
72 |
default:
|
|
73 |
AppDepConsole.getInstance().println(Messages.getString("GeneralMessages.Unexpected_Column_Index_ErrMsg"), IConsolePrintUtility.MSG_ERROR); //$NON-NLS-1$
|
|
74 |
break;
|
|
75 |
}
|
|
76 |
|
|
77 |
return label;
|
|
78 |
}
|
|
79 |
|
|
80 |
}
|