1 20 21 package org.jdesktop.jdic.desktop.internal.impl; 22 23 import java.io.File ; 24 import java.io.IOException ; 25 26 import org.jdesktop.jdic.desktop.internal.LaunchFailedException; 27 import org.jdesktop.jdic.desktop.internal.LaunchService; 28 29 32 public class GnomeLaunchService implements LaunchService { 33 static { 34 System.loadLibrary("jdic"); 35 } 36 37 41 public File resolveLinkFile(File file) { 42 File resolvedFile = file; 43 try { 44 resolvedFile = file.getCanonicalFile(); 45 } catch (IOException e) { 46 } 47 48 return resolvedFile; 49 } 50 51 58 public void open(File file) throws LaunchFailedException { 59 boolean result = nativeOpenFile(file.toString()); 60 if (result == false) { 61 throw new LaunchFailedException("Failed to launch the associated application with the specified file."); 62 } 63 } 64 65 68 public boolean isEditable(File file) { 69 return false; 70 } 71 72 79 public void edit(File file) throws LaunchFailedException { 80 throw new LaunchFailedException("No application associated with the specified file and verb."); 81 } 82 83 86 public boolean isPrintable(File file) { 87 return false; 88 } 89 90 97 public void print(File file) throws LaunchFailedException { 98 throw new LaunchFailedException("No application associated with the specified file and verb."); 99 } 100 101 private native boolean nativeOpenFile(String filePath); 102 } 103 | Popular Tags |