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

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

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

TableColumn.pack介绍

[英]Causes the receiver to be resized to its preferred size. For a composite, this involves computing the preferred size from its layout, if there is one.
[中]使接收器大小调整为其首选大小。对于复合材料,这涉及到根据其布局计算首选尺寸(如果有)。

代码示例

代码示例来源:origin: stackoverflow.com

private static void resizeColumn(TableColumn tableColumn_)
{
  tableColumn_.pack();

}
private static void resizeTable(Table table_)
{
  for (TableColumn tc : table.getColumns())
    resizeColumn(tc);
}

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

column.pack();
} else {

代码示例来源:origin: stackoverflow.com

for(TableColumn col : table.getColumns())
{
  col.pack();
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
 * Pack changing columns.
 */
private void packChangingColumns() {
 table.getColumn(KEY_COL).pack();
 table.getColumn(3).pack();
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
 * Pack table.
 *
 * @param table the table
 */
public void packTable(Table table) {
 TableColumn[] columns = table.getColumns();
 for (int i = 0; i < columns.length; i++) {
  columns[i].pack();
 }
}

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

tablecolumn[i + 1].setAlignment( SWT.RIGHT );
tablecolumn[i + 1].pack();

代码示例来源:origin: heeckhau/mousefeed

/**
 * Sets {@link #table} column widths. 
 */
private void resizeTableColumns() {
  for (TableColumn column : table.getColumns()) {
    column.pack();
  }
}

代码示例来源:origin: stackoverflow.com

public void createPartControl(Composite parent) {
 parent.setLayout(new GridLayout(1, true));

 addSelectionButtons(parent); // Adds select/deselect all buttons

 myTableViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
 myTableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
 myTableViewer.setContentProvider(new MyContentProvider());
 myTableViewer.setLabelProvider(new MyLabelProvider());
 myTableViewer.setInput(getInput()); // Gets model

 TableColumn column = new TableColumn(myTableViewer.getTable(), SWT.FILL);
 column.setText("My column");
 column.pack();

 myTableViewer.getTable().setHeaderVisible(true);
 myTableViewer.getTable().setLinesVisible(true);
}

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

void packColumns () {
  int columnCount = table1.getColumnCount();
  for (int i = 0; i < columnCount; i++) {
    TableColumn tableColumn = table1.getColumn(i);
    tableColumn.pack();
  }
}

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

void packColumns () {
  int columnCount = colors.getColumnCount();
  for (int i = 0; i < columnCount; i++) {
    TableColumn tableColumn = colors.getColumn(i);
    tableColumn.pack();
  }
}

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

@Override
  public void controlResized(ControlEvent e) {
    //Also try and reset the size of the columns as appropriate
    TableColumn[] columns = selectionGroup.getListTable()
        .getColumns();
    for (int i = 0; i < columns.length; i++) {
      columns[i].pack();
    }
  }
});

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
 * Pack 04.
 */
private void pack04() {
 tt.getTable().getColumn(TITLE_COL).pack();
 tt.getTable().getColumn(NAME_COL).pack();
 tt.getTable().getColumn(NAMESPACE_COL).pack();
}

代码示例来源:origin: org.apache.directory.studio/apacheds.configuration

/**
 * Resizes the columns to fit the size of the cells.
 */
private void resizeContextEntryTableColumnsToFit()
{
  // Resizing the first column
  contextEntryTable.getColumn( 0 ).pack();
  // Adding a little space to the first column
  contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 );
  // Resizing the second column
  contextEntryTable.getColumn( 1 ).pack();
}

代码示例来源:origin: org.apache.directory.studio/apacheds.configuration

/**
 * Resizes the columns to fit the size of the cells.
 */
private void resizeContextEntryTableColumnsToFit()
{
  // Resizing the first column
  contextEntryTable.getColumn( 0 ).pack();
  // Adding a little space to the first column
  contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 );
  // Resizing the second column
  contextEntryTable.getColumn( 1 ).pack();
}

代码示例来源:origin: org.apache.directory.studio/apacheds.configuration

/**
 * Resizes the columns to fit the size of the cells.
 */
private void resizeContextEntryTableColumnsToFit()
{
  // Resizing the first column
  contextEntryTable.getColumn( 0 ).pack();
  // Adding a little space to the first column
  contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 );
  // Resizing the second column
  contextEntryTable.getColumn( 1 ).pack();
}

代码示例来源:origin: org.apache.directory.studio/apacheds.configuration

/**
 * Resizes the columns to fit the size of the cells.
 */
private void resizeContextEntryTableColumnsToFit()
{
  // Resizing the first column
  contextEntryTable.getColumn( 0 ).pack();
  // Adding a little space to the first column
  contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 );
  // Resizing the second column
  contextEntryTable.getColumn( 1 ).pack();
}

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

/**
 * @since 2.1
 */
@Override
public void createControl(Composite parent) {
  super.createControl(parent);
  // set the with of the leftmost column ('name')
  getTableViewer().getTable().getColumns()[0].pack();
}

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

private void restoreColumnWidths(IDialogSettings settings, String qualifier) {
  int columnCount = fTable.getColumnCount();
  for (int i = 0; i < columnCount; i++) {
    int width = -1;
    
    try {
      width = settings.getInt(qualifier + ".columnWidth" + i); //$NON-NLS-1$
    } catch (NumberFormatException e) {}
    
    if (width <= 0) {
      fTable.getColumn(i).pack();
    } else {
      fTable.getColumn(i).setWidth(width);
    }
  }
}

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

@Override
public void run() {
  fIsShowAddressColumn = !fIsShowAddressColumn;
  if (!fIsShowAddressColumn) {
    fTableViewer.getTable().getColumn(0).setWidth(0);
  } else {
    fTableViewer.getTable().getColumn(0).pack();
  }
  updateActionLabel();
}

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

protected void refreshRuntimesViewer() {
 runtimesViewer.refresh(); // should listen on property changes instead?
 Object[] checkedElements = runtimesViewer.getCheckedElements();
 if(checkedElements == null || checkedElements.length == 0) {
  AbstractMavenRuntime runtime = getDefaultRuntime();
  runtimesViewer.setChecked(runtime, true);
  defaultRuntime = runtime.getName();
 }
 for(TableColumn column : runtimesViewer.getTable().getColumns()) {
  column.pack();
 }
}

相关文章