Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
OnlineHelpAction.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2011-2018 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.corecomponents;
20
21import java.awt.event.ActionEvent;
22import java.awt.event.ActionListener;
23import org.sleuthkit.autopsy.coreutils.Desktop;
24import java.io.IOException;
25import java.net.MalformedURLException;
26import java.net.URISyntaxException;
27import java.net.URI;
28import org.netbeans.core.actions.HTMLViewAction;
29import org.openide.awt.ActionID;
30import org.openide.awt.ActionReference;
31import org.openide.awt.ActionReferences;
32import org.openide.awt.ActionRegistration;
33import org.openide.awt.HtmlBrowser;
34import org.openide.util.NbBundle;
35import org.openide.util.NbBundle.Messages;
36import java.util.logging.Level;
37import org.sleuthkit.autopsy.coreutils.Logger;
38import org.sleuthkit.autopsy.coreutils.Version;
39
43@ActionID(
44 category = "Help",
45 id = "org.sleuthkit.autopsy.corecomponents.OnlineHelpAction"
46)
47@ActionRegistration(
48 displayName = "#CTL_OnlineHelpAction"
49)
50@ActionReferences({
51 @ActionReference(path = "Menu/Help", position = 0),
52 @ActionReference(path = "Shortcuts", name = "F1")
53})
54@Messages("CTL_OnlineHelpAction=Online Autopsy Documentation")
55public final class OnlineHelpAction implements ActionListener {
56
57 private URI uri;
58 private static final Logger Logger = org.sleuthkit.autopsy.coreutils.Logger.getLogger(AboutWindowPanel.class.getName());
59
60 @Override
61 public void actionPerformed(ActionEvent e) {
62 // TODO implement action body
64 }
65
70 private void viewOnlineHelp() {
71 try {
72 uri = new URI("http://sleuthkit.org/autopsy/docs/user-docs/" + Version.getVersion() + "/");
73 } catch (URISyntaxException ex) {
74 Logger.log(Level.SEVERE, "Unable to load Online Documentation", ex); //NON-NLS
75 }
76 if (uri != null) {
77 // Display URL in the System browser
79 Desktop desktop = Desktop.getDesktop();
80 try {
81 desktop.browse(uri);
82 } catch (IOException ex) {
83 // TODO Auto-generated catch block
84 Logger.log(Level.SEVERE, "Unable to launch the system browser", ex); //NON-NLS
85 }
86 } else {
87 org.openide.awt.StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(HTMLViewAction.class, "CTL_OpeningBrowser")); //NON-NLS
88 try {
89 HtmlBrowser.URLDisplayer.getDefault().showURL(uri.toURL());
90 } catch (MalformedURLException ex) {
91 Logger.log(Level.SEVERE, "Unable to launch the built-in browser", ex); //NON-NLS
92 }
93 }
94 }
95 }
96
97}

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.