我正在使用Eclipse Standard Widget Toolkit( SWT ),我有一个包含项目的TreeView对象,并且双击事件( addDoubleClickListener )可以正常工作,但是我不知道如何实现右键单击以删除项目。
To listen to right clicks, use addMenuListener
. Eclipse RCP has its own more advanced mechanisms, but this should be enough for your purposes.
In SelectionListener
for your MenuItem
, remove the item from your model and refresh the viewer.
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.