Search in sources :

Example 1 with StatsNameSorter

use of org.erlide.cover.ui.views.helpers.StatsNameSorter in project erlide_eclipse by erlang.

the class CoverStatsView method createPartControl.

/**
 * This is a callback that will allow us to create the viewer and initialize
 * it.
 */
@Override
public void createPartControl(final Composite parent) {
    // layout
    final GridLayout containerLayout = new GridLayout(1, false);
    containerLayout.marginWidth = 0;
    containerLayout.marginHeight = 0;
    containerLayout.verticalSpacing = 3;
    parent.setLayout(containerLayout);
    viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
    drillDownAdapter = new DrillDownAdapter(viewer);
    viewer.setContentProvider(new StatsViewContentProvider(getViewSite()));
    viewer.setLabelProvider(new StatsViewLabelProvider());
    viewer.setComparator(new StatsNameSorter());
    viewer.setInput(getViewSite());
    viewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    viewer.addSelectionChangedListener(viewerSelectionChanged);
    createTableTree();
    viewer.setInput(StatsTreeModel.getInstance());
    // Create the help context id for the viewer's control
    PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.erlide.eunit.core.viewer");
    makeActions();
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();
}
Also used : DrillDownAdapter(org.eclipse.ui.part.DrillDownAdapter) StatsViewLabelProvider(org.erlide.cover.ui.views.helpers.StatsViewLabelProvider) GridLayout(org.eclipse.swt.layout.GridLayout) TreeViewer(org.eclipse.jface.viewers.TreeViewer) GridData(org.eclipse.swt.layout.GridData) StatsViewContentProvider(org.erlide.cover.ui.views.helpers.StatsViewContentProvider) StatsNameSorter(org.erlide.cover.ui.views.helpers.StatsNameSorter)

Aggregations

TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 DrillDownAdapter (org.eclipse.ui.part.DrillDownAdapter)1 StatsNameSorter (org.erlide.cover.ui.views.helpers.StatsNameSorter)1 StatsViewContentProvider (org.erlide.cover.ui.views.helpers.StatsViewContentProvider)1 StatsViewLabelProvider (org.erlide.cover.ui.views.helpers.StatsViewLabelProvider)1