98a5ee67bae56add8493f94fe84ae4de2d9be505
[public/netxms.git] / src / java / netxms-eclipse / PerfView / src / org / netxms / ui / eclipse / perfview / views / helpers / HistoricalDataLabelProvider.java
1 /**
2 * NetXMS - open source network management system
3 * Copyright (C) 2003-2012 Victor Kirhenshtein
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 package org.netxms.ui.eclipse.perfview.views.helpers;
20
21 import org.eclipse.jface.viewers.ITableLabelProvider;
22 import org.eclipse.jface.viewers.LabelProvider;
23 import org.eclipse.swt.graphics.Image;
24 import org.netxms.client.datacollection.DciDataRow;
25 import org.netxms.ui.eclipse.console.resources.RegionalSettings;
26
27 /**
28 * Label provider for historical data view
29 */
30 public class HistoricalDataLabelProvider extends LabelProvider implements ITableLabelProvider
31 {
32 /* (non-Javadoc)
33 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
34 */
35 @Override
36 public Image getColumnImage(Object element, int columnIndex)
37 {
38 return null;
39 }
40
41 /* (non-Javadoc)
42 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
43 */
44 @Override
45 public String getColumnText(Object element, int columnIndex)
46 {
47 switch(columnIndex)
48 {
49 case 0:
50 return RegionalSettings.getDateTimeFormat().format(((DciDataRow)element).getTimestamp());
51 case 1:
52 return ((DciDataRow)element).getValueAsString();
53 }
54 return null;
55 }
56 }