Eclipse RCP:作为产品运行时为什么视图丢失?

发布于 2024-10-03 13:26:32 字数 566 浏览 0 评论 0原文

我正在通过尝试增强我一年前的侧 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 技术交流群。

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

发布评论

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

评论(2

も让我眼熟你 2024-10-10 13:26:32

好吧,在漫无目的地点击之后,我找到了解决方案。需要清除工作区数据才能从角度获取更改。

为此...

  1. 右键单击产品文件
  2. 选择“运行配置...”
  3. 在“主”选项卡下,选中“清除”复选框和“工作区”单选按钮。
  4. 运行它。

希望这能让你们中的一些人摆脱麻烦。

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...

  1. Right click the product file
  2. Choose "Run Configurations..."
  3. Under "Main" tab, check "Clear" checkbox and "workspace" radio button.
  4. Run it.

Hope this will save some of you from troubles.

蒗幽 2024-10-10 13:26:32

我已经被这个问题困扰了好几次,直到我找到了最简单的解决方法:重置视角就足够了。有两种方法可以实现此目的:

  1. 右键单击右上角的透视选择器栏中的透视,然后单击重置
  2. 切换到您的视角,然后转到Window |重置视角...

之后,你的观点的变化应该会被注意到。

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:

  1. Right-click on your perspective in the perspective selector bar at the top right and click on Reset.
  2. Switch to your perspective and then go to Window | Reset perspective....

After that, the changes to your perspective should be picked up.

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