/** * Creates a table tree viewer on a newly-created table tree control under * the given parent. The table tree control is created using the given SWT * style bits. The viewer has no input, no content provider, a default label * provider, no sorter, and no filters. * * @param parent * the parent control * @param style * the SWT style bits */ @Deprecated public TableTreeViewer(Composite parent, int style) { this(new TableTree(parent, style)); }
/** * New table tree. * * @param parent the parent * @param style SWT.SINGLE SWT.MULTI SWT.CHECK SWT.FULL_SELECTION * @return the TableTree */ protected TableTree newTableTree(Composite parent, int style) { TableTree tt = new TableTree(parent, style); tt.setLayoutData(new GridData(GridData.FILL_BOTH)); toolkit.adapt(tt, true, true); tt.addListener(SWT.Selection, this); tt.getTable().addListener(SWT.KeyUp, this); // for delete key tt.getTable().addListener(SWT.MouseDoubleClick, this); // for edit tt.addListener(SWT.Expand, this); tt.addListener(SWT.Collapse, this); // Make the TableTree's border visible since TableTree is NOT a widget supported // by FormToolkit. Needed by RedHat Linux tt.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); return tt; }