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

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

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

TableColumn.setMoveable介绍

[英]Sets the moveable attribute. A column that is moveable can be reordered by the user by dragging the header. A column that is not moveable cannot be dragged by the user but may be reordered by the programmer.
[中]设置“可移动”属性。可移动的列可以由用户通过拖动标题重新排序。不可移动的列不能由用户拖动,但可以由程序员重新排序。

代码示例

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

/**
 * Sets the moveable columns state of the "Example" widgets.
 */
void setColumnsMoveable () {
  boolean selection = moveableColumns.getSelection();
  TableColumn[] columns = table1.getColumns();
  for (TableColumn column : columns) {
    column.setMoveable(selection);
  }
}

代码示例来源: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: anb0s/EasyShell

private void createColumns(final Composite parent, final TableViewer viewer) {
  TableViewerColumn viewerColumn1 = new TableViewerColumn(viewer,
      SWT.NONE);
  TableColumn column1 = viewerColumn1.getColumn();
  column1.setText(Activator.getResourceString("easyshell.menu.page.header.title.column0"));
  column1.setWidth(200);
  column1.setResizable(true);
  column1.setMoveable(true);
  TableViewerColumn viewerColumn2 = new TableViewerColumn(viewer,
      SWT.NONE);
  TableColumn column2 = viewerColumn2.getColumn();
  column2.setText(Activator.getResourceString("easyshell.menu.page.header.title.column1"));
  column2.setWidth(400);
  column2.setResizable(true);
  column2.setMoveable(true);
}

代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls

public void createTableColumnInternal(Language language) {
 TableColumn c = new TableColumn(m_table, SWT.LEAD);
 c.setData(LANGUAGE_COLUMN_ID, language);
 if (!language.isLocal()) {
  c.setToolTipText("this language is only in the parent defined!\nCreate a new language for " + language.getLocale().toString() + " to make it locally available.");
  c.setImage(NlsCore.getImage(INlsIcons.WARNING));
 }
 c.setText(language.getDispalyName());
 c.setMoveable(true);
 c.addSelectionListener(new P_SortSelectionAdapter(m_table.indexOf(c)));
 c.setWidth(200);
}

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

/**
 * Creates table columns.
 */
private void createColumns() {
  String[] columnNames = { "Definition Name", "Business Transaction Name", "Name Extraction", "Description" };
  int[] columnWidths = { 250, 250, 100, 400 };
  String[] toolTips = { "The name of the business transaction definition. This name is also used for the mapped business transactions if dynamic name extraction is not enabled.",
      "The name of the actual mapped business transaction. This name equals to the Definition Name if dynamic name extraction is not enabled, otherwise the name is dynamically extracted according to the specified pattern.",
      "Indicates whether the name of the business transaction will be extracted dynamically.", "Description." };
  for (int i = 0; i < columnNames.length; i++) {
    TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
    viewerColumn.getColumn().setMoveable(true);
    viewerColumn.getColumn().setResizable(true);
    viewerColumn.getColumn().setText(columnNames[i]);
    viewerColumn.getColumn().setWidth(columnWidths[i]);
    viewerColumn.getColumn().setToolTipText(toolTips[i]);
  }
}

代码示例来源: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: anb0s/EasyShell

private void createColumns(final Composite parent, final TableViewer viewer) {
  String[] titles = {
      Activator.getResourceString("easyshell.command.page.header.title.column0"),
      Activator.getResourceString("easyshell.command.page.header.title.column1"),
      Activator.getResourceString("easyshell.command.page.header.title.column2"),
      Activator.getResourceString("easyshell.command.page.header.title.column3")
  };
  int[] bounds = { 100, 100, 80, 400 };
  // create
  for (int i=0;i<titles.length;i++) {
    TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
        SWT.NONE);
    TableColumn column = viewerColumn.getColumn();
    column.setText(titles[i]);
    column.setWidth(bounds[i]);
    column.setResizable(true);
    column.setMoveable(true);
  }
}

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

代码示例来源: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);
    if (column.showInAggregatedMode) {
      viewerColumn.getColumn().setWidth(column.width);
    } else {
      viewerColumn.getColumn().setWidth(0);
    }
    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);
    if (column.showInAggregatedMode) {
      viewerColumn.getColumn().setWidth(column.width);
    } else {
      viewerColumn.getColumn().setWidth(0);
    }
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    super.mapTableViewerColumn(column, viewerColumn);
  }
}

代码示例来源:origin: net.anwiba.eclipse/net.anwiba.eclipse.project.dependencies

private void createColumns(final TableViewer tableViewer) {
 final String[] titles = { "Class" };
 final int[] bounds = { 120, 100, 200 };
 for (int i = 0; i < titles.length; i++) {
  final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
  tableViewer.setSorter(new TableViewerSorter(titles));
  viewerColumn.setLabelProvider(new TableCellLabelProvider());
  final TableColumn column = viewerColumn.getColumn();
  column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
  column.setText(titles[i]);
  column.setWidth(bounds[i]);
  column.setResizable(true);
  column.setMoveable(false);
 }
 final Table table = tableViewer.getTable();
 table.setHeaderVisible(true);
 table.setLinesVisible(true);
 ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);
}

代码示例来源: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 (Column.EXCLUSIVEAVERAGE.equals(column) || Column.EXCLUSIVESUM.equals(column) || Column.EXCLUSIVEMIN.equals(column) || Column.EXCLUSIVEMAX.equals(column)) {
      // TODO: Remove this tooltip and add it to the cell as soon as the image bug is
      // fixed in Eclipse.
      viewerColumn.getColumn()
          .setToolTipText("Exclusive times can only be calculated correctly if the timer is within an invocation sequence. "
              + "A warning marker is provided if not all timers are run within an invocation sequence. Please be aware that "
              + "avg, sum, min and max calculations are reflecting only the timers inside an invocation sequence.");
    }
    if (null != column.image) {
      viewerColumn.getColumn().setImage(column.image);
    }
    mapTableViewerColumn(column, viewerColumn);
  }
}

相关文章