3

当我使用 Common Navigator Framework 时,我找不到如何让它像 TreeViewer 一样支持复选框。

一开始打算用Check Tree View,但是不能充分利用RCP机制,所以决定用Common Navigator Framework....

4

1 回答 1

1

As Greg commented, this question has been answered on the Eclipse Forum.

In order to create a CommonViewer with check boxes, you need to override createCommonViewerObject like this:

protected CommonViewer createCommonViewerObject( Composite parent ) {
  int treeStyle = SWT.CHECK | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL; 
  return new CommonViewer( getViewSite().getId(), parent, treeStyle ); 
} 
于 2015-12-15T15:00:41.090 回答