eclipse-plugineclipse-rcprcpcnf

How to use the Common Navigator Framework with checkboxes


When I use Common Navigator Framework, I can not find how to let it support check boxes just like TreeViewer.

At the beginning, I intend to use Check Tree View, but it can not take full advantage of RCP mechanism, so I decide use Common Navigator Framework....


Solution

  • 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 ); 
    }