Search in sources :

Example 1 with OverviewDciLabelProvider

use of org.netxms.ui.eclipse.objectview.objecttabs.helpers.OverviewDciLabelProvider in project netxms by netxms.

the class LastValues method createClientArea.

/* (non-Javadoc)
    * @see org.netxms.ui.eclipse.objectview.objecttabs.elements.OverviewPageElement#createClientArea(org.eclipse.swt.widgets.Composite)
    */
@Override
protected Control createClientArea(Composite parent) {
    viewer = new TableViewer(parent, SWT.FULL_SELECTION | SWT.HIDE_SELECTION | SWT.H_SCROLL | SWT.MULTI);
    setupTable();
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new OverviewDciLabelProvider());
    viewer.setComparator(new ViewerComparator() {

        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
            return ((DciValue) e1).getDescription().compareToIgnoreCase(((DciValue) e2).getDescription());
        }
    });
    viewer.setInput(((DataCollectionTarget) getObject()).getOverviewDciData().toArray());
    viewer.getTable().getColumn(0).pack();
    viewer.getTable().getColumn(1).pack();
    createPopupMenu();
    refreshController.setInterval(30);
    refresh();
    return viewer.getTable();
}
Also used : OverviewDciLabelProvider(org.netxms.ui.eclipse.objectview.objecttabs.helpers.OverviewDciLabelProvider) ViewerComparator(org.eclipse.jface.viewers.ViewerComparator) DataCollectionTarget(org.netxms.client.objects.DataCollectionTarget) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) DciValue(org.netxms.client.datacollection.DciValue) TableViewer(org.eclipse.jface.viewers.TableViewer) Viewer(org.eclipse.jface.viewers.Viewer) AbstractObject(org.netxms.client.objects.AbstractObject) TableViewer(org.eclipse.jface.viewers.TableViewer)

Aggregations

ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerComparator (org.eclipse.jface.viewers.ViewerComparator)1 DciValue (org.netxms.client.datacollection.DciValue)1 AbstractObject (org.netxms.client.objects.AbstractObject)1 DataCollectionTarget (org.netxms.client.objects.DataCollectionTarget)1 OverviewDciLabelProvider (org.netxms.ui.eclipse.objectview.objecttabs.helpers.OverviewDciLabelProvider)1