本文整理汇总了Java中org.eclipse.jface.viewers.TableLayout类的典型用法代码示例。如果您正苦于以下问题:Java TableLayout类的具体用法?Java TableLayout怎么用?Java TableLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TableLayout类属于org.eclipse.jface.viewers包,在下文中一共展示了TableLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyInitialColWidth
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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 ) );
}
}
示例2: addColumns
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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$
}
示例3: createTableColumns
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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);
}
示例4: createTableColumns
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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);
}
示例5: createTableColumns
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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);
}
}
示例6: createTable
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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;
}
示例7: createTable
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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;
}
示例8: createTable
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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);
}
示例9: createColumns
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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);
}
}
示例10: buildTable
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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();
}
示例11: buildTable
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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();
}
示例12: buildTable
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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();
}
示例13: createColumns
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
@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);
}
示例14: createColumns
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
@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);
}
示例15: buildTable
import org.eclipse.jface.viewers.TableLayout; //导入依赖的package包/类
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);
}