开发者

Eclipse RCP: Why is the view missing when running as a Product?

开发者 https://www.devze.com 2023-01-26 17:21 出处:网络
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 in

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! Than开发者_C百科ks much,


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消