I've created an Eclipse Plugin clicking New > Plug-in Development > Plug-in Project.
In this project, I've modified the plugin.xml file and added new Views to create an example, and it works succesfully when I press Run button, loading a new Eclipse instance in which I can show my example perspective whit its views. It looks like this, with my additions marked:
MyPerspectiveAndViews
Now I want to create (I don't know what I need exactly) something to execute it without pressing the Run button, something like a Jar file.
I've been taking a look on Internet and I learned that Eclipse provides a tool call Oomph (also called Eclipse Intaller), and with Oomph I should create:
Product Setup Model
Project Setup Model
It seems like de Project Setup Model file can be added to an installation process. So I search for tutorials to do it, like https: / / eclipsesource.com/blogs/tutorials/oomph-basic-tutorial/, getting the setup file, like this:
MySetupFileCreated
But when I create the project setup model, I don't know how to include my example project, so I can't show my perspective with my views.
Anyone knows how to create it in an Eclipse RCP application like this example?
Thanks :)
Related
I created a simple eclipse plugin that just opens a new view from a command in the menu. I am using Eclipse RCP 2018 and when I run the plugin as an application everything looks exactly the same as the java perspective with the menu option added (which is what I want).
When I create a product and run, it looks like a lot of options are gone (e.g no java perspective, can't make a java project, no source option, no refactor, no run, can't change it to dark theme, etc). My custom view/menu is still there but I want it to basically be an addition to what was already there like when I launch it as an application. Is there certain settings or files I can edit to accomplish this?
Probably you do not need your own product definition but just want to add your plugins to Eclipse IDE product. In that case you need to select "org.eclipse.sdk.ide" product to run and ensure your plugins are selected in launch configuration.
If you do need your own product definition for some reason (to show your own branding for example) and still need some functionality from Eclipse IDE - you need to add either features (preferable) or bundles to your product definition.
More details here
Problem: I have created a Desktop Application with Java and SWT/JFace.
The project contains design, action, util and model classes. Created executable jar, All works fine but now i am facing some branding and endorsing issue i.e.
- Minimize should display in task bar.
- Running executable jar is showing as a javaw.exe in task manager list
not with its name.
- On alt + tab application appear as unknown exe
Now I want a suggestion. Can these issue be solved easily without impacting a lot if yes then please provide needed clue? or should I go to Eclipse RCP plugin productization which can handle all above means.
If sole answer is No, Then please suggest an optimize way to migrate to eclipse RCP. it would be nice if you point action list as I am new in such productization.
Update As i have created GUI by SWT/Jface and, using main as entry point I have created its executable jar, is this creating problem that i hav mentioned above?
Looking into Eclipse 4 RCP.
Did the following:
Created an Eclipse Plugin Project (no Rich Client unchecked,
Actvator unchecked) so no classes under /src
Created a Product Configuration. Application selected is
E4Application
Created a Feature Project and include the plugin I created in step
1
In the .product file I checked the configuration to be based on
features. In the dependencies tab I added org.eclipse.e4.rcp and
the feature I created in step 3 (added required dependencies as
well)
Created Application Model with container to be the plugin project
of step 1 and added a New Trimmed Window
Saved all and tried to launch an Eclipse Application
No window is showing up and I don't see an error in console.
Any idea what am I missing here or how is this debugged?
Update:
I am following: 10. Tutorial: From Plug-in to Eclipse 4 application
The 10.6. Start application is the one that fails
Update 2:
I noticed that some directories have been created outside of my workspace with the name runtime-todo.product (i.e. the plugin name).
Going into runtime-todo.product\.metadata\.plugins\org.eclipse.e4.workbench and deleting the workbench the window showed up.
Why are these directories created outside my workspace and what was the problem here?
I followed all your steps and got the expected empty window after the application started, so something is strange here.
You can try to:
Look for an error log file in the .metadata folder of your runtime workspace
Delete the file .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi
Add -clean as a program argument to your product launch configuration
Try to start the application again.
If this doesn't help, you can set a break point at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel to see what happens when Eclipse tries to load your application model (see also Eclipse 4 Source). I hope this helps!
[Update]:
When you start your application, a runtime workspace is created. Here, all the meta data of your application is stored, like settings and resources. For example, in .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi the user settings of the Application Model are stored.
Sometimes during development, this workspace can become corrupted (e.g. by stopping the application while debugging before settings are saved etc.).
You can see the location of your runtime workspace when you look into the Run Configuration of your application. In the Main tab you can see (and change) the workspace data location. You should keep this runtime workspace separate from your development workspace.
[Update 2]:
Information about the role of the workbench.xmi file can be found here: Constructing the runtime application model. The web page of Lars Vogel offers a lot of useful Eclipse Tutorials at Eclipse Plugin and Eclipse RCP Tutorials.
The Eclipse Help page lets you browse the user and developer guides or search for specific topics. Information about the Eclipse launcher and thus the runtime can be found here in Plug-in Development Environment Guide > Reference > Launchers > Eclipse Application Launcher. Look under Main Tab for explanations about workspace data.
The Eclipse variables are explained in the run configuration dialog of your application. In the main tab, look for the Variables... button. When you select a variable, an explanation is given in the Variable Description field.
You can check the Clear flag in your run configuration or specify -clearPersistedState in your product definition ... as mentioned here in a Lars Vogel Tutorial (search for Problem "Application model changes are not reflected in the Eclipse 4 application" in Table2).
I have a java application that have different settings and dependency versions depending on the company branch it is install in.
So what I did is to create a plugin that create an item in the right click context menu of the project in eclipse to make these changes.
However I am wondering if its possible to catch the OnExport event of eclispe (if it exists) and do this automatically everytime the solution is exported.
Would this be possible?
Many thanks
If I understand what you're asking correctly, the Eclipse way to do this would be to write a Builder and add it to the project; then the settings file would be rebuilt whenever it's appropriate, making an up-to-date version always available to export. Here is a good place to start learning about how to do this.
I have a small workspace with 3 projects. One main (Swing) application, two other projects that are just libraries.
Now, whenever I change stuff in my library project and want to execute i.e. run with Ctrl+F11) or debug , I have to select my main project first and run that.
Is there any way to set this up more smoothly, so I can just run my program regardless of which of my 3 project that is selected ?
Have a look at the "Launching" preference page. At the botton you can select *Always launch the previously launched application. That should do the trick...
If you are using Maven you can create hierarchical structure of projects, i.e. head and child projects. In this case try to define Run/Debug profile on the parent's project level. Probably it will work from any other child project.
I personally have never try this and unfortunately cannot try this right now but I hope it will work for you.
If it does not work it seem you have to create your own eclipse plugin.
Good luck.