use of org.eclipse.swt.widgets.TreeColumn in project tdi-studio-se by Talend.
the class NotificationFilteredTree method configureTree.
/**
* Configure the tree adding columns.
*/
private void configureTree() {
Tree tree = getViewer().getTree();
for (TreeColumn column : tree.getColumns()) {
column.dispose();
}
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
for (Entry<String, Boolean> entry : columns.entrySet()) {
NotificationColumn column = NotificationColumn.getColumn(entry.getKey());
if (!columns.get(column.label)) {
continue;
}
TreeColumn treeColumn = new TreeColumn(getViewer().getTree(), SWT.NONE);
treeColumn.setText(column.label);
treeColumn.setWidth(column.defalutWidth);
treeColumn.setAlignment(column.initialAlignment);
treeColumn.setToolTipText(column.toolTip);
treeColumn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (e.widget instanceof TreeColumn) {
sortColumn((TreeColumn) e.widget);
}
}
});
}
}
use of org.eclipse.swt.widgets.TreeColumn in project tdi-studio-se by Talend.
the class HotSpotsFilteredTree method configureTree.
/*
* @see AbstractFilteredTree#configureTree()
*/
@Override
protected void configureTree() {
for (TreeColumn column : getViewer().getTree().getColumns()) {
column.dispose();
}
getViewer().getTree().setLinesVisible(true);
getViewer().getTree().setHeaderVisible(true);
for (Entry<String, Boolean> entry : columns.entrySet()) {
HotSpotsColumn column = getColumn(entry.getKey());
String label = (column == HotSpotsColumn.HOT_SPOT) ? getMethodColumnName() : column.label;
String toolTip = (column == HotSpotsColumn.HOT_SPOT) ? getMethodColumnToolTip() : column.toolTip;
if (!columns.get(label)) {
continue;
}
TreeColumn treeColumn = new TreeColumn(getViewer().getTree(), SWT.NONE);
treeColumn.setText(label);
treeColumn.setWidth(column.defalutWidth);
treeColumn.setAlignment(column.alignment);
treeColumn.setToolTipText(toolTip);
treeColumn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (e.widget instanceof TreeColumn) {
sortColumn((TreeColumn) e.widget);
}
}
});
}
}
use of org.eclipse.swt.widgets.TreeColumn in project tdi-studio-se by Talend.
the class HeapHistogramPage method configureTree.
/**
* Configure the tree adding columns.
*/
private void configureTree() {
Tree tree = heapViewer.getTree();
if (tree.isDisposed()) {
return;
}
for (TreeColumn column : tree.getColumns()) {
column.dispose();
}
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
for (Entry<String, Boolean> entry : columns.entrySet()) {
HeapColumn column = HeapColumn.getColumn(entry.getKey());
if (!columns.get(column.label)) {
continue;
}
TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
treeColumn.setText(column.label);
treeColumn.setWidth(column.defalutWidth);
treeColumn.setAlignment(column.alignment);
treeColumn.setToolTipText(column.toolTip);
treeColumn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (e.widget instanceof TreeColumn) {
sortColumn((TreeColumn) e.widget);
}
}
});
}
}
use of org.eclipse.swt.widgets.TreeColumn in project tdi-studio-se by Talend.
the class UIManager method changeSchemasDetailView.
public void changeSchemasDetailView(final TreeViewer schemaDetailsViewer, boolean model) {
if (schemaDetailsViewer == null || schemaDetailsViewer.getTree().isDisposed()) {
return;
}
final Tree tree = schemaDetailsViewer.getTree();
// removed all columns
final TreeColumn[] columns = tree.getColumns();
for (TreeColumn col : columns) {
col.dispose();
}
if (columnTreeEditor != null) {
columnTreeEditor.dispose();
final Control editor = columnTreeEditor.getEditor();
if (editor != null && !editor.isDisposed()) {
editor.setVisible(false);
editor.dispose();
}
columnTreeEditor = null;
}
if (columnMouseListener != null) {
tree.removeMouseListener(columnMouseListener);
columnMouseListener = null;
}
}
use of org.eclipse.swt.widgets.TreeColumn in project tdi-studio-se by Talend.
the class UpdateDetectionDialog method createColumns.
/**
* create table columns.
*/
private void createColumns(final Tree tree) {
TreeColumn column = new TreeColumn(tree, SWT.NONE);
column.setText(ITEMS);
column.setWidth(SIZING_COLUMN_WIDTH * 10);
tree.setSortColumn(column);
if (isOnlySimpleShow()) {
column.setWidth(SIZING_COLUMN_WIDTH * 20);
} else {
column = new TreeColumn(tree, SWT.NONE);
column.setText(OPERATIONS);
column.setWidth(SIZING_COLUMN_WIDTH * 7);
column = new TreeColumn(tree, SWT.NONE);
column.setText(REMARKS);
column.setWidth(SIZING_COLUMN_WIDTH * 6);
}
}
Aggregations