Search in sources :

Example 1 with ClusterResourceListComparator

use of org.netxms.ui.eclipse.networkmaps.objecttabs.helpers.ClusterResourceListComparator in project netxms by netxms.

the class ClusterTab method createTabContent.

/* (non-Javadoc)
	 * @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#createTabContent(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected void createTabContent(Composite parent) {
    final Composite content = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    content.setLayout(layout);
    clusterMap = new NetworkMapWidget(content, null, SWT.NONE);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    clusterMap.setLayoutData(gd);
    clusterMap.setMapLayout(MapLayoutAlgorithm.VTREE);
    final String[] names = { Messages.get().ClusterTab_Resource, Messages.get().ClusterTab_VirtualIP, Messages.get().ClusterTab_Owner };
    final int[] widths = { 200, 120, 150 };
    resourceList = new SortableTableViewer(content, names, widths, COLUMN_NAME, SWT.UP, SortableTableViewer.DEFAULT_STYLE);
    resourceList.setContentProvider(new ArrayContentProvider());
    resourceList.setLabelProvider(new ClusterResourceListLabelProvider());
    resourceList.setComparator(new ClusterResourceListComparator());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = false;
    resourceList.getControl().setLayoutData(gd);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ClusterResourceListLabelProvider(org.netxms.ui.eclipse.networkmaps.objecttabs.helpers.ClusterResourceListLabelProvider) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SortableTableViewer(org.netxms.ui.eclipse.widgets.SortableTableViewer) ClusterResourceListComparator(org.netxms.ui.eclipse.networkmaps.objecttabs.helpers.ClusterResourceListComparator) NetworkMapWidget(org.netxms.ui.eclipse.networkmaps.widgets.NetworkMapWidget)

Aggregations

ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 ClusterResourceListComparator (org.netxms.ui.eclipse.networkmaps.objecttabs.helpers.ClusterResourceListComparator)1 ClusterResourceListLabelProvider (org.netxms.ui.eclipse.networkmaps.objecttabs.helpers.ClusterResourceListLabelProvider)1 NetworkMapWidget (org.netxms.ui.eclipse.networkmaps.widgets.NetworkMapWidget)1 SortableTableViewer (org.netxms.ui.eclipse.widgets.SortableTableViewer)1