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;
}
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;
}
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;
}
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);
}
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);
}
Aggregations