JavaFX in Eclipse…moderate at best

So when JavaFX 1.2 came out, I was initially very excited about the Eclipse support. I’m a firm believer that if JavaFX is going to succeed, it needs great Eclipse support. The 1.2 release was a good step forward, but after a month of using it…I have some issues. Now please don’t take this the wrong way, Eclipse will be the environment I develop my JavaFX applications in, but, I feel that the following issues need to be addressed.

Content Assist

Every once in a blue moon, I can get content assist for JavaFX to work. But, about 99% of the time, my ctrl+space key combo results in nothing. Its very frustrating. I knows it is a new language, so I can’t get too mad, but this is a must have feature (and I know it can be done because NetBeans does it well already).

Fix the Icons

PackageStructureA nit pick issue here, but when I create a new package and put FX files in it, the package still looks empty. Notice in the caption that the clash.gui.impl.piece.mfg.farmer package (I know…long name) has a .fx file, yet shows up as empty. Yet the clash.levels.test has a .java file and shows as having content. It would be a small, but good feature to have the .fx files show as ‘content’ in a package.

Stop asking me to open Compiler Bugs

This one annoys me. The first time I run my JavaFX application, it runs fine. The second time, it asks me to open a defect against the compiler team. :-) I always get the following error:

Note: An internal error has occurred in the OpenJFX compiler. Please file a bug at the
Openjfx-compiler issues home (https://openjfx-compiler.dev.java.net/Issues)
after checking for duplicates.  Include in your report:
- the following diagnostics
- file C:\Users\Drew\AppData\Local\Temp\javafx_err_4056245459000809523.txt
- and if possible, the source file which triggered this problem.
Thank you.
C:\Users\Drew\workspace\ClashGUI\src\Main.fx:1: MAP$clash$gui$impl$GameFrame is not public in Main; cannot be accessed from outside package
import javafx.scene.Scene;
^
1 error
ERROR: javafxc execution failed, exit code: 1

If I walk away and come back an hour later, no worries, it’ll work again. The other thing is, I know its not a compile problem because I just run my ant script against it and play it from there… So why can my ant script build it successfully, but the Eclipse launcher can not? I really don’t think this is a compiler bug…thus my not opening an issue.

Overagressive Comment Collapse

CommentCollapse
There is a function in the Java perspective that will collapse your multi-line comments into just one line. That feature has been migrated into the JavaFX perspective as well. Unfortunately, it is very aggressive – always trying to minimize your comments. When you create a new file, all you see is the @author tag. I have had it where I am even typing in the comment block and it tries to minimize it. It gets annoying fast.

Empty New Files

Your only option is to create a new ‘Empty FX Script’ – which does what it’s supposed to. It creates a nearly empty file (only the package declaration and author tag are shown). I would prefer the ability to select ‘Create New Class’ where it generates my class declaration for me on the fly.

Copy and Paste of Imports

The underlying problem here is that ‘Organize Imports’ doesn’t work. So, since that doesn’t work, I find myself copying my import statements from one FX class to another. Unfortunately, it appears to be impossible to copy and past import statements. You might think I’m crazy, but it honestly won’t let me copy any import statements…

JavaFX Preview

So I just noticed the preview window for JavaFX nodes in NetBeans a week or two ago. It’s pretty neat. Definitely not a deal breaker if Eclipse doesn’t have it, but very nice.

Upcoming JavaFX GUI Builder

There is an upcoming JavaFX GUI builder tool. If you haven’t seen it yet, I highly recommend you take a look at this video. The skinny is basically, it is very cool. This can’t be NetBeans exclusive like Matisse is. This has to make it into Eclipse… I know that I’m saying this early (prior to its release), but I don’t want to wait until it is released to say it ;-) Hopefully it is released for both on day 1…but we’ll see.

Outline View

The Outline view in Eclipse is nice because it shows you all of the methods that are in a Java class. JavaFX does not support the outline view. This is a very needed feature…because an Outline view basically does away with the need for a Header file. It is a quick, easy navigation tool.

Code Follow

I am an F3 addict (no, not the previous name of JavaFX….just the key F3). I use it to follow code all around the source tree. Without it, I’m a scared lost individual. Right now, Eclipse for JavaFX does not support it. The Exadel Plug-in supports this, I believe, but it has other issues that I’m not willing deal with at the moment.

Clean Debugging

This is a tough one, not necessarily bound to just Eclipse. As far as I’m aware, NetBeans doesn’t have a clear way to handle debugging JavaFX either (it is very multi-threaded, which creates a lot of issues). This is something that definitely needs some work.

What it does correct today?

I’m a big proponent of not stating the negatives without stating some positives. My belief is that if someone is going to give you a list of negatives and stop there, they’re probably uninformed and you shouldn’t listen to their opinion. There are very few cases where something is completely wrong…and this is one of them.

The Eclipse plug-in for JavaFX does do a lot of things well. For instance, they have a link to the documentation built-in (press Ctrl + F1 in the JavaFX view). The Snippet view is drag and drop – but I also feel that it is better than NetBeans because it opens a Wizard asking you to fill in the fields. I had trouble with NetBeans (it was different, not wrong, and I needed to get used to it). Lastly, I find that the in-line compiling in Eclipse is slightly better than NetBeans. I don’t know how to quantify this…but it just seems more responsive…

Now, you might say, that certainly doesn’t seem like enough to overcome all of the negatives I outlined above? No, it certainly isn’t. But if you’re like me, switching to NetBeans has one huge disadvantage – I have to re-learn all my shortcuts. That’s why I put up with all the negatives with the Eclipse JavaFX perspective. I can use ‘Ctrl + H’ to search my source, ‘Ctrl + D’ to delete a line, etc…

I’ve spent years engraining these key combos into my fingers. While NetBeans handles JavaFX better…I’m just less productive because I find my fingers kicking off shortcuts that don’t exist. It gets frustrating (no fault to NetBeans). So, I’ll stick with the Eclipse perspective, and patiently wait for it to get better. They have a great start, just have some areas that need a little bit of work.

 

8 Responses to “JavaFX in Eclipse…moderate at best”

  1. mezmo says:

    Actually, Matisse isn’t TOTALLY Netbeans exclusive. MyEclipse….”innovated” it into their distro of Eclipse, perhaps a similar effort can be made with the JavaFX designer.

  2. Max says:

    You might also want to check out Exadel’s JavaFX plug-in, http://exadel.com/web/portal/javafxstudio (quick getting started: http://is.gd/1jfFS). While the set of features is almost on par with Sun’s plug-in, we are planning many more features in the next few months.

  3. Josh Marinacci says:

    Thanks for the writeup. Interesting stuff!

    The authoring tool showed at JavaOne is not a GUI builder for JavaFX. It is a visual tool for designers. It won’t be embedded in either NetBeans or Eclipse.

    JavaFX is not multi-threaded. The challenge with debugging is because debuggers only really understand Java code (derived from the JVM bytecodes). We need to provide a better translation from the bytecode back to the correct line in the JavaFX Script code.

  4. Regarding keyboard shortcuts in NetBeans, I agree – that is a huge hurdle. Fortunately however, if you go into the preferences of NetBeans you can specify that the keyboard shortcuts be mapped to use the Eclipse standards.

    This was the first thing I looked for prior to writing any JavaFX code in NetBeans, and having changed it, it actually works pretty decently.

    Having said that, it’s always nice to return to Eclipse, which just feels way more homely for me :-)

  5. Drew says:

    @Jon – That is really cool – I did not know that you can map to Eclipse shortcuts. That is definitely a great feature to have. Thanks for the tip!

  6. [...] Eclipse support really is poor: there are a few annoyances documented over on pliq.com, and I found a few more. Overall it meant that even typing code was a bit of a minefield, and [...]

  7. Hello,

    I’m currently the primary developer of Sun’s JavaFX plugin for Eclipse. Many thanks for putting together this list of issues — constructive criticism is always appreciated! I regret that it has taken so long for this blog post to come to my attention, would you consider opening bug reports at https://kenai.com/bugzilla/ against the eplugin2 project when you find further problems?

    Many thanks
    Neil

  8. Drew says:

    @Max – I just tried the 1.1 plugin. Unfortunately, it wouldn’t compile clash…and I’m not sure why. But since it couldn’t compile it, I wasn’t able to test it. I really like the direction you’re going in though.

Leave a Reply