org.eclipse.jface.viewers.TableLayout.addColumnData()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(13.7k)|赞(0)|评价(0)|浏览(104)

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

TableLayout.addColumnData介绍

[英]Adds a new column of data to this table layout.
[中]将新的数据列添加到此表布局。

代码示例

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.da.ui.widgets

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

代码示例来源: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.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.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.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.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.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.emf/org.eclipse.emf.converter

protected void addEPackagesTableColumns(CheckboxTableViewer ePackagesTableViewer)
{
 ePackagesTableViewer.setColumnProperties(new String []{ "a", "b" });
 Table table = ePackagesTableViewer.getTable();
 table.setHeaderVisible(true);
 TableLayout tableLayout = (TableLayout)table.getLayout();
 TableColumn packageColumn = new TableColumn(table, SWT.NONE);
 tableLayout.addColumnData(new ColumnWeightData(1, true));
 packageColumn.setText(getEPackageColumnLabel());
 packageColumn.setResizable(true);
 TableColumn dataColumn = new TableColumn(table, SWT.NONE);
 tableLayout.addColumnData(new ColumnWeightData(1, true));
 dataColumn.setText(getEPackageDataColumnLabel());
 dataColumn.setResizable(true);
}

代码示例来源: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: 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 () );
}

代码示例来源:origin: org.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 () );
}

代码示例来源: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: 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);
}

相关文章