本文整理汇总了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;
}