本文整理汇总了Java中org.eclipse.swt.widgets.TableColumn.setMoveable方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumn.setMoveable方法的具体用法?Java TableColumn.setMoveable怎么用?Java TableColumn.setMoveable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.TableColumn
的用法示例。
在下文中一共展示了TableColumn.setMoveable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
@Override
protected TableViewer createViewer(final Composite parent, final AbstractColumnLayout columnLayout, final int style) {
final TableViewer viewer = new TableViewer(parent, style);
final Table table = viewer.getTable();
table.setLinesVisible(linesVisible);
table.setHeaderVisible(headerVisible);
int columnIndex = 0;
for (final String columnLabel : columnLabels) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, NONE);
final TableColumn column = viewerColumn.getColumn();
columnLayout.setColumnData(column, createColumnLayoutData(columnIndex));
column.setText(columnLabel);
column.setMoveable(moveable);
columnIndex++;
}
return viewer;
}
示例2: createColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void createColumns(final TableViewer tableViewer) {
final String[] titles = { "Icon", "Name", "Small", "Medium", "Large", "Source", "Class" };
final int[] bounds = { 40, 200, 60, 60, 60, 200, 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);
}
示例3: createColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void createColumns(final TableViewer tableViewer) {
final String[] titles = { "Relation", "Type", "Name" };
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);
// Object[] projectsToSelect = openProjects.toArray();
// IViewPart view = window.getActivePage().showView( "org.eclipse.jdt.ui.PackageExplorer" );
// view.getSite().getSelectionProvider().setSelection( new StructuredSelection( projectsToSelect ) );
}
示例4: createColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
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);
}
示例5: defineColumnsInternal
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
/**
* Defines what columns the drop down table will have.
*
* @param columnHeaders
* @param columnBounds
*/
private void defineColumnsInternal(String[] columnHeaders, int[] columnBounds, int totalColumnsToBeCreated) {
checkWidget();
int totalColumnHeaders = columnHeaders == null ? 0 : columnHeaders.length;
int totalColBounds = columnBounds == null ? 0 : columnBounds.length;
if (totalColumnsToBeCreated > 0) {
for (int index = 0; index < totalColumnsToBeCreated; index++) {
TableColumn column = new TableColumn(table, SWT.NONE);
if (index < totalColumnHeaders) {
column.setText(columnHeaders[index]);
}
if (index < totalColBounds) {
column.setWidth(columnBounds[index]);
}
column.setResizable(true);
column.setMoveable(true);
}
}
}
示例6: createColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void createColumn(int idx, int align) {
TableViewerColumn viewerColumn = new TableViewerColumn(viewer, align, idx);
viewerColumn.setEditingSupport(new TableEditingSupport(viewer, idx));
viewerColumn.setLabelProvider(new ColumnLabelProvider() {
private int col = idx;
public String getText(Object element) {
if (element instanceof Row) {
return ((Row) element).data[col];
}
return super.getText(element);
}
});
TableColumn column = viewerColumn.getColumn();
column.setResizable(true);
column.setMoveable(true);
column.setText(tableModel.headers[idx]);
int width = convertWidthInCharsToPixels(tableModel.colWidths[idx]);
width = Math.max(width, 50);
column.setWidth(width);
}
示例7: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private static void createTableColumns(Table table, IElementType tableElementType) {
String[] columnTitles = tableElementType.getColumnTitles();
int[] columnAlignments = tableElementType.getColumnAlignments();
for (int i = 0; i < columnTitles.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(columnTitles[i]);
column.setAlignment(columnAlignments[i]);
column.setMoveable(true);
}
table.setHeaderVisible(true);
}
示例8: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
/**
* Creates the table columns.
*
* @param table
* the table
* @param fields
* the fields
*/
public static void createTableColumns(Table table,String[] fields){
for (String field : fields) {
TableColumn tc = new TableColumn(table, SWT.CENTER);
tc.setText(field);
tc.setMoveable(true);
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例9: addColumnTo
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
public TableViewerColumn addColumnTo(TableViewer viewer) {
TableViewerColumn tableViewerColumn = new TableViewerColumn(viewer, SWT.NONE);
TableColumn column = tableViewerColumn.getColumn();
column.setMoveable(true);
column.setText(getTitle());
column.setResizable(true);
tableViewerColumn.setLabelProvider(this);
return tableViewerColumn;
}
示例10: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, 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(true);
column.setMoveable(true);
return viewerColumn;
}
示例11: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
/**
* Helper method to create table columns
*
* @param tblVwrSetup
* @param title
* @param bound
* @return
*/
private TableViewerColumn createTableViewerColumn(final TableViewer tblVwrSetup, String title, int bound) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tblVwrSetup, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(bound);
column.setResizable(true);
column.setMoveable(false);
column.setAlignment(SWT.LEFT);
return viewerColumn;
}
示例12: createColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private TableColumn createColumn(final Table table, final TableColumnLayout columnLayout, final String text) {
final TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(text);
column.setMoveable(true);
columnLayout.setColumnData(column, new ColumnWeightData(50, true));
return column;
}
示例13: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private static TableViewerColumn createTableViewerColumn(
TableViewer viewer, String title, int bound) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(bound);
column.setResizable(true);
column.setMoveable(true);
return viewerColumn;
}
示例14: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
public static TableViewerColumn createTableViewerColumn(TableViewer viewer, int style, String text, int width) {
TableViewerColumn tvc = new TableViewerColumn(viewer, style);
// TableColumn col = new TableColumn(viewer.getTable(), style);
TableColumn col = tvc.getColumn();
col.setText(text);
col.setWidth(width);
col.setResizable(true);
col.setMoveable(true);
return tvc;
}
示例15: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private TableViewerColumn createTableViewerColumn(final String title, final int colNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setResizable(true);
column.setMoveable(true);
column.addSelectionListener(createSelectionAdapter(column, colNumber));
return viewerColumn;
}