在 GWT 列表框中添加列表
我添加了一个列表框,并且有一个需要在列表框中填充的值列表。我能找到的将值添加到列表框的唯一选项是 listbox.addItem... 我必须迭代我拥有的值列表并需要将其一一添加。有没有其他方法可以在一次调用中添加整个列表??
private final List<Operation> numberComparisons = Arrays.asList(Operation.EQUAL, Operation.GREATER_THAN, Operation.GREATER_THAN_OR_EQUAL, Operation.LESS_THAN, Operation.LESS_THAN_OR_EQUAL, Operation.FILLED_IN, Operation.EMPTY);
现在我必须将此数字比较列表添加到
ListBox conditionDropDown = new ListBox();
conditionDropDown.addItem(numberComparisons);
......我该怎么做......???
I have added an List box and and i have an list of value that needs to be populated in the list box. The only option i could find to add values to the list box is listbox.addItem... where i have to iterate the list of values i have and need to add it one by one. Is there any other way where i can add the entire list in one single call.??
private final List<Operation> numberComparisons = Arrays.asList(Operation.EQUAL, Operation.GREATER_THAN, Operation.GREATER_THAN_OR_EQUAL, Operation.LESS_THAN, Operation.LESS_THAN_OR_EQUAL, Operation.FILLED_IN, Operation.EMPTY);
now i have to add this number comparisons list into
ListBox conditionDropDown = new ListBox();
conditionDropDown.addItem(numberComparisons);
..... how can i do this...???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许试试这个:
最后:
Maybe try this:
and finally:
查看 ValueListBox 小部件;然后,您将使用
Renderer
来“生成”您的Operation
的String
表示形式(用于在列表中向用户显示它们) 。Have a look at the ValueListBox widget; you'll then use a
Renderer
to "generate" theString
representation of yourOperation
(used to display them to the user in the list).