Search in sources :

Example 86 with TreeColumn

use of org.eclipse.swt.widgets.TreeColumn in project pmd-eclipse-plugin by pmd.

the class SimpleColumnDescriptor method newTreeColumnFor.

/*
     * (non-Javadoc)
     * 
     * @see net.sourceforge.pmd.eclipse.ui.preferences.br.IRuleColumnDescriptor#
     * newTreeColumnFor(org.eclipse.swt.widgets.Tree, int,
     * net.sourceforge.pmd.eclipse.ui.preferences.br.RuleSortListener,
     * java.util.Map)
     */
public TreeColumn newTreeColumnFor(Tree parent, int columnIndex, SortListener sortListener, Map<Integer, List<Listener>> paintListeners) {
    TreeColumn tc = buildTreeColumn(parent, sortListener);
    tc.setText(label());
    return tc;
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn)

Example 87 with TreeColumn

use of org.eclipse.swt.widgets.TreeColumn in project pmd-eclipse-plugin by pmd.

the class AbstractColumnDescriptor method buildTreeColumn.

protected TreeColumn buildTreeColumn(Tree parent) {
    TreeColumn tc = new TreeColumn(parent, alignment);
    loadCommon(tc);
    tc.setWidth(width);
    tc.setResizable(isResizable);
    tc.setToolTipText(tooltip);
    return tc;
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn)

Example 88 with TreeColumn

use of org.eclipse.swt.widgets.TreeColumn in project pmd-eclipse-plugin by pmd.

the class ViolationOverview method getViewerSorter.

/**
 * Return the ViewerSorter for a Column
 *
 * @param column,
 *            the Number of the Column in the Table
 * @return the ViewerSorter for the column
 */
private ViewerSorter getViewerSorter(int columnNr) {
    final TreeColumn column = this.treeViewer.getTree().getColumn(columnNr);
    final int sortOrder = this.columnSortOrder[columnNr];
    ViewerSorter viewerSorter;
    switch(columnNr) {
        // sorts by Number of Violations
        case 1:
            viewerSorter = newViolationsCountSorter(column, sortOrder);
            break;
        // sorts by Violations per LOC
        case 2:
            viewerSorter = newViolationsPerLOCSorter(column, sortOrder);
            break;
        // sorts by Violations per Number of Methods
        case 3:
            viewerSorter = newViolationsPerMethodsCount(column, sortOrder);
            break;
        // sorts by Name of Project
        case 4:
            viewerSorter = newProjectNameSorter(column, sortOrder);
            break;
        // sorts the Packages and Files by Name
        case 0:
        default:
            viewerSorter = newPackagesSorter(column, sortOrder);
            break;
    }
    return viewerSorter;
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn) ViewerSorter(org.eclipse.jface.viewers.ViewerSorter)

Example 89 with TreeColumn

use of org.eclipse.swt.widgets.TreeColumn in project pmd-eclipse-plugin by pmd.

the class CPDView2 method createColumns.

/**
 * Creates the columns of the tree.
 *
 * @param tree
 *            Tree from the treeViewer
 */
private void createColumns(Tree tree) {
    // the "+"-sign for expanding packages
    TreeColumn plusColumn = new TreeColumn(tree, SWT.RIGHT);
    plusColumn.setText("Spans");
    plusColumn.setWidth(SPAN_COLUMN_WIDTH);
    // plusColumn.setResizable(false);
    // shows the source
    messageColumn = new TreeColumn(tree, SWT.LEFT);
    messageColumn.addListener(SWT.Move, measureListener);
    messageColumn.setText("Source");
    messageColumn.setWidth(500);
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn)

Example 90 with TreeColumn

use of org.eclipse.swt.widgets.TreeColumn in project bndtools by bndtools.

the class BundleTree method createBundleTreeViewer.

private void createBundleTreeViewer(Composite container) {
    bundleTreeViewerComposite = new Composite(container, SWT.NONE);
    bundleTreeViewerComposite.setLayoutData(createFillGridData());
    TreeColumnLayout layout = new TreeColumnLayout();
    bundleTreeViewerComposite.setLayout(layout);
    bundleTreeViewer = new TreeViewer(bundleTreeViewerComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
    bundleTreeViewer.setUseHashlookup(true);
    bundleTreeViewer.getTree().setHeaderVisible(true);
    TreeViewerColumn treeViewerColumn = new TreeViewerColumn(bundleTreeViewer, SWT.NONE);
    TreeColumn treeColumn = treeViewerColumn.getColumn();
    layout.setColumnData(treeColumn, new ColumnWeightData(100, 340, true));
    treeColumn.setText(Messages.symbNameResources);
    treeViewerColumn.setLabelProvider(new TreeLabelProvider());
    bundleTreeViewer.setContentProvider(bundleTreeViewerProvider);
    bundleTreeViewer.setAutoExpandLevel(3);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Composite(org.eclipse.swt.widgets.Composite) TreeColumnLayout(org.eclipse.jface.layout.TreeColumnLayout) TreeViewer(org.eclipse.jface.viewers.TreeViewer) TreeColumn(org.eclipse.swt.widgets.TreeColumn) TreeViewerColumn(org.eclipse.jface.viewers.TreeViewerColumn)

Aggregations

TreeColumn (org.eclipse.swt.widgets.TreeColumn)189 Tree (org.eclipse.swt.widgets.Tree)99 TreeViewer (org.eclipse.jface.viewers.TreeViewer)55 Composite (org.eclipse.swt.widgets.Composite)52 TreeItem (org.eclipse.swt.widgets.TreeItem)45 FillLayout (org.eclipse.swt.layout.FillLayout)40 Point (org.eclipse.swt.graphics.Point)39 ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)28 Viewer (org.eclipse.jface.viewers.Viewer)28 GridData (org.eclipse.swt.layout.GridData)28 ControlEvent (org.eclipse.swt.events.ControlEvent)27 ControlAdapter (org.eclipse.swt.events.ControlAdapter)25 SelectionEvent (org.eclipse.swt.events.SelectionEvent)25 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)24 TableColumn (org.eclipse.swt.widgets.TableColumn)24 TableLayout (org.eclipse.jface.viewers.TableLayout)23 Table (org.eclipse.swt.widgets.Table)23 GridLayout (org.eclipse.swt.layout.GridLayout)22 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)21 ViewerPane (org.eclipse.emf.common.ui.ViewerPane)19