本文整理汇总了Java中org.eclipse.jface.viewers.TableViewerColumn类的典型用法代码示例。如果您正苦于以下问题:Java TableViewerColumn类的具体用法?Java TableViewerColumn怎么用?Java TableViewerColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableViewerColumn类属于org.eclipse.jface.viewers包,在下文中一共展示了TableViewerColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的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: createSourceTable
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private void createSourceTable(SashForm sashForm) {
avaliableFieldTableViewer = new TableViewer(sashForm, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
table_1 = avaliableFieldTableViewer.getTable();
table_1.setLinesVisible(true);
table_1.setHeaderVisible(true);
avaliableFieldTableViewer.setContentProvider(new IStructuredContentProvider() {
@Override
public Object[] getElements(Object inputElement) {
return ((List) inputElement).toArray();
}
});
avaliableFieldTableViewer.setInput(schemaFields);
TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(avaliableFieldTableViewer, SWT.NONE);
TableColumn tblclmnNewColumn_2 = tableViewerColumn_2.getColumn();
tblclmnNewColumn_2.setWidth(196);
tblclmnNewColumn_2.setText(Messages.AVAILABLE_FIELDS_HEADER);
tableViewerColumn_2.setLabelProvider(new ColumnLabelProvider());
attachDragListener();
}
示例3: createTableColumns
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private TableViewer createTableColumns(Composite tableComposite) {
TableViewer tableViewer = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION);
excelFormatterTable = tableViewer.getTable();
excelFormatterTable.setHeaderVisible(true);
excelFormatterTable.setLinesVisible(true);
excelFormatterTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
TableColumn parameterNameColumn = tableViewerColumn.getColumn();
parameterNameColumn.setWidth(254);
parameterNameColumn.setText(Messages.PARAMETER_NAME);
tableViewerColumn.setLabelProvider(new ParameterNameLabelProvider());
TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
TableColumn parameterValueColumn = tableViewerColumn_1.getColumn();
parameterValueColumn.setWidth(251);
parameterValueColumn.setText(Messages.PARAMETER_VALUE);
tableViewerColumn_1.setLabelProvider(new ParameterValueLabelProvider());
return tableViewer;
}
示例4: createTableControl
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private void createTableControl(Composite container) {
tableViewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.BORDER);
String[] columnIndex = new String[] { "主键", "外键", "列名", "名称", "类型", "不能为空", "是否唯一" };
Integer[] columnWidth = new Integer[] { 40, 40, 120, 120, 120, 80, 80 };
Integer[] columnAlign = new Integer[] { SWT.CENTER, SWT.CENTER, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.CENTER, SWT.CENTER };
for (int i = 0; i < columnIndex.length; i++) {
TableViewerColumn choice = new TableViewerColumn(tableViewer, SWT.BORDER);
choice.getColumn().setText(columnIndex[i]);
choice.getColumn().setWidth(columnWidth[i]);
choice.getColumn().setAlignment(columnAlign[i]);
}
tableViewer.getTable().setHeaderVisible(true);
tableViewer.getTable().setLinesVisible(true);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 4;
tableViewer.getTable().setLayoutData(gd);
tableViewer.setContentProvider(new ArrayContentProvider());
tableViewer.setLabelProvider(new TableColumnLabelProvider());
tableViewer.setInput(model.getColumns());
}
示例5: createColumns
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的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);
}
示例6: createColumns
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的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 ) );
}
示例7: createColumns
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的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);
}
示例8: ColumnViewerSorter
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
public ColumnViewerSorter(ColumnViewer viewer, TableViewerColumn column) {
this.column = column;
this.viewer = viewer;
this.column.getColumn().addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if( ColumnViewerSorter.this.viewer.getComparator() != null ) {
if( ColumnViewerSorter.this.viewer.getComparator() == ColumnViewerSorter.this ) {
int tdirection = ColumnViewerSorter.this.direction;
if( tdirection == ASC ) {
setSorter(ColumnViewerSorter.this, DESC);
} else if( tdirection == DESC ) {
setSorter(ColumnViewerSorter.this, NONE);
}
} else {
setSorter(ColumnViewerSorter.this, ASC);
}
} else {
setSorter(ColumnViewerSorter.this, ASC);
}
}
});
}
示例9: createColumn
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的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);
}
示例10: createTableViewerColumn
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) tableViewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例11: createTableViewerColumn
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width,
int alignment, boolean resizable, boolean moveable,
final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, 20,
resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
sorter.setColumn(column);
}
});
return viewerColumn;
}
示例12: createTableViewerColumn
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, 10, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例13: createTableViewerColumn
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例14: createTableViewerColumn
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable,
boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例15: createTableViewerColumn
import org.eclipse.jface.viewers.TableViewerColumn; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(30, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}