Eclipse SWT : Multi Select Widget from left column to right column

感情迁移 提交于 2019-12-11 04:36:27

问题


I am developing a plugin that uses SWT. In one of the windows of the plugin I need to add widgets that look like the one above.I could not find an appropriate name, so, the image.

What it does is, selects the items from left column to the right column and vice versa using the buttons in the middle. Once the items are moved, they are removed from the left column and added to the right column and vice versa.

Question 1: What is the exact name for this setup?
Question 2: Is there any existing swt class that implements this setup I can reuse?


回答1:


Have a look at DualList from the opal project. This should be exactly what you want.

If you want to do it yourself, use either two Tables with just one column each, or two Lists.

The layout would be:

Composite(GridLayout, 3 columns)
|
|- First List/Table
|
|- Composite(GridLayout, 1 column)
|  |- Button add
|  |- Button addAll
|  |- Button delete
|  |- Button deleteAll
|
|- Second List/Table

Edit:

As a matter of fact, is designed something very similar as an answer to a different question. Have a look at my answer here.



来源:https://stackoverflow.com/questions/12999092/eclipse-swt-multi-select-widget-from-left-column-to-right-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!