19 package org.sleuthkit.autopsy.corecomponents;
21 import java.awt.Desktop;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
24 import java.io.IOException;
25 import java.net.MalformedURLException;
27 import org.netbeans.core.actions.HTMLViewAction;
28 import org.openide.awt.ActionID;
29 import org.openide.awt.ActionReference;
30 import org.openide.awt.ActionReferences;
31 import org.openide.awt.ActionRegistration;
32 import org.openide.awt.HtmlBrowser;
33 import org.openide.util.NbBundle;
34 import org.openide.util.NbBundle.Messages;
35 import java.util.logging.Level;
43 id =
"org.sleuthkit.autopsy.corecomponents.OfflineHelpAction"
46 displayName =
"#CTL_OfflineHelpAction"
49 @ActionReference(path =
"Menu/Help", position = 1),
50 @ActionReference(path =
"Shortcuts", name =
"F2")
52 @Messages(
"CTL_OfflineHelpAction=Offline Autopsy Documentation")
55 private static final Logger logger
70 String fileForHelp =
"";
71 String indexForHelp =
"";
72 String currentDirectory =
"";
77 fileForHelp = NbBundle.getMessage(
OfflineHelpAction.class,
"FILE_FOR_LOCAL_HELP");
78 indexForHelp = NbBundle.getMessage(
OfflineHelpAction.class,
"INDEX_FOR_LOCAL_HELP");
79 currentDirectory = System.getProperty(
"user.dir").replace(
"\\",
"/").replace(
" ",
"%20");
80 uri =
new URI(fileForHelp + currentDirectory + indexForHelp);
81 }
catch (Exception ex) {
82 logger.log(Level.SEVERE,
"Unable to load Offline Documentation: "
83 + fileForHelp + currentDirectory + indexForHelp, ex);
87 if (Desktop.isDesktopSupported()) {
88 Desktop desktop = Desktop.getDesktop();
91 }
catch (IOException ex) {
92 logger.log(Level.SEVERE,
"Unable to launch the system browser: "
93 + fileForHelp + currentDirectory + indexForHelp, ex);
96 org.openide.awt.StatusDisplayer.getDefault().setStatusText(
97 NbBundle.getMessage(HTMLViewAction.class,
"CTL_OpeningBrowser"));
99 HtmlBrowser.URLDisplayer.getDefault().showURL(uri.toURL());
100 }
catch (MalformedURLException ex) {
101 logger.log(Level.SEVERE,
"Unable to launch the built-in browser: "
102 + fileForHelp + currentDirectory + indexForHelp, ex);
void actionPerformed(ActionEvent e)
synchronized static Logger getLogger(String name)