组合字段编辑器。动态改变值
我正在开发一个 Eclipse RCP 项目。当我完成演练时,我遇到了偏好页面并开始解决它。
现在我需要动态更改 ComboFieldEditor
的值。就像当我在 TextFieldEditor
上进行选择时,ComboFieldEditor
的值必须更改。我尝试寻找答案,甚至尝试了在 Stack Overflow 上找到的解决方案之一,但最终总是得到 NullPointerException。有人可以在这方面帮助我吗?
从技术上讲,我想动态更改 ComboFieldEditor
中的值。就像,当触发侦听器时,我想将新值放入组合框中。我尝试了这个解决方案,但我不断收到NullPointerException< /代码>。
I am working on an eclipse RCP project. As I was going through the walkthroughs I came across preference page and started working around it.
Now I need to change the values of the ComboFieldEditor
dynamically. As in when I make a selection on a TextFieldEditor
the values of the ComboFieldEditor
must change. I tried searching for an answer and even tried one of the solutions I found on Stack Overflow, but I always ended up with NullPointerException
. Can someone help me in this regard?
Technically I want to change the values in the ComboFieldEditor
dynamically. As in, when a listener is triggered I want to put new values in my combobox. I tried this solution but I kept getting a NullPointerException
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的。这是我暂时做的事情。
我创建了一个名为 CustomComboFieldEditor 的类,并添加了 ComboFieldEditor 中存在的所有方法。我更改了有助于在组合框中输入值的方法。目前为止对我来说效果很好。
我确信这不是所有方法中最漂亮的,我敢打赌我会因为这个解决方案而被钉死在十字架上,但时间和情况迫使我使用它。任何方式将不胜感激。
谢谢 :)
Ok. This is something that I did for the time being.
I created a class named CustomComboFieldEditor and added all the methods present in the ComboFieldEditor. I changed the methods that helped to input the values in the combo box. Works fine for me as of now.
I am sure its not the prettiest of all ways and I bet I would be crucified for this solution, but time and situation forced me into using it. Anyother way would be appreciated.
Thanks :)