本文整理匯總了Java中org.eclipse.swt.widgets.Table.addMouseListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.addMouseListener方法的具體用法?Java Table.addMouseListener怎麽用?Java Table.addMouseListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Table
的用法示例。
在下文中一共展示了Table.addMouseListener方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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());
}
});
}
示例2: createTable
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
@Override
protected Table createTable(IManagedForm managedForm, Composite client) {
final Table table = super.createTable(managedForm, client);
table.setLinesVisible(false);
ElementTypes elementTypes = new ElementTypes();
elementTypes.add(ZnodeModel.class, _ZnodeModelElementType);
_TableViewer = ViewerFactory.createDataModelTableViewer(table, elementTypes, null);
makeTableActions();
hookTableContextMenu();
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
getSite().getWorkbenchWindow().getActivePage().activate(getEditor());
// if (table.getItem(new Point(e.x, e.y)) == null) {
// _TableViewer.setSelection(null);
// }
}
});
return table;
}