protected void applyInitialColWidth ( final TableLayout tableLayout ) { if ( this.initialColWidth != null && !this.initialColWidth.isEmpty () && this.viewer != null && this.initialColWidth.size () != this.viewer.getTree ().getColumnCount () ) { for ( final Integer w : this.initialColWidth ) { tableLayout.addColumnData ( new ColumnPixelData ( w, true ) ); } } else { tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) ); tableLayout.addColumnData ( new ColumnWeightData ( 100, true ) ); tableLayout.addColumnData ( new ColumnWeightData ( 100, true ) ); tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) ); tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) ); } }
private void addColumns() { // Columns final TableLayout mergeTableLayout = new TableLayout(); table.setLayout(mergeTableLayout); mergeTableLayout.addColumnData(new ColumnWeightData(15, 10, true)); final TableColumn changesetTableColumn = new TableColumn(table, SWT.NONE); changesetTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameChangeset")); //$NON-NLS-1$ mergeTableLayout.addColumnData(new ColumnWeightData(25, 10, true)); final TableColumn changeTableColumn = new TableColumn(table, SWT.NONE); changeTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameDate")); //$NON-NLS-1$ mergeTableLayout.addColumnData(new ColumnWeightData(15, 10, true)); final TableColumn userTableColumn = new TableColumn(table, SWT.NONE); userTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameUser")); //$NON-NLS-1$ mergeTableLayout.addColumnData(new ColumnWeightData(35, 10, true)); final TableColumn commentTableColumn = new TableColumn(table, SWT.FILL); commentTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameComment")); //$NON-NLS-1$ }
private void createTableColumns(final Table table) { final TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); tableLayout.addColumnData(new ColumnWeightData(5, true)); final TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setText(Messages.getString("BranchesPropertiesControl.ColumNameFileName")); //$NON-NLS-1$ column1.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(3, true)); final TableColumn column2 = new TableColumn(table, SWT.NONE); column2.setText(Messages.getString("BranchesPropertiesControl.ColumnNameChange")); //$NON-NLS-1$ column2.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column3 = new TableColumn(table, SWT.NONE); column3.setText(Messages.getString("BranchesPropertiesControl.ColumnNameBranchedFrom")); //$NON-NLS-1$ column3.setResizable(true); }
private void createTableColumns(final Table table) { final TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setText(Messages.getString("StatusPropertiesTab.ColumNameUser")); //$NON-NLS-1$ column1.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column2 = new TableColumn(table, SWT.NONE); column2.setText(Messages.getString("StatusPropertiesTab.ChangeNameChangeType")); //$NON-NLS-1$ column2.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column3 = new TableColumn(table, SWT.NONE); column3.setText(Messages.getString("StatusPropertiesTab.ColumnNameWorkspace")); //$NON-NLS-1$ column3.setResizable(true); }
private void createTableColumns(final Table table) { final TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); tableLayout.addColumnData(new ColumnWeightData(5, true)); final TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setText(Messages.getString("BranchHistoryTreeControl.ColumnHeaderFileName")); //$NON-NLS-1$ column1.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column2 = new TableColumn(table, SWT.NONE); column2.setText(Messages.getString("BranchHistoryTreeControl.ColumnHeaderBranchedFromVersion")); //$NON-NLS-1$ column2.setResizable(true); if (displayLatestVersion) { tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column3 = new TableColumn(table, SWT.NONE); column3.setText(Messages.getString("BranchHistoryTreeControl.ColumnHeaderLatestVersion")); //$NON-NLS-1$ column3.setResizable(true); } }
private TableViewer createTable(Composite parent) { Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI); table.setHeaderVisible(true); table.setLinesVisible(true); GridData gridData = new GridData(GridData.FILL_BOTH); table.setLayoutData(gridData); TableLayout layout = new TableLayout(); table.setLayout(layout); tableViewer = new TableViewer(table); createColumns(table, layout); tableViewer.setContentProvider(new ArrayContentProvider()); tableViewer.setLabelProvider(new PropertiesLabelProvider()); return tableViewer; }
protected TableViewer createTable(Composite parent, int span) { Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL); data.horizontalSpan = span; data.heightHint = 125; table.setLayoutData(data); TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, true)); table.setLayout(layout); TableColumn col = new TableColumn(table, SWT.NONE); col.setResizable(true); col.setText(Policy.bind("SVNFoldersExistWarningPage.folders")); //$NON-NLS-1$ table.setHeaderVisible(true); return new TableViewer(table); }
private void createColumns(final Table table, final TableViewer viewer) { TableLayout layout = (TableLayout) table.getLayout(); final PackageSorter sorter = new PackageSorter(); viewer.setSorter(sorter); SelectionListener headerListener = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { int selectedCol = table.indexOf((TableColumn) e.widget); if (selectedCol == sorter.getPriority()) { sorter.reversePriority(); } else { sorter.setPriority(selectedCol); } viewer.refresh(); } }; for (int i = 0, lentgh = columnHeaders.length; i < lentgh; i++) { TableColumn column = new TableColumn(table, SWT.NONE); column.setResizable(true); column.setText(columnHeaders[i]); layout.addColumnData(columnLayouts[i]); column.addSelectionListener(headerListener); } }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); GridData gd = new GridData(GridData.FILL_BOTH); gd.minimumHeight = 200; table.setLayoutData(gd); table.setHeaderVisible(true); table.setLinesVisible(true); tableViewer = new TableViewer(table); attachContentProvider(tableViewer); attachLabelProvider(tableViewer); attachCellEditors(tableViewer, table); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(50)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[1]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText(Messages.QueryVisibleColumnsTable_1); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = 200; gd.widthHint = 580; table.setLayoutData(gd); table.setHeaderVisible(true); table.setLinesVisible(true); tableViewer = new TableViewer(table); attachContentProvider(tableViewer); attachLabelProvider(tableViewer); attachCellEditors(tableViewer, table); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(100)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[1]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText("Color"); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = 350; gd.widthHint = 300; table.setLayoutData(gd); table.setToolTipText(""); //$NON-NLS-1$ table.setHeaderVisible(true); table.setLinesVisible(true); tableViewer = new TableViewer(table); attachContentProvider(tableViewer); attachLabelProvider(tableViewer); attachCellEditors(tableViewer, table); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(100)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[1]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText(Messages.SeriesDialog_4); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); }
@Override protected void createColumns() { TableColumn[] col = new TableColumn[2]; col[0] = new TableColumn(rightTable, SWT.NONE); col[0].setText(Messages.common_fields); col[0].pack(); col[1] = new TableColumn(rightTable, SWT.NONE); col[1].setText(Messages.common_calculation); col[1].pack(); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(50, false)); tlayout.addColumnData(new ColumnWeightData(50, false)); rightTable.setLayout(tlayout); }
@Override protected void createColumns() { TableColumn[] col = new TableColumn[4]; col[0] = new TableColumn(rightTable, SWT.NONE); col[0].setText(Messages.common_fields); col[0].pack(); col[1] = new TableColumn(rightTable, SWT.NONE); col[1].setText(Messages.common_order); col[1].pack(); col[2] = new TableColumn(rightTable, SWT.NONE); col[2].setText(Messages.common_total_position); col[2].pack(); col[3] = new TableColumn(rightTable, SWT.NONE); col[3].setText(Messages.common_calculation); col[3].pack(); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(30, false)); tlayout.addColumnData(new ColumnWeightData(20, false)); tlayout.addColumnData(new ColumnWeightData(20, false)); tlayout.addColumnData(new ColumnWeightData(30, false)); rightTable.setLayout(tlayout); }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.V_SCROLL); table.setHeaderVisible(true); tableViewer = new TableViewer(table); tableViewer.setContentProvider(new ListContentProvider()); tableViewer.setLabelProvider(new TLabelProvider()); attachCellEditors(tableViewer, table); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(50, 75, true)); tlayout.addColumnData(new ColumnWeightData(50, 75, true)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[2]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText(Messages.common_name); column[1] = new TableColumn(table, SWT.NONE); column[1].setText(Messages.common_expression); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); fillTable(table); }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.V_SCROLL); table.setHeaderVisible(true); tableViewer = new TableViewer(table); tableViewer.setContentProvider(new ListContentProvider()); tableViewer.setLabelProvider(new TLabelProvider()); attachCellEditors(tableViewer, table); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(50, 75, true)); tlayout.addColumnData(new ColumnWeightData(50, 75, true)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[2]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText(Messages.ParameterPage_parameter); column[1] = new TableColumn(table, SWT.NONE); column[1].setText(Messages.common_expression); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); fillTable(table); }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.V_SCROLL); table.setHeaderVisible(true); tableViewer = new TableViewer(table); tableViewer.setContentProvider(new ListContentProvider()); tableViewer.setLabelProvider(new TLabelProvider()); attachCellEditors(tableViewer, table); TableColumn[] column = new TableColumn[2]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText(Messages.TabStopsPage_col1); column[1] = new TableColumn(table, SWT.NONE); column[1].setText(Messages.TabStopsPage_col2); fillTable(table, value); for (int i = 0, n = column.length; i < n; i++) { column[i].pack(); } TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(50, true)); tlayout.addColumnData(new ColumnWeightData(50, true)); table.setLayout(tlayout); }
private void buildTable(Composite composite) { Table table = new Table(composite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); GridData gd = new GridData(GridData.FILL_BOTH); gd.minimumHeight = 400; gd.minimumWidth = 400; table.setLayoutData(gd); table.setHeaderVisible(false); table.setLinesVisible(true); tableViewer = new TableViewer(table); attachContentProvider(tableViewer); attachLabelProvider(tableViewer); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(100)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[1]; column[0] = new TableColumn(table, SWT.NONE); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.V_SCROLL); table.setHeaderVisible(true); tableViewer = new TableViewer(table); tableViewer.setContentProvider(new ListContentProvider()); tableViewer.setLabelProvider(new TableLabelProvider()); attachCellEditors(tableViewer, table); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(50, 75, true)); tlayout.addColumnData(new ColumnWeightData(50, 75, true)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[2]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText("Export Type"); column[1] = new TableColumn(table, SWT.NONE); column[1].setText("Mapped Font Name"); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); fillTable(table); }
private void buildTable(Composite composite) { table = new Table(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.V_SCROLL); table.setHeaderVisible(true); tableViewer = new TableViewer(table); tableViewer.setContentProvider(new ListContentProvider()); tableViewer.setLabelProvider(new TableLabelProvider()); // attachCellEditors(tableViewer, table); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(50, 75, true)); table.setLayout(tlayout); TableColumn[] column = new TableColumn[1]; column[0] = new TableColumn(table, SWT.NONE); column[0].setText("Locale"); for (int i = 0, n = column.length; i < n; i++) column[i].pack(); fillTable(table); }
private void createTableColumn(Table table) { table.setHeaderVisible(true); TableColumn[] col = new TableColumn[1]; col[0] = new TableColumn(table, SWT.NONE); col[0].setText(Messages.ReportTemplatesWizardPage_categories); TableLayout tlayout = new TableLayout(); tlayout.addColumnData(new ColumnWeightData(100, false)); table.setLayout(tlayout); for (TableColumn c : col) c.pack(); TableViewer tableViewer = new TableViewer(table); tableViewer.setContentProvider(new ListContentProvider()); tableViewer.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { return MessagesByKeys.getString(element.toString()); } }); tableViewer.setInput(categoryList); table.addSelectionListener(new CategoryChooser()); table.setSelection(0); }
/** * Method createColumns. * @param table * @param layout * @param viewer */ private void createColumns(Table table, TableLayout layout) { TableColumn col; // name col = new TableColumn(table, SWT.NONE); col.setResizable(false); layout.addColumnData(new ColumnWeightData(1, true)); // name col = new TableColumn(table, SWT.NONE); col.setResizable(true); col.setText(Policy.bind("SvnPropertiesView.propertyName")); //$NON-NLS-1$ layout.addColumnData(new ColumnWeightData(60, true)); // value col = new TableColumn(table, SWT.NONE); col.setResizable(true); col.setText(Policy.bind("SvnPropertiesView.propertyValue")); //$NON-NLS-1$ layout.addColumnData(new ColumnWeightData(120, true)); }
/** * Creates the columns for the history table. */ private void createColumns(Table table, TableLayout layout) { SelectionListener headerListener = getColumnListener(); // action TableColumn col = new TableColumn(table, SWT.NONE); col.setResizable(true); col.setText(Policy.bind("ChangePathsTableProvider.action")); //$NON-NLS-1$ col.addSelectionListener(headerListener); layout.addColumnData(new ColumnWeightData(10, true)); // path col = new TableColumn(table, SWT.NONE); col.setResizable(true); col.setText(Policy.bind("ChangePathsTableProvider.path")); //$NON-NLS-1$ col.addSelectionListener(headerListener); layout.addColumnData(new ColumnWeightData(45, true)); table.setSortColumn(col); // description col = new TableColumn(table, SWT.NONE); col.setResizable(true); col.setText(Policy.bind("ChangePathsTableProvider.description")); //$NON-NLS-1$ col.addSelectionListener(headerListener); layout.addColumnData(new ColumnWeightData(50, true)); }
public static TableViewer createTableViewer(Composite parent, int span, int cols, int[] weights, int options, int indent) { TableViewer table = new TableViewer(parent, options); GridData gd = new GridData(SWT.DEFAULT); gd.horizontalSpan = span; gd.verticalAlignment = GridData.FILL; gd.grabExcessVerticalSpace = true; gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.horizontalIndent = indent; table.getTable().setLayoutData(gd); table.getTable().setHeaderVisible(true); table.getTable().setLinesVisible(true); TableLayout tl = new TableLayout(); for (int i=0; i<cols; i++) { if (weights != null) { tl.addColumnData(new ColumnWeightData(weights[i], false)); } else { tl.addColumnData(new ColumnWeightData(100, false)); } } table.getTable().setLayout(tl); return table; }
public static TableViewer createCheckboxTableViewer(Composite parent, int cols) { TableViewer table = new TableViewer(parent, SWT.CHECK | SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION); GridData gd = new GridData(SWT.DEFAULT); gd.horizontalSpan = 1; gd.verticalAlignment = GridData.FILL; gd.grabExcessVerticalSpace = true; gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; table.getTable().setLayoutData(gd); table.getTable().setHeaderVisible(true); table.getTable().setLinesVisible(true); TableLayout tl = new TableLayout(); for (int i=0; i<cols; i++) { tl.addColumnData(new ColumnWeightData(100, false)); } table.getTable().setLayout(tl); return table; }
private void createColumns( IResultMetaData rsMd ) { TableColumn column = null; TableLayout layout = new TableLayout( ); for ( int n = 1; n <= rsMd.getColumnCount( ); n++ ) { column = new TableColumn( resultSetTable, SWT.LEFT ); try { column.setText( rsMd.getColumnLabel( n ) ); } catch ( BirtException e ) { //this ExceptionHandler can show exception stacktrace org.eclipse.datatools.connectivity.internal.ui.dialogs.ExceptionHandler.showException( resultSetTable.getShell( ), Messages.getString( "CssErrDialog.Error" ), e.getLocalizedMessage( ), e ); } column.setResizable( true ); layout.addColumnData( new ColumnPixelData( 120, true ) ); addColumnSortListener( column, n ); column.pack( ); } resultSetTable.setLayout( layout ); resultSetTable.layout( true ); }
/** * Create a TreeViewer that can be used to display a list of IFile instances. * This method provides the labels and sorter but does not provide a content provider * * @param parent * @return TableViewer */ public TreeViewer createTree(Composite parent) { Tree tree = new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); tree.setHeaderVisible(true); tree.setLinesVisible(true); GridData data = new GridData(GridData.FILL_BOTH); tree.setLayoutData(data); TableLayout layout = new TableLayout(); tree.setLayout(layout); this.viewer = new TreeViewer(tree); createColumns(tree, layout); viewer.setLabelProvider(new LocalHistoryLabelProvider()); // By default, reverse sort by revision. // If local filter is on sort by date HistoryComparator sorter = new HistoryComparator(COL_DATE); sorter.setReversed(false); viewer.setComparator(sorter); return viewer; }
@Override public void createPart ( final Composite parent ) { super.createPart ( parent ); this.viewer = new TableViewer ( parent, SWT.FULL_SELECTION ); final TableLayout tableLayout = new TableLayout (); final TableViewerColumn col1 = new TableViewerColumn ( this.viewer, SWT.NONE ); col1.getColumn ().setText ( Messages.AttributesPart_NameLabel ); tableLayout.addColumnData ( new ColumnWeightData ( 50 ) ); final TableViewerColumn col2 = new TableViewerColumn ( this.viewer, SWT.NONE ); col2.getColumn ().setText ( Messages.AttributesPart_TypeLabel ); tableLayout.addColumnData ( new ColumnWeightData ( 20 ) ); final TableViewerColumn col3 = new TableViewerColumn ( this.viewer, SWT.NONE ); col3.getColumn ().setText ( Messages.AttributesPart_ValueLabel ); tableLayout.addColumnData ( new ColumnWeightData ( 50 ) ); this.viewer.getTable ().setHeaderVisible ( true ); this.viewer.getTable ().setLayout ( tableLayout ); ViewerSupport.bind ( this.viewer, this.entries, new IValueProperty[] { PojoProperties.value ( "name" ), PojoProperties.value ( "type" ), PojoProperties.value ( "value" ) } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ this.viewer.setComparator ( new ViewerComparator () ); }
private void createTableColumns(final Table table) { table.setLinesVisible(false); table.setHeaderVisible(true); final TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); final String[] columnNames = getTableColumnNames(); for (int i = 0; i < columnNames.length; i++) { tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setText(columnNames[i]); column1.setResizable(true); } }
/** * Create the steps table. * * @param composite * the parent layout composite * @param workItem * the test case work item * * @return the allocated table viewer */ private TableViewer createStepsTable(final Composite composite, final WorkItem workItem) { final TableViewer viewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION); GridDataBuilder.newInstance().align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 1).minHeight(75).applyTo( viewer.getTable()); final Table table = viewer.getTable(); table.setHeaderVisible(true); table.setLinesVisible(true); final TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); tableLayout.addColumnData(new ColumnPixelData(60, true)); final TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setImage(TestStepUtil.imageHelper.getImage("images/common/attachment.gif")); //$NON-NLS-1$ column1.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(10, true)); final TableColumn column2 = new TableColumn(table, SWT.NONE); column2.setText(Messages.getString("TestStepsControl.ColumnNameAction")); //$NON-NLS-1$ column2.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(8, true)); final TableColumn column3 = new TableColumn(table, SWT.NONE); column3.setText(Messages.getString("TestStepsControl.ColumnNameExpectedResult")); //$NON-NLS-1$ column3.setResizable(true); viewer.setContentProvider(new TestStepContentProvider()); viewer.setLabelProvider(new TestStepLabelProvider()); viewer.setInput(workItem); return viewer; }
/** * Create the parameter data table. The table is collapsed if there are no * columns defined in the work item. * * @param parent * The parent layout composite. * @param workItem * The test case work item. * * @return The allocated table viewer */ private TableViewer createDataTable(final Composite parent, final WorkItem workItem) { final Label label = new Label(parent, SWT.NONE); label.setText(Messages.getString("TestStepsControl.ParameterValuesLabelText")); //$NON-NLS-1$ final TableViewer dataViewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION); final Table dataTable = dataViewer.getTable(); GridDataBuilder.newInstance().align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 1).minHeight(75).applyTo( dataTable); dataTable.setHeaderVisible(true); dataTable.setLinesVisible(true); final TableLayout layout = new TableLayout(); dataTable.setLayout(layout); final ParamDataTable[] paramDataTables = getParamDataTables(); if (paramDataTables.length > 0) { sash.setMaximizedControl(null); updateDataTableColumns(dataViewer, paramDataTables[0].getColumnNames()); } else { sash.setMaximizedControl(stepsTable.getTable()); } dataViewer.setContentProvider(new ParamDataContentProvider()); dataViewer.setLabelProvider(new ParamDataLabelProvider()); dataViewer.setInput(workItem); return dataViewer; }
public AdvancedPropertiesControl(final Composite parent, final int style) { super(parent, style); final FillLayout layout = new FillLayout(); layout.marginWidth = 0; layout.marginHeight = 0; layout.spacing = getSpacing(); setLayout(layout); table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION); table.setLinesVisible(true); table.setHeaderVisible(true); final TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setText(Messages.getString("AdvancedPropertiesTab.ColumnNameProperty")); //$NON-NLS-1$ column1.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column2 = new TableColumn(table, SWT.NONE); column2.setText(Messages.getString("AdvancedPropertiesTab.ColumnNameValue")); //$NON-NLS-1$ column2.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column3 = new TableColumn(table, SWT.NONE); column3.setText(Messages.getString("AdvancedPropertiesTab.ColumnNameSource")); //$NON-NLS-1$ column3.setResizable(true); }
private void addTableColumns(final Table table) { final TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setText(Messages.getString("FileControl.ColumNameName")); //$NON-NLS-1$ column1.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column2 = new TableColumn(table, SWT.NONE); column2.setText(Messages.getString("FileControl.ColumnNamePendingChange")); //$NON-NLS-1$ column2.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column3 = new TableColumn(table, SWT.NONE); column3.setText(Messages.getString("FileControl.ColumnNameUser")); //$NON-NLS-1$ column3.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column4 = new TableColumn(table, SWT.NONE); column4.setText(Messages.getString("FileControl.ColumnNameLatest")); //$NON-NLS-1$ column4.setResizable(true); tableLayout.addColumnData(new ColumnWeightData(1, true)); final TableColumn column5 = new TableColumn(table, SWT.NONE); column5.setText(Messages.getString("FileControl.ColumnNameLastCheckin")); //$NON-NLS-1$ column5.setResizable(true); }
/** * Creates the table for the repositories */ protected TableViewer createTable(Composite parent, int span) { Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL); data.horizontalSpan = span; table.setLayoutData(data); TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, true)); table.setLayout(layout); TableColumn col = new TableColumn(table, SWT.NONE); col.setResizable(true); return new TableViewer(table); }
public ChangePathsTableProvider(Composite parent, IContentProvider contentProvider) { super(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); TableLayout layout = new TableLayout(); GridData data = new GridData(GridData.FILL_BOTH); Table table = (Table) getControl(); table.setHeaderVisible(true); table.setLinesVisible(true); table.setLayoutData(data); table.setLayout(layout); table.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if(currentPathFont != null) { currentPathFont.dispose(); } } }); createColumns(table, layout); setLabelProvider(new ChangePathLabelProvider()); setContentProvider(contentProvider); ChangePathsSorter sorter = new ChangePathsSorter(COL_PATH); setSorter(sorter); table.setSortDirection(SWT.UP); }