How to handle file open requests on MacOS
Danno Ferrin
danno.ferrin at oracle.com
Mon Jan 5 17:50:18 UTC 2015
Oh, yes. Mac has it's own Applicaiton class. Here's the imports for the second file...
import com.apple.eawt.AppEvent;
import com.apple.eawt.Application;
import java.io.File;
import java.util.List;
import javax.swing.SwingUtilities;
The com.apple.eawt stuff is shipped with Oracle JRE and JDK, but like I said in my previous mail you need to pass a flag to the compiler to turn off it's index and read the jar.
The JavaDoc has gone MIA though -- https://bugs.openjdk.java.net/browse/JDK-8027638 but you can peruse the source code to see the details, it's all OpenJDK - http://hg.openjdk.java.net/jdk8u/jdk8u40/jdk/file/564bca490631/src/macosx/classes/com/apple/eawt
On Jan 5, 2015, at 10:43 AM, Mike Hearn <mike at plan99.net> wrote:
> What is Application.getApplication() here? The JavaFX Application class does not have a setOpenFileHandler method. Is that a Mac-specific API?
>
> It's too bad that 8u40 won't have this. Being able to easily open double clicked files is pretty basic. Perhaps post 8u40 the JFX team could go through Scene Builder and identify everywhere it relies on internal APIs or custom magic and suck it into the core API, as then you'd have confidence that an app of real complexity can be done entirely with documented stuff.
More information about the openjfx-dev
mailing list