本文整理匯總了Java中org.eclipse.swt.widgets.Table.setBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.setBounds方法的具體用法?Java Table.setBounds怎麽用?Java Table.setBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Table
的用法示例。
在下文中一共展示了Table.setBounds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: createDialogArea
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.getShell().setText("ViewData Execution History");
container.setLayout(new GridLayout(1, false));
Composite composite1 = new Composite(container, SWT.BORDER);
GridData gd_scrolledComposite1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_scrolledComposite1.heightHint = 236;
gd_scrolledComposite1.widthHint = 844;
composite1.setLayoutData(gd_scrolledComposite1);
table = new Table(composite1, SWT.BORDER | SWT.Selection | SWT.FULL_SELECTION );
table.setBounds(0, 0, 842, 234);
table.setHeaderVisible(true);
table.setLinesVisible(true);
for (int i = 0; i < titles.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setWidth(212);
column.setText(titles[i]);
}
jobDetails.sort((job1, job2)-> job2.getUniqueJobID().compareTo(job1.getUniqueJobID()));
for(JobDetails job : jobDetails){
String timeStamp = getTimeStamp(job.getUniqueJobID());
TableItem items = new TableItem(table, SWT.None);
items.setText(0, job.getUniqueJobID());
items.setText(1, timeStamp);
String mode = getJobExecutionMode(job.isRemote());
items.setText(2, mode);
items.setText(3, job.getJobStatus());
}
table.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
TableItem[] item = table.getSelection();
for (int i = 0; i < item.length; i++){
TableItem selectedItem = item[i];
selectedUniqueJobId = selectedItem.getText();
}
}
});
return super.createDialogArea(parent);
}