Eclipse RCP 从对话框禁用视图
我有一个简单的 RCP 应用程序。我添加了一个视角和三个视图。最初,其中一个视图将对用户禁用。有一个启动对话框的工具栏项。用户在对话框中验证自己的身份。身份验证成功后,我想让视图可编辑。我可以在对话框中获取该特定视图的引用。但我不知道如何启用它。我无法使用选择侦听器,因为我没有选择任何内容。我还看到了一个关于使用活动扩展的示例。但这会打开/关闭视图,而不仅仅是启用/禁用它。有人可以帮助我吗?谢谢。
I have a simple RCP application. I have a perspective and three views added to it. Initially one of the view will be disabled for the users. There is a toolbar item which launches a dialog. User authenticates himself in the dialog. After successful authentication, I want to make the view editable. I could get the reference of that specific view in my dialog.But I dont know how to enable it. I could not use selection listener as I am not selecting anything. Also I saw an example about using activities extension. But that opens/closes the view and not just enable/disable it. Can someone help me? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我了解,您希望以两种状态之一显示视图:如果用户未经过身份验证则禁用,或者在用户已通过身份验证时启用。
这实际上非常简单:-),我为您制作了一个小示例应用程序来说明该技术: so-edi.zip
已更新,包含新链接
As I understand you, you want to show the view in one of two states: either disabled if the user is not authenticated, or enabled when the user has been authenticated.
This is actually pretty easy :-) and I have made a small example application for you that illustrates the technique: so-edi.zip
UPDATED with new link
在 RCP 3.x 中,您必须在 ViewPart 的实现中公开视图控件的启用状态:
In RCP 3.x you have to expose the View's Control's enabled state in your implementation of ViewPart: