From: luukkainen Date: Thu, 22 Sep 2011 14:58:09 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@22380... X-Git-Tag: v1.31.0~111 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e3c798bead3fe4882b2181b5c04b2dad06f1d71b;p=simantics%2Finterop.git git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@22380 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.interop/src/org/simantics/interop/utils/TableUtils.java b/org.simantics.interop/src/org/simantics/interop/utils/TableUtils.java index f373bc2..debe732 100644 --- a/org.simantics.interop/src/org/simantics/interop/utils/TableUtils.java +++ b/org.simantics.interop/src/org/simantics/interop/utils/TableUtils.java @@ -2,10 +2,13 @@ package org.simantics.interop.utils; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.TreeViewerColumn; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TreeColumn; public class TableUtils { public static TableViewerColumn addColumn(final TableViewer viewer, String text, boolean resize, boolean sort, int width) { @@ -48,4 +51,13 @@ public class TableUtils { } return twc; } + + public static TreeViewerColumn addColumn(final TreeViewer viewer, String text, boolean resize, int width) { + final TreeViewerColumn tvc = new TreeViewerColumn(viewer, SWT.NONE); + TreeColumn tc = tvc.getColumn(); + tc.setResizable(resize); + tc.setText(text); + tc.setWidth(width); + return tvc; + } }