简体   繁体   中英

Eclipse TreeViewer/ViewPart background click

I am developing a flashcard application using eclipse. I have a TreeViewer in a ViewPart, and I use it to display various categories. However, I cannot find a way to process a background click event. I do not have much experience with eclipse development, so maybe background is the wrong word.

I need something like this:

TreeViewer.setOnBackGroundClickListener(new ClickListener() {});

Screenshot

在此输入图像描述

You must use the SWT layer:

TreeViewer.getTree().addMouseListener(new MouseListener() {...});

With this method I get notified of the click even outside the selection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM