组合字段编辑器。动态改变值

发布于 2024-12-29 13:08:32 字数 511 浏览 1 评论 0原文

我正在开发一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若水般的淡然安静女子 2025-01-05 13:08:32

好的。这是我暂时做的事情。
我创建了一个名为 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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文