我试图在SWT TabFolder中嵌入一个JFace TableViewer,但是当我这样做时,表格没有显示出来.我的GitToDo代码中的当前(工作代码)看起来像(请参阅此Git repos):
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setText("Git ToDo");
FillLayout layout = new FillLayout();
shell.setLayout(layout);
final GitToDoTree tableViewer = new GitToDoTree(shell);
Run Code Online (Sandbox Code Playgroud)
后者GitToDoTree 扩展TableViewer,使用此构造函数:
super(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.FILL);
this.shell = parent;
table = this.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
Run Code Online (Sandbox Code Playgroud)
因此,当我从Shell构建TableViewer扩展GitToDoTree时,它可以工作,但是一旦我尝试从TabFolder构建它或者(也尝试过)一个Composite,就不会再显示任何内容了.
如何让我的TableViewer显示在TabFolder中?
如何在项目上添加鼠标右键单击侦听器TableViewer?
如果将鼠标悬停在太窄的表格单元格上,则会出现某种弹出窗口.如何检测OwnerDrawLabelProvider.paint()(截断的)表格单元格是否被绘制或弹出窗口?
我无法找到任何用于CheckBoxTableCella的示例,TableViewerColumn如果有人可以提供示例实现,我将非常感激.
我已经有一个显示一些字符串值的工作模型,但我无法将一个布尔值表示为复选框.
甚至可以在TableViewerColumn中显示除String之外的任何其他内容吗?
这一点必须是显而易见的,但我已经搜索了很多年,并且在任何地方都找不到它.我正在创建一个SWT TableViewer,我希望在我的单元格周围有边框.我该怎么做呢?无论我尝试什么,我的细胞总是无边界的,很难分辨出一个细胞的结束和另一个细胞的开始.我的代码:
TableViewer outputViewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
outputViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
TableViewerColumn col = new TableViewerColumn(outputViewer, SWT.LEFT | SWT.BORDER);
col.getColumn().setWidth(200);
col.getColumn().setText("Output");
col.getColumn().setResizable(true);
col.setLabelProvider(new ColumnLabelProvider());
Run Code Online (Sandbox Code Playgroud)