kinkadzs/QuickOpener-NetBeans — pull request #2 by tychobrailleur (2012-06-16 13:50:15+00:00)
Title: Fix IOException thrown by sun.awt.X11.XDesktopPeer.launch

Despite being on a Gnome3 system where Desktop.isSupported(Action.OPEN) claims to be supported, the following error is thrown:

java.io.IOException: Failed to show URI:file:/home/sebastien/dev/jruby-launcher/
at sun.awt.X11.XDesktopPeer.launch(XDesktopPeer.java:114)
at sun.awt.X11.XDesktopPeer.open(XDesktopPeer.java:77)
at java.awt.Desktop.open(Desktop.java:272)
at com.sessonad.quickopener.commands.LinuxGnomeCommands.browseInFileSystem(LinuxGnomeCommands.java:16)
at com.sessonad.quickopener.actions.FileSystem.actionPerformed(FileSystem.java:40)
at org.openide.awt.InjectorExactlyOne.actionPerformed(InjectorExactlyOne.java:78)
at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:226)

This pull request calls the process that is normally called when the Desktop.isSupported(Action.OPEN) call returns false as a fallback when the IOException is thrown. It also includes a bit of refactoring to address the code repetition.