本文整理汇总了Java中org.eclipse.swt.widgets.Table.setHeaderVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Table.setHeaderVisible方法的具体用法?Java Table.setHeaderVisible怎么用?Java Table.setHeaderVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Table
的用法示例。
在下文中一共展示了Table.setHeaderVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.swt.widgets.Table; //导入方法依赖的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: createTableSection
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
protected Section createTableSection(ScrolledForm form, Composite client, FormToolkit toolkit, String title,
Image image, int sectionStyle, int tableStyle, String[] columnTitles, int[] columnAlignments) {
Section section = createSection(form, client, toolkit, title, image, sectionStyle);
Table table = toolkit.createTable(section, tableStyle);
for (int i = 0; i < columnTitles.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(columnTitles[i]);
column.setAlignment(columnAlignments[i]);
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
section.setClient(table);
return section;
}
示例3: createTableColumns
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
protected void createTableColumns() {
Table table = getTable();
if (table == null) {
return;
}
String[] titles = getTableColumnTitles();
if (titles != null && titles.length > 0) {
int[] columnAlignments = getTableColumnAlignments();
for (int i = 0; i < titles.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(titles[i]);
if (columnAlignments != null) {
column.setAlignment(columnAlignments[i]);
}
}
table.setHeaderVisible(true);
}
}
示例4: createTableColumns
import org.eclipse.swt.widgets.Table; //导入方法依赖的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);
}
示例5: createTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
/**
* This method initializes table
*
*/
private void createTable() {
int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL |
SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
table = new Table(this, style);
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.grabExcessVerticalSpace = true;
gridData.horizontalSpan = 3;
table.setLayoutData(gridData);
table.setLinesVisible(true);
table.setHeaderVisible(true);
}
示例6: createTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void createTable(Composite parent) {
GridData gridData = new GridData();
gridData.horizontalSpan = numColumns;
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = GridData.FILL;
table = new Table(parent, SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLayoutData(gridData);
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例7: createTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void createTable() {
GridData gridData = new org.eclipse.swt.layout.GridData();
gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
table = new Table(this, SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLayoutData(gridData);
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例8: createTableColumns
import org.eclipse.swt.widgets.Table; //导入方法依赖的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: createTableViewer
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
public TableViewer createTableViewer(Composite composite, String[] prop,
int[] bounds, int columnWidth,
IStructuredContentProvider iStructuredContentProvider,
ITableLabelProvider iTableLabelProvider) {
final TableViewer tableViewer = new TableViewer(composite, SWT.BORDER
| SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
Table table = tableViewer.getTable();
table.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
tableViewer.setContentProvider(iStructuredContentProvider);
tableViewer.setLabelProvider(iTableLabelProvider);
tableViewer.setColumnProperties(prop);
tableViewer.getTable().addTraverseListener(new TraverseListener() {
@Override
public void keyTraversed(TraverseEvent e) {
if (e.keyCode == SWT.ARROW_UP) {
e.doit = false;
} else if (e.keyCode == SWT.ARROW_DOWN) {
e.doit = false;
} else if (e.keyCode == SWT.TRAVERSE_ARROW_NEXT) {
e.doit = false;
} else if (e.keyCode == SWT.TRAVERSE_ARROW_PREVIOUS) {
e.doit = false;
}
}
});
table.setVisible(true);
table.setLinesVisible(true);
table.setHeaderVisible(true);
/*
* createTableColumns(table,prop, columnWidth); CellEditor[] editors
* =createCellEditorList(table,1); tableViewer.setCellEditors(editors);
*/
return tableViewer;
}
示例10: createTableColumns
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
public void createTableColumns(Table table, String[] fields, int width) {
for (String field : fields) {
TableColumn tableColumn = new TableColumn(table, SWT.LEFT);
tableColumn.setText(field);
tableColumn.setWidth(width);
// tableColumn.pack();
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例11: createControl
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
container = new Composite(parent, SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
setControl(container);
container.setLayout(new GridLayout(1, false));
grpSchemaPreview = new Group(container, SWT.NONE);
grpSchemaPreview.setText(SCHEMA_PREVIEW);
grpSchemaPreview.setLayout(new GridLayout(1, false));
grpSchemaPreview.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
composite = new Composite(grpSchemaPreview, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
availableFieldTableViewer=new TableViewer(composite,SWT.BORDER);
TableViewerColumn availableFieldsColumn = new TableViewerColumn(availableFieldTableViewer, SWT.NONE);
availableFieldsColumn.setLabelProvider(new AvailableFieldsColumnLabelProvider());
TableColumn tableColumn = availableFieldsColumn.getColumn();
tableColumn.setText(AVAILABLE_FIELDS);
Table table=availableFieldTableViewer.getTable();
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
table.setLinesVisible(true);
table.setHeaderVisible(true);
addControlListener(table, tableColumn);
}
示例12: createTableColumns
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
public static void createTableColumns(Table table, String[] fields) {
for (String field : fields) {
TableColumn tableColumn = new TableColumn(table, SWT.FILL);
tableColumn.setText(field);
tableColumn.setWidth(100);
tableColumn.pack();
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例13: createMappingTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private Table createMappingTable(Composite composite_6) {
mappingTableViewer = new TableViewer(composite_6, SWT.BORDER
| SWT.FULL_SELECTION | SWT.MULTI);
Table table = mappingTableViewer.getTable();
table.setLinesVisible(true);
table.setHeaderVisible(true);
GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
gd_table.widthHint = 374;
table.setLayoutData(gd_table);
mappingTableViewer.setContentProvider(new ArrayContentProvider());
ColumnViewerToolTipSupport.enableFor(mappingTableViewer);
return table;
}
示例14: createSourceTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void createSourceTable(Composite composite_2) {
sourceTable = new Table(composite_2, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
sourceTable.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
if(sourceTable.getSelection().length==1){
addNewProperty(targetTableViewer, sourceTable.getSelection()[0].getText());
enableControlButtons();
}
}
});
GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
gd_table.widthHint = 221;
gd_table.heightHint = 407;
sourceTable.setLayoutData(gd_table);
sourceTable.setHeaderVisible(true);
sourceTable.setLinesVisible(true);
TableColumn sourceTableColumnFieldName = new TableColumn(sourceTable, SWT.LEFT);
if(OSValidator.isMac()){
sourceTableColumnFieldName.setWidth(212);
}else{
sourceTableColumnFieldName.setWidth(202);
}
sourceTableColumnFieldName.setText(Messages.AVAILABLE_FIELDS_HEADER);
getSourceFieldsFromPropagatedSchema(sourceTable);
dragSource = new DragSource(sourceTable, DND.DROP_MOVE);
dragSource.setTransfer(new Transfer[] { TextTransfer.getInstance() });
dragSource.addDragListener(new DragSourceAdapter() {
public void dragSetData(DragSourceEvent event) {
// Set the data to be the first selected item's text
event.data = formatDataToTransfer(sourceTable.getSelection());
}
});
}
示例15: createTableColumns
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
public static void createTableColumns(Table table, String[] fields) {
for (String field : fields) {
TableColumn tableColumn = new TableColumn(table, SWT.LEFT);
tableColumn.setText(field);
tableColumn.setWidth(100);
tableColumn.pack();
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
}