I am using Eclipse Juno for RCP RAP developer. I have created a Plug-in Project with a single view and it runs normally. But whenever I tried to add a new view into that workbench, the window dosent update. Also if I change the id of the current view, it also not working. And if I delete the current view, it also showing it. As a whole, the view part is not updating of the application. Anybody knows any answer ?
Your changes doesn't get applied correctly.
Eclipse 4 persists certain user changes in your application. During
development this might lead to situations where changes are not
correctly applied and displayed, e.g. you define a new menu entry and
this entry is not displayed in your application.
You have to add -clearPersistedState as a program argument for your application or set the Clear flag in the Main tab of your Run configuration.
Take a look here for further information and a more detailed description.
Related
I am using the following code to set the selection provider outside the createpartcontrol method of the view, my project view is restricted wherein the createpartcontrol is a generic and I will not be able to use the selection provider inside it. The following code does not work with enabling menu by property testers where in I am using <enabled when> variable="selection" </enabled when> when the view loads initially but when click outside the view and click backed into the view then property testers works fine and my menu items get enabled.
Also I found this post in the eclipse documentation that Replacing the selection provider during the lifetime of the part is not properly supported by the workbench :
https://eclipse.org/articles/Article-WorkbenchSelections/article.html
Not sure where am i going wrong? Could someone provide some help with respect to this.
Also when i debug through eclipse it goes through this part of the code and everything works fine , but when run as an application outside debug mode the issue occurs.
IWorkbenchWindow iw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
iw.getActivePage().getActivePart().getSite().setSelectionProvider(objectComposite.getViewer());
Once upon a time I used Eclipse and I discovered this wonderful thing called working sets.
Now I am using Eclipse Luna and it looks like I have to relearn all about Working Sets again. Because nothing works like before.
On my journey to relearn all about working sets, some folks said that I should go to Customize Perspective.. and add the window working command group. I did that.
Then I created three working sets which each contained different projects. It kind of looks like this :
Now, I thought, this is where the fun begins.
Excitedly, I navigated to the Window menu and selected all three working sets.
Astonishingly nothing happened. I used to be able to see multiple working sets at the same time. What happened?
If you want to see the projects split in to Working Sets in the Project Explorer view you need to open the Project Explorer view menu (the small down arrow at the top right of the view) and select 'Top Level Elements > Working Sets'
I have a view that is stacked behind another view on creation. It is supposed to listen for an event and bring itself to the front and populate some data if that data gets set.
However becasue the createPartControl method doesn't get called until the user actually brings it to the front the functionality doesn't work how I'd like,
Is there a way to tell the rcp application that it should instantiate that view on load up?
Assuming you're working with Indigo or Juno and you're developing an RCP application, have you tried one of the methods available on IWorkbenchPage (like activate(…) or showView(…)) ? Basically, knowing your view ID (as defined in the plugin.xml), you can add this code to the postWindowOpen() method of your application WorkbenchWindowAdvisor, so that it is called once the window is opened.
I have an eclipse RCP application based on the 3.x API. My application consists of several perspectives where each contains several views and editors. The first perspective starts on the start up of the application and the navigation view is defined in the main plug-in. The problem is with the other perspectives where the views are defined in different plug-ins for a better code maintenance.
I add my views within the main plug-in with a perspective extension and the following piece of code:
public class Perspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
layout.addView(NavigationView.ID, IPageLayout.TOP,
IPageLayout.RATIO_MAX, IPageLayout.ID_EDITOR_AREA);
}
}
The strange thing is that it all works perfectly when I run the application within eclipse, but as soon as I make a build with Maven/Tycho and execute the created application all the perspectives defined in the plug-ins don't work anymore.
The issue is when I add a new perspective this perspective opens but it doesn't contain any views, just a grey background.
I already added a few println() statements for debugging purposes and it seems as the Activator of my respective plug-in, which contains the view, is never invoked. That would also explain why I cannot see any views in my perspective because the application cannot find the respective view defined in the view extension of the respective plug-in.
I added the following println() statement to my createInitialLayout method from above:
System.err.println(layout.getViewLayout(NavigationView.ID));
The output was null, which strengthen my previous point.
The problem is now what could be the reason for that? Why doesn't my plug-in start?
I also already did another experiment where I directly called one of the methods defined in the plug-in and again the Activator of the plug-in wasn't called.
The Bundle-ActivationPolicy of the plug-in is set to lazy.
Any suggestion what my next steps could be to track the problem down?
Maven/Tycho doesn't report any problems and I use the same target platform for both, eclipse and Maven/Tycho, so I can also exclude any dependency problems.
I really would appreciate any help/support :)
Best regards,
Tom
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,
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...
Right click the product file
Choose "Run Configurations..."
Under "Main" tab, check "Clear" checkbox and "workspace" radio button.
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:
Right-click on your perspective in the perspective selector bar at the top right and click on Reset.
Switch to your perspective and then go to Window | Reset perspective....
After that, the changes to your perspective should be picked up.