1 11 12 package org.eclipse.jface.viewers; 13 14 import org.eclipse.swt.widgets.Tree; 15 import org.eclipse.swt.widgets.TreeColumn; 16 17 24 public final class TreeViewerColumn extends ViewerColumn { 25 private TreeColumn column; 26 27 39 public TreeViewerColumn(TreeViewer viewer, int style) { 40 this(viewer, style, -1); 41 } 42 43 57 public TreeViewerColumn(TreeViewer viewer, int style, int index) { 58 this(viewer, createColumn(viewer.getTree(), style, index)); 59 } 60 61 70 public TreeViewerColumn(TreeViewer viewer, TreeColumn column) { 71 super(viewer, column); 72 this.column = column; 73 } 74 75 private static TreeColumn createColumn(Tree table, int style, int index) { 76 if (index >= 0) { 77 return new TreeColumn(table, style, index); 78 } 79 80 return new TreeColumn(table, style); 81 } 82 83 86 public TreeColumn getColumn() { 87 return column; 88 } 89 } 90 | Popular Tags |