\r
import org.eclipse.jface.viewers.TableViewer;\r
import org.eclipse.jface.viewers.TableViewerColumn;\r
+import org.eclipse.jface.viewers.TreeViewer;\r
+import org.eclipse.jface.viewers.TreeViewerColumn;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.events.SelectionAdapter;\r
import org.eclipse.swt.events.SelectionEvent;\r
import org.eclipse.swt.widgets.TableColumn;\r
+import org.eclipse.swt.widgets.TreeColumn;\r
\r
public class TableUtils {\r
public static TableViewerColumn addColumn(final TableViewer viewer, String text, boolean resize, boolean sort, int width) {\r
}\r
return twc;\r
}\r
+ \r
+ public static TreeViewerColumn addColumn(final TreeViewer viewer, String text, boolean resize, int width) {\r
+ final TreeViewerColumn tvc = new TreeViewerColumn(viewer, SWT.NONE);\r
+ TreeColumn tc = tvc.getColumn();\r
+ tc.setResizable(resize);\r
+ tc.setText(text);\r
+ tc.setWidth(width);\r
+ return tvc;\r
+ }\r
}\r