How to combine m2e and e(fx)clipse? - eclipse

I want to create a new project in Eclipse Kepler using the two plugins e(fx)clipse (for JavaFX 2) and m2e. The goal is, to have a Java FX project that I can build with maven from eclipse and that has the folder structure of maven, but I want to use the Java FX SceneBuilder from within Eclipse.
Both plugins have own project types and create different folder structures, so I have to do some stuff manually to combine them. Any ideas?

This is not difficult to do in eclipse. The way I did it was as follows:
1) Create the java project/structure first using a maven archetype (I can not remember the specific one, but a generic java one would do).
2) To use the JavaFX functionality of e(fx)clipse, just make sure the JavaFX libraries are included in the Libraries of you Build Path.
3) To use SceneBuilder, make sure that the executable is configured in Window|Preferences|JavaFX screen.
NB: if you are using a java version that has javaFX already in it (e.g. java 8 or a recent java 7 releaase) then you don't need to add a separate JavaFX library in the build path. This was only necessary when JavaFX was not bundled with the rest of the JDK, which is no longer the case.
Good luck.
chooks

Related

How can I use this javafx library?

I am trying to design gui on java.
I will use this javafx library https://github.com/HanSolo/Medusa
I downloaded this lib but how can I used it?
I added external jar on my javafx project but I can not make any sample code work.
I'm working with eclipse neon and java 8. By the way I set up javafx. It is okay.
Do I need anything else for using this library?
I have gradle and maven plug-in my eclipse IDE.
Don't directly download this file, use something like maven or gradle for this:
If you scroll down on this page: https://bintray.com/hansolo/Medusa/Medusa you will find the copy-paste parts.
There even is an example-project using that lib: https://github.com/HanSolo/medusademo

Eclipse 4 RCP - how to create project?

I am using eclipse 4 application platform for building custom ide like app, but i am still not sure what libraries i can use.
For instance i can't find some API which is responsible for maintaining projects.
Is it even possible to create project or this is just part specific for eclipse as IDE and can't be used if i am using e4 rcp?
The org.eclipse.e4.rcp, org.eclipse.emf.core and org.eclipse.emf.ecore Eclipse features list all the plugins that a pure e4 application uses.
The list includes most of the org.eclipse.core.xxx plugins but not the org.eclipse.core.resources plugin which contains the workspace code (things like IFile and IWorkspace).
So if you want projects and workspaces you would have to write you own code for that - which would not be compatible with any other Eclipse 3.x plugins.

Eclipse Plugin - one of the plugin projects in "features" won't compile

My plugin is built by two plugin projects (two plugin projects are in the same workspace).
One of them is an ordinary plugin which has toolbars etc. The other one is a Scala-based XML interpreter.
Everything runs fine and works great while I use "Run/Debug" as "Eclipse Application".
But, after I tried to pack it as a Feature project then Build it with and Update Site Project, the auto-generated JARs are wierd: the content of the ordinary plugin JAR is classes, which is correct; however, the other one (in scala), Eclipse packed the JAR with the original file - filename.scala in the JAR!
In other words, the plugin project didn't get compiled after Build(in Update site project by putting Features in).
But it worked fine when I used "Run" as "Eclipse Application".
Does anyone know how to fix this? Or any hint?
I've tried this but it didn't fix my problem.

How do I begin using an Eclipse plug-in after downloading it from the Eclipse marketplace?

In this case, the plug-in is Zest. I have downloaded "Eclipse for java developers(Juno)". I understand it has something to do with manifest.mf dependencies. But I have no idea what they are. I am new to Eclipse and Java programming. The Zest tutorial mentions Eclipse for RCP development. Can it not be used in other versions?
There are two kinds of plug-ins downloadable from the Eclipse Marketplace: plug-ins that contribute new functionality to Eclipse, and plug-ins that provide a programmable framework. Zest is one of the latter.
To use such a framework (similar to other Java libraries), you have to have a Java project that has the corresponding jars (and their dependencies as well!) on their classpath.
The simplest way to achieve this is to create a plug-in project in Eclipse, and add the Zest jars as a direct dependency and also adds SWT and possibly JFace as indirect dependencies). In that case, you can use the Zest API in your project and create the corresponding graph visualizations.
In case of Zest, it is also possible to create a simple Java project (unrelated to Eclipse), as the code base does not use any Eclipse-specific functionality, on the other hand, it depends on SWT and JFace, so you have to add the corresponding dependencies as well. For details, see the wiki entry of JFace to get an idea how to manage it. If you want to use Zest, follow the same steps, but also copy the Zest and Draw2d jars as well.
I hope, this solution is clear enough - if not, feel free to ask further questions.

Can't access class in Eclipse plugin from a Java Project

In abstract, my problem is the following: I want to access a class contained in an Eclipse plugin from a Java Project. Is it possible? I've included that class in the "Exported Packages" of the plugin, which supposedly are "all the packages that this plug-in exposes to clients." Can my Java project be a "client" or only other plugins can be clients?
More concretely, I've encountered this problems when using XText. I built an editor for a language, and programs written with this language are stored in a text based format that follows the grammar defined with XText.
I want my users to be able to write Java programs that load and manipulate those xtext-based files. For that, they need to access all the classes that XText generated in the plugin project. However, I haven't been able to use those classes: in an Eclipse instance that is running the plugin with my editor, those classes are not visible.
How can I access them? The only solution I've found is to export my plugin as a jar and then include it in the Build Path of the Java project, in the other Eclipse instance, but this doesn't sound elegant.
Another way of looking at this problem is the following: I want a certain class to be available to any Java project built in an Eclipse instance where a certain plugin is loaded. How can I do it?
Thanks for your help.
PS. I'm launching the second Eclipse instance (the one where the plugin is loaded) from within the first Eclipse instance.
Once you generate your XText support, you need to make sure every package is exported from the Runtime tab by editing your MANIFEST.MF.
Then once you deploy your plugins into an eclipse, that eclipse environment will be able to see those classes.
But that would only help other plugin developers. Java apps can see classes that exist on the classpath (if you add the plugin jars, for example) but as most eclipse plugins depend on the eclipse lifecycle to work, it's unlikely that their java programs would run. That's not always the case (you can use JFace without a running eclipse) but only for plugins specifically designed that way.
If your plugin is installed, you can create a java project and add the plugin jar as an external jar, using *ECLIPSE_HOME* variable. If your plugin is a project in the workspace, you can depend on it (from the java build path) just like another java project. But since it's a plugin, that probably won't help them run.