]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/utils/ViewerUtils.java
18f77f382d47bef61572488b7de06e23bb3faa25
1 package org
.argeo
.slc
.client
.ui
.dist
.utils
;
3 import org
.eclipse
.jface
.viewers
.TableViewer
;
4 import org
.eclipse
.jface
.viewers
.TableViewerColumn
;
5 import org
.eclipse
.jface
.viewers
.TreeViewer
;
6 import org
.eclipse
.jface
.viewers
.TreeViewerColumn
;
7 import org
.eclipse
.swt
.widgets
.Table
;
8 import org
.eclipse
.swt
.widgets
.TableColumn
;
9 import org
.eclipse
.swt
.widgets
.TreeColumn
;
12 * Centralizes useful methods to manage table to display nodes list.
14 public class ViewerUtils
{
17 * Creates a basic column for the given table. For the time being, we do not
18 * support moveable columns.
20 public static TableColumn
createColumn(Table parent
, String name
,
21 int style
, int width
) {
22 TableColumn result
= new TableColumn(parent
, style
);
24 result
.setWidth(width
);
25 result
.setResizable(true);
30 * Creates a TableViewerColumn for the given viewer. For the time being, we
31 * do not support moveable columns.
33 public static TableViewerColumn
createTableViewerColumn(TableViewer parent
,
34 String name
, int style
, int width
) {
35 TableViewerColumn tvc
= new TableViewerColumn(parent
, style
);
36 final TableColumn column
= tvc
.getColumn();
38 column
.setWidth(width
);
39 column
.setResizable(true);
44 * Creates a TreeViewerColumn for the given viewer. For the time being, we
45 * do not support moveable columns.
47 public static TreeViewerColumn
createTreeViewerColumn(TreeViewer parent
,
48 String name
, int style
, int width
) {
49 TreeViewerColumn tvc
= new TreeViewerColumn(parent
, style
);
50 final TreeColumn column
= tvc
.getColumn();
52 column
.setWidth(width
);
53 column
.setResizable(true);