Eclipse RCP:作为产品运行时为什么视图丢失?
我正在通过尝试增强我一年前的侧 RCP 应用程序来提高我的 Eclipse RCP 技能。该应用程序有一个透视图,该透视图有 3 个视图,我将在同一透视图中添加另一个视图。为了添加这个新视图,我将其添加到“扩展”选项卡下的 MANIFEST.MF 文件中,并为其创建了 Java 文件。
当我将它作为应用程序运行时,它可以工作。我在应用程序中看到了所有 4 个视图。但是,当我将其作为产品运行时,该新视图丢失了。看起来新视图几乎没有在产品中注册。控制台日志中也没有错误。我想我一定在这里错过了一步,但我似乎无法弄清楚......非常令人沮丧!
注意: 视图以编程方式(在 Java 代码中)添加到透视图中,而不是通过 MANIFEST.MF 文件。我刚刚意识到,即使我更改现有视图的布局(例如:大小或位置),它在作为产品运行时也不会得到反映,但在作为应用程序运行时它可以工作......叹息!
注意:我注释掉了透视类中的所有代码,换句话说,所有视图都从透视中删除。当我启动产品时,我仍然在应用程序中看到 3 个视图。我认为这与缓存有关,但我现在很沮丧。
非常感谢任何帮助!非常感谢,
I'm brushing up my Eclipse RCP skill by trying to enhance my one-year-old side RCP application. This application has one perspective, and this perspective has 3 views, and I'm adding another view into the same perspective. To add this new view, I added it in the MANIFEST.MF file under Extensions tab and created the Java file for it.
When I run it as an Application, it works. I see all 4 views in the application. But, when I run it as a Product, that new view is missing. It almost seems like the new view is not registered in the Product. There's no error in the console log either. I think I must be missing a step here, but I can't seem figure out here... pretty frustrating!
Note: The views are added into the perspective programmatically (in Java code), not through MANIFEST.MF file. I just realized that even when I change the existing view's layout (ex: size, or location), it doesn't get reflected when running as a Product either, but it works when running as an Application... sigh!
Note: I commented out all the code in my perspective class, in another word, all the views are removed from the perspective. When I launch the Product, I'm still seeing 3 views in the application. I'm thinking there's something to do with caching, but I'm just bummed now.
Any helps are greatly appreciated here! Thanks much,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,在漫无目的地点击之后,我找到了解决方案。需要清除工作区数据才能从角度获取更改。
为此...
希望这能让你们中的一些人摆脱麻烦。
Okay, after aimlessly clicking around, I figured out the solution. The workspace data needs to be cleared to pick up changes from the perspective.
To do so...
Hope this will save some of you from troubles.
我已经被这个问题困扰了好几次,直到我找到了最简单的解决方法:重置视角就足够了。有两种方法可以实现此目的:
之后,你的观点的变化应该会被注意到。
I've been bitten by this a couple of times until I figured out the easiest workaround: it's sufficient to reset the perspective. There are two ways to achieve this:
After that, the changes to your perspective should be picked up.