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
Related
So I've come across this weird bug in RCP Apps.
I've created a new RCP App with the Mail Template. I've added a new org.eclipse.ui.menus extension with a menuContribution with locationURI:toolbar:org.eclipse.ui.main.toolbar. To that, I've added a command with a little icon.
Now, if I start the app without Clear Workspace in the Debug Configurations, my action appears AFTER the Quick Access text widget. Not only that, but a few other bugs come along (e.g. views aren't closing, too many views are opening at once). This is not a one-time thing, i.e. I have to start the app with Clear Workspace each time.
This method of adding actions on the coolBar is non-deprecated. Why does it behave like a spoiled brat?
Without Clear Workspace:
With Clear Workspace:
There is a long discussion on the Eclipse forums about this here with a bug filed as a result here.
The bug is not scheduled to be fixed until Eclipse 4.4M5 but using one of the workarounds to remove the Quick Access control discussed here should help.
I want to Refresh Navigation View in eclipse application. The project explorer in the eclipse application does not show the projects , untill it is refreshed or right clicked on it. How to refresh it programmatically? And where to put this code?
If at all possible you should use the create methods of org.eclipse.core.resources.IFile and IFolder to create files and folders.
If that is not possible use the refreshLocal method of IProject or IFolder to update the workspace.
All these calls will generate one or more IResourceChangeEvent events which will be seen by views and anything else that needs to know about resource changes. The view will update automatically when it sees these events.
To reduce the number of resource change events generated enclose your modifications in a WorkspaceJob or WorkspaceModifyOperation or IWorkspaceRunnable.
Thanks for the reply #greg-449. refreshLocal is useful, but i was missing a small piece of code and refrshing was not needed. Eventually i figured out the answer. I had to ovverride a function as I mentioned in one of my comments. I was trying to use the getDefaultPageInput in a wrong way and hence i was getting errors. Eventually i removed the erroneous code in my project and added following to WorkbenchAdvisor.java
#Override
public IWorkspaceRoot getDefaultPageInput()
{
return ResourcesPlugin.getWorkspace().getRoot();
}
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.
I have created two views for eclipse. Each of this views is launched using a different run configuration (meaning a different one for each view).
What I want to do:
In the first view I have a list of elements. When I double click one element I want to start the other view (maybe from its run configuration) and only then to start all the bundles.
Any clue of how to do this?
Besides, I would like to send some parameters from the first view to the second one when launching.
I hope anyone can help.
The Eclipse run configuration is list of complex settings including Main class, VM arguments, JRE paths, and Classpath. The Eclipse view, in your words, is the perspective which contains various window panes; I think that's what you mean. The 2 concepts of run configuration and perspective/view are separate implementations of Eclipse, and not related.
So…what you’re asking seems impossible for Eclipse to do and not fitting to its design.
I propose you include your source folders into the Package Explorer workspace, which is basically just a file system. Afterwards, open/close the project folder when you want to change the views, using your words. I myself switch between 2 rather different projects between pure Java and Swing, and both contain their own Main function, for testing code in StackOverflow. I think this is similar to your goal.
I am not sure what you meant by “list of elements” in Eclipse. And I may not understand your exact problem.
I want to create an eclipse RCP application for a custom language. A programs which is written using the cutom language should be run and show it's output when the user click on the Run button.
Is it possible to integrate eclipse Run menu in eclipse RCP application with it's default features as we create NEW menu item by using ActionFactory? If it is possible how to do that?
Thanks in advance.
If you "just" want the Run menu along with the default entries, just include a dependency to org.eclipse.debug.ui.
You will then need to add launch configuration types for your specific language using the various extension point from the plugins org.eclipse.debug.core and org.eclipse.debug.ui.
As always, when it comes to the more advanced functionality of Eclipse, the easiest way to get access to the functionality is via resources and examples. Although it is a bit dated, the article "We Have Lift-off" (http://www.eclipse.org/articles/Article-Launch-Framework/launch.html) is the best starting point for this. Have a look at the various references to org.eclipse.debug.core.launchConfigurationTypes to find the best example to use asa starting point - in particular the ANT Build stuff as this is pretty simple...
In general you can find the plug-in that contributes a specific entry using the PDE Menu Spy (Alt-Shift-F2 on MacOS)...