在jface的tableviewer中,怎么通过双击事件得到点击的是哪个单元格?
来源:百度知道 编辑:UC知道 时间:2024/06/18 02:34:23
我来试试:
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
public class Test {
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setSize(450, 300);
shell.setText("Test");
final Label label = new Label(shell, SWT.NONE);
label.setBounds(50, 178, 311, 60);
TableViewer tableViewer = new TableViewer(shell, SWT.BORDER
| SWT.FULL_SELECTION);
final Table tabl