org.eclipse.swt.widgets.Table.setLayout()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(12.4k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中org.eclipse.swt.widgets.Table.setLayout()方法的一些代码示例,展示了Table.setLayout()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setLayout()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:setLayout

Table.setLayout介绍

暂无

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.team.ui

private void addProjectSection(Composite composite) {
    
    table = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    tableViewer = new TableViewer(table);
    table.setLayout(new TableLayout());
    GridData data = new GridData(GridData.FILL_BOTH);
    data.heightHint = 300;
    table.setLayoutData(data);
    tableViewer.setContentProvider(new ProjectContentProvider());
    tableViewer.setLabelProvider(new ExportProjectSetLabelProvider());
  }

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

private void restoreDefaultColumnWidths(){
  TableLayout layout = new TableLayout();
  for (int i = 0; i < variableTableColumnLayouts.length; i++) {
    layout.addColumnData(variableTableColumnLayouts[i]);
  }
  variableTable.getTable().setLayout(layout);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.team.ui

private void addProjectSection(Composite composite) {
  table = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
  tableViewer = new TableViewer(table);
  table.setLayout(new TableLayout());
  GridData data = new GridData(GridData.FILL_BOTH);
  data.heightHint = 300;
  table.setLayoutData(data);
  tableViewer.setContentProvider(new ProjectContentProvider());
  tableViewer.setLabelProvider(new ExportProjectSetLabelProvider());
  tableViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Creates a new table control with one column.
 *
 * @param parent the parent control
 * @param style style bits
 * @return a new table control
 */
protected static Table createTable(Composite parent, int style) {
  Table table = new Table(parent, SWT.CHECK | style);
  // Although this table column is not needed, and can cause resize problems,
  // it can't be removed since this would be a breaking change against R1.0.
  // See bug 6643 for more details.
  new TableColumn(table, SWT.NONE);
  TableLayout layout = new TableLayout();
  layout.addColumnData(new ColumnWeightData(100));
  table.setLayout(layout);
  return table;
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

private void createTable(Composite container, FormToolkit toolkit) {
  fTable = toolkit.createTable(container, SWT.MULTI | SWT.FULL_SELECTION);
  GridData gd = new GridData(GridData.FILL_BOTH);
  gd.heightHint = 100;
  fTable.setLayoutData(gd);
  TableColumn col1 = new TableColumn(fTable, SWT.NULL);
  col1.setText(PDEUIMessages.SiteEditor_ArchiveSection_col1);
  TableColumn col2 = new TableColumn(fTable, SWT.NULL);
  col2.setText(PDEUIMessages.SiteEditor_ArchiveSection_col2);
  TableLayout tlayout = new TableLayout();
  tlayout.addColumnData(new ColumnWeightData(50, 200));
  tlayout.addColumnData(new ColumnWeightData(50, 200));
  fTable.setLayout(tlayout);
  fTable.setHeaderVisible(true);
  createContextMenu(fTable);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Creates a new table control with one column.
 *
 * @param parent the parent control
 * @param style style bits
 * @return a new table control
 */
protected static Table createTable(Composite parent, int style) {
  Table table = new Table(parent, SWT.CHECK | style);
  // Although this table column is not needed, and can cause resize problems,
  // it can't be removed since this would be a breaking change against R1.0.
  // See bug 6643 for more details.
  new TableColumn(table, SWT.NONE);
  TableLayout layout = new TableLayout();
  layout.addColumnData(new ColumnWeightData(100));
  table.setLayout(layout);
  return table;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Creates a new table control with one column.
 *
 * @param parent the parent control
 * @param style style bits
 * @return a new table control
 */
protected static Table createTable(Composite parent, int style) {
  Table table = new Table(parent, SWT.CHECK | style);
  // Although this table column is not needed, and can cause resize problems,
  // it can't be removed since this would be a breaking change against R1.0.
  // See bug 6643 for more details.
  new TableColumn(table, SWT.NONE);
  TableLayout layout = new TableLayout();
  layout.addColumnData(new ColumnWeightData(100));
  table.setLayout(layout);
  return table;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Override
  protected void layout(Composite composite, boolean flushCache) {
    TableColumn c[] = editorsTable.getColumns();
    if (columnsWidth == null) {
      int w = editorsTable.getClientArea().width;
      c[0].setWidth(w * 1 / 3);
      c[1].setWidth(w - c[0].getWidth());
    } else {
      c[0].setWidth(columnsWidth[0]);
      c[1].setWidth(columnsWidth[1]);
    }
    editorsTable.setLayout(null);
  }
});

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void createColumns() {
  TableLayout layout = new TableLayout();
  getTable().setLayout(layout);
  getTable().setHeaderVisible(true);
  for (int i = 0; i < columnHeaders.length; i++) {
    layout.addColumnData(columnLayouts[i]);
    TableColumn tc = new TableColumn(getTable(), SWT.NONE,i);
    tc.setResizable(columnLayouts[i].resizable);
    tc.setText(columnHeaders[i]);
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private void createColumns() {
  TableLayout layout = new TableLayout();
  getTable().setLayout(layout);
  getTable().setHeaderVisible(true);
  for (int i = 0; i < columnHeaders.length; i++) {
    layout.addColumnData(columnLayouts[i]);
    TableColumn tc = new TableColumn(getTable(), SWT.NONE,i);
    tc.setResizable(columnLayouts[i].resizable);
    tc.setText(columnHeaders[i]);
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void createColumns() {
  TableLayout layout = new TableLayout();
  getTable().setLayout(layout);
  getTable().setHeaderVisible(true);
  for (int i = 0; i < columnHeaders.length; i++) {
    layout.addColumnData(columnLayouts[i]);
    TableColumn tc = new TableColumn(getTable(), SWT.NONE,i);
    tc.setResizable(columnLayouts[i].resizable);
    tc.setText(columnHeaders[i]);
  }
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

private void initializeTable(Table table) {
  table.setHeaderVisible(true);
  TableColumn column = new TableColumn(table, SWT.NULL);
  column.setText(PDEUIMessages.TemplateSelectionPage_column_name);
  column.setResizable(true);
  column = new TableColumn(table, SWT.NULL);
  column.setText(PDEUIMessages.TemplateSelectionPage_column_point);
  column.setResizable(true);
  TableLayout layout = new TableLayout();
  layout.addColumnData(new ColumnWeightData(50));
  layout.addColumnData(new ColumnWeightData(50));
  table.setLayout(layout);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 * Create the table columns for the receiver.
 */
private void createTableColumns() {
  TableLayout layout = new TableLayout();
  Table table = markersTable.getTable();
  table.setLayout(layout);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  layout.addColumnData(new ColumnWeightData(70, true));
  TableColumn tc = new TableColumn(table, SWT.NONE, 0);
  tc
      .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Location);
  layout.addColumnData(new ColumnWeightData(30, true));
  tc = new TableColumn(table, SWT.NONE, 0);
  tc
      .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Resource);
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

public EJBTableViewer(Composite parent)
{
 super(parent, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
 
 String columnProperties[] = {ConsumptionUIMessages.TABLE_TITLE_EJB_BEAN_NAMES, ConsumptionUIMessages.TABLE_TITLE_EJB_PROJECT_NAME};
 int columnsWidth[] = {60, 20};
 int columnMins[] = {175, 125};
 
 Table table = getTable();
 table.setHeaderVisible(true);
 table.setLinesVisible(true);
 TableLayout layout = new TableLayout();
 for (int i = 0; i < columnProperties.length; i++)
 {
  TableColumn column = new TableColumn(table, SWT.NONE, i);
  column.setText(columnProperties[i]);
  column.pack();
  layout.addColumnData(new ColumnWeightData(columnsWidth[i], columnMins[i], true));      
 }
 table.setLayout(layout);
 setColumnProperties(columnProperties);
 setContentProvider(new EJBContentProvider());
 setLabelProvider(new EJBLabelProvider());
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui

public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
  super(parent, SWT.FULL_SELECTION);
  Table table = getTable();
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  TableLayout layout = new TableLayout();
  for (int i = 0; i < columnProperties.length; i++) {
    TableColumn column = new TableColumn(table, i);
    column.setText(columnProperties[i]);
    column.setAlignment(SWT.LEFT);
    layout.addColumnData(new ColumnWeightData(50, true));
  }
  table.setLayout(layout);
  table.setLinesVisible(false);
  setColumnProperties(columnProperties);
  setContentProvider(new CatalogEntryContentProvider());
  setLabelProvider(new CatalogEntryLabelProvider());
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public ConstraintsTableViewer(Table table)
{
 super(table);
 table = getTable();
 table.setLinesVisible(true);
 setContentProvider(new ConstraintsContentProvider());
 setLabelProvider(new ConstraintsTableLabelProvider());
 setColumnProperties(columnProperties);
 setCellModifier(this);
 TableColumn column = new TableColumn(table, SWT.NONE, 0);
 column.setText(columnProperties[0]);
 column.setAlignment(SWT.LEFT);
 column.setResizable(true);
 cellEditors = new CellEditor[1];
 TableLayout layout = new TableLayout();
 ColumnWeightData data = new ColumnWeightData(100);
 layout.addColumnData(data);
 cellEditors[0] = new TextCellEditor(table);
 getTable().setLayout(layout);
 setCellEditors(cellEditors);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public EnumerationsTableViewer(Table table)
{
 super(table);
 table = getTable();
 table.setLinesVisible(true);
 setContentProvider(new EnumerationsTableContentProvider());
 setLabelProvider(new EnumerationsTableLabelProvider());
 setColumnProperties(columnProperties);
 setCellModifier(this);
 TableColumn column = new TableColumn(table, SWT.NONE, 0);
 column.setText(columnProperties[0]);
 column.setAlignment(SWT.LEFT);
 column.setResizable(true);
 cellEditors = new CellEditor[1];
 TableLayout layout = new TableLayout();
 ColumnWeightData data = new ColumnWeightData(100);
 layout.addColumnData(data);
 cellEditors[0] = new TextCellEditor(table);
 getTable().setLayout(layout);
 setCellEditors(cellEditors);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security.ui

public ValuesView(Table table, final ISecurePreferencesSelection parentView, Shell shell) {
  this.parentView = parentView;
  this.shell = shell;
  TableColumn keysColumn = new TableColumn(table, SWT.LEFT);
  keysColumn.setText(SecUIMessages.keysColumn);
  TableColumn valuesColumn = new TableColumn(table, SWT.LEFT);
  valuesColumn.setText(SecUIMessages.valuesColumn);
  TableLayout layout = new TableLayout();
  layout.addColumnData(new ColumnWeightData(1));
  layout.addColumnData(new ColumnWeightData(2));
  table.setLayout(layout);
  tableViewer = new TableViewer(table);
  tableViewer.setContentProvider(new TableContentProvider());
  tableViewer.setLabelProvider(new TableLabelProvider());
  tableViewer.setComparator(new ViewerComparator());
  if (Activator.getDefault().debugStorageContents()) {
    makeActions();
    hookContextMenu();
  }
}

代码示例来源:origin: org.eclipse.equinox.security/ui

public ValuesView(Table table, final ISecurePreferencesSelection parentView, Shell shell) {
  this.parentView = parentView;
  this.shell = shell;
  TableColumn keysColumn = new TableColumn(table, SWT.LEFT);
  keysColumn.setText(SecUIMessages.keysColumn);
  TableColumn valuesColumn = new TableColumn(table, SWT.LEFT);
  valuesColumn.setText(SecUIMessages.valuesColumn);
  TableLayout layout = new TableLayout();
  layout.addColumnData(new ColumnWeightData(1));
  layout.addColumnData(new ColumnWeightData(2));
  table.setLayout(layout);
  tableViewer = new TableViewer(table);
  tableViewer.setContentProvider(new TableContentProvider());
  tableViewer.setLabelProvider(new TableLabelProvider());
  tableViewer.setSorter(new TableNameSorter());
  if (Activator.getDefault().debugStorageContents()) {
    makeActions();
    hookContextMenu();
  }
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.da.ui.client.dataitem.details

@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 () );
}

相关文章

微信公众号

最新文章

更多

Table类方法