Win7 上的 CheckboxTableViewer 中的选择不起作用
我尝试使用 org.eclipse.jface.viewers.CheckboxTableViewer 作为 org.eclipse.jface.wizard.WizardPage 的组件。我是这样创建的:
public void createControl(Composite parent) {
composite = new Composite(parent, SWT.NULL);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
composite.setLayout(gridLayout);
setControl(composite);
/* CheckboxTableViewer */
viewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
final Table table = viewer.getTable();
GridData data1 = new GridData();
data1.grabExcessHorizontalSpace = true;
data1.grabExcessVerticalSpace = true;
data1.horizontalSpan = 2;
data1.horizontalAlignment = SWT.FILL;
data1.verticalAlignment = SWT.FILL;
table.setLayoutData(data1);
table.setHeaderVisible(true);
table.setLinesVisible(true);
checkboxColumn = new TableColumn(table, SWT.LEFT);
...
查看器的内容由内容提供者动态插入。在 gnome 上一切正常。在 Windows 7(也包括 64 位和 32 位)上测试此功能时,我无法选择该视图的任何条目。鼠标点击似乎对视图没有影响。 我向表中添加了一个鼠标侦听器,并且触发了 mouseUp-/Down 事件,但未触发查看器上的选择更改和双击事件。谁能向我解释这种行为?
提前致谢,
哈格
(我已经在 Eclipse 论坛中发布了这个问题,但尚未做出任何回应: http://www.eclipse.org/forums/index.php/t/250953/)
i try to use an org.eclipse.jface.viewers.CheckboxTableViewer, as a component of a org.eclipse.jface.wizard.WizardPage. I created it this way:
public void createControl(Composite parent) {
composite = new Composite(parent, SWT.NULL);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
composite.setLayout(gridLayout);
setControl(composite);
/* CheckboxTableViewer */
viewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
final Table table = viewer.getTable();
GridData data1 = new GridData();
data1.grabExcessHorizontalSpace = true;
data1.grabExcessVerticalSpace = true;
data1.horizontalSpan = 2;
data1.horizontalAlignment = SWT.FILL;
data1.verticalAlignment = SWT.FILL;
table.setLayoutData(data1);
table.setHeaderVisible(true);
table.setLinesVisible(true);
checkboxColumn = new TableColumn(table, SWT.LEFT);
...
the content of the viewer is inserted dynamically by a contentprovider. Everything works fine on gnome. While testing this on windows 7 (64 and 32 bit also), i am not able to select any entries of that view. Mouseclicks just seems to have no impact on the view.
I added a mouselistener to the table, and the mouseUp-/Down event is fired, selectionChanged and doubleClick on the viewer is not fired. Anyone who can explain this behaviour to me?
thx in advance,
hage
(i already posted this question in the eclipse forum without any response yet: http://www.eclipse.org/forums/index.php/t/250953/ )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在创建 CheckboxTableViewer 时添加另一个样式标志:SWT.FULL_SELECTION
您现在可以通过单击来选择表中的行。
You have to add another style flag while creating the CheckboxTableViewer: SWT.FULL_SELECTION
You can now select rows in the table by a single clicking.