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

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

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

TableColumn.setResizable介绍

[英]Sets the resizable attribute. A column that is resizable can be resized by the user dragging the edge of the header. A column that is not resizable cannot be dragged by the user but may be resized by the programmer.
[中]设置可调整大小的属性。可以调整大小的列可以通过用户拖动标题的边缘来调整大小。不可调整大小的列不能由用户拖动,但可以由程序员调整大小。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

tablecolumn[0].setResizable( true );
tablecolumn[0].setText( "#" );
tablecolumn[0].setWidth( addIndexColumn ? 25 : 0 );
 int allignment = columns[i].getAllignement();
 tablecolumn[i + 1] = new TableColumn( table, allignment );
 tablecolumn[i + 1].setResizable( true );
 if ( columns[i].getName() != null ) {
  tablecolumn[i + 1].setText( columns[i].getName() );

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

/**
 * Sets the resizable columns state of the "Example" widgets.
 */
void setColumnsResizable () {
  boolean selection = resizableColumns.getSelection();
  TableColumn[] columns = table1.getColumns();
  for (TableColumn column : columns) {
    column.setResizable(selection);
  }
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Sets the {@link TreeColumn} or {@link TableColumn} resizable.
 *
 * @param column
 *            Column
 * @param resizable
 *            Resizable or not
 */
private void setColumnResizable(Item column, boolean resizable) {
  if (column instanceof TableColumn) {
    ((TableColumn) column).setResizable(resizable);
  } else if (column instanceof TreeColumn) {
    ((TreeColumn) column).setResizable(resizable);
  }
}

代码示例来源:origin: org.eclipse.recommenders.completion.rcp/calls

private TableViewerColumn createTableViewerColumn(final TableViewer viewer, final String title, final int bound,
    final int colNumber) {
  final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
  final TableColumn column = viewerColumn.getColumn();
  column.setText(title);
  column.setWidth(bound);
  column.setResizable(false);
  column.setMoveable(false);
  return viewerColumn;
}

代码示例来源: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.equinox.p2/ui

private void setConfigsColumns(TableViewer tableViewer) {
  tableViewer.getTable().setHeaderVisible(true);
  TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.NONE);
  TableColumn tc = column.getColumn();
  tc.setResizable(true);
  tc.setText(ProvUIMessages.RevertProfilePage_ProfileTimestampColumn);
  tc.setWidth(175);
  column = new TableViewerColumn(tableViewer, SWT.NONE);
  tc = column.getColumn();
  tc.setResizable(true);
  tc.setText(ProvUIMessages.RevertProfilePage_ProfileTagColumn);
  tc.setWidth(200);
  column.setEditingSupport(new TagEditingSuport(tableViewer, ui));
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Creates columns for the {@link #attributesTableViewer} table.
 */
private void createColumnsForAttributesTable() {
  TableViewerColumn nameColumn = new TableViewerColumn(attributesTableViewer, SWT.NONE);
  nameColumn.getColumn().setResizable(true);
  nameColumn.getColumn().setWidth(200);
  nameColumn.getColumn().setText("Name");
  nameColumn.setLabelProvider(new ColumnLabelProvider() {
    @Override
    public String getText(Object element) {
      return element.toString();
    }
  });
}

代码示例来源: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: alblue/com.packtpub.e4

public TableViewerColumn addColumnTo(TableViewer viewer) {
  TableViewerColumn tableViewerColumn = new TableViewerColumn(viewer, SWT.NONE);
  TableColumn column = tableViewerColumn.getColumn();
  column.setMoveable(true);
  column.setResizable(true);
  column.setText(getTitle());
  column.setWidth(getWidth());
  column.setAlignment(getAlignment());
  tableViewerColumn.setLabelProvider(this);
  return tableViewerColumn;
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Column for the table viewer.
 */
private void createColumnsForParametersTable() {
  TableViewerColumn paramColumn = new TableViewerColumn(parametersTableViewer, SWT.NONE);
  paramColumn.getColumn().setResizable(true);
  paramColumn.getColumn().setWidth(100);
  paramColumn.getColumn().setText("Parameter FQN");
  paramColumn.setLabelProvider(new ColumnLabelProvider() {
    @Override
    public String getText(Object element) {
      return (String) element;
    }
  });
  paramColumn.getColumn().setToolTipText("Parameter FQN or primitive type name.");
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Creates columns for table.
 */
private void createColumns() {
  TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.NONE);
  column.getColumn().setResizable(false);
  column.getColumn().setWidth(400);
  column.getColumn().setText("Rule");
  column.getColumn().setToolTipText("The fully qualified name of the class or set of classes to be excluded. The wildcard * can be used to match any length of characters.");
  column.setLabelProvider(new ColumnLabelProvider() {
    @Override
    public String getText(Object element) {
      return ((ExcludeRule) element).getClassName();
    }
  });
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
  }
}

代码示例来源:origin: inspectIT/inspectIT

@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public void createColumns(TableViewer tableViewer) {
  for (Column column : Column.values()) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(column.name);
    viewerColumn.getColumn().setWidth(column.width);
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

相关文章