Online Documentation under Help Menu opens in browser

This commit is contained in:
sidheshenator 2015-02-13 11:48:35 -05:00
parent a32bd7b863
commit 01cce8917a
2 changed files with 74 additions and 0 deletions

View File

@ -27,6 +27,8 @@ Format_OperatingSystem_Value={0} version {1} running on {2}
LBL_Copyright=<div style\="font-size\: 12pt; font-family\: Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; ">Autopsy&trade; is a digital forensics platform based on The Sleuth Kit&trade; and other tools. <br><ul><li>General Information: <a style\="color\: \#1E2A60;" href\="http\://www.sleuthkit.org">http\://www.sleuthkit.org</a>.</li><li>Training: <a style\="color\: \#1E2A60;" href\="http://www.basistech.com/autopsy-training">http://www.basistech.com/autopsy-training</a></li><li>Commercial Support: <a style\="color\: \#1E2A60;" href\="http://www.basistech.com/digital-forensics/autopsy/support/">http://www.basistech.com/digital-forensics/autopsy/support/</a></li></ul>Copyright &copy; 2003-2014. </div>
URL_ON_IMG=http://www.sleuthkit.org/
URL_ON_HELP=http://sleuthkit.org/autopsy/docs/user-docs/3.1/
LBL_Close=Close
DataContentViewerString.copyMenuItem.text=Copy
DataContentViewerHex.copyMenuItem.text=Copy

View File

@ -0,0 +1,72 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2014 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.corecomponents;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;
import org.netbeans.core.actions.HTMLViewAction;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
import org.openide.awt.HtmlBrowser;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import java.util.logging.Level;
import java.util.logging.Logger;
@ActionID(
category = "Help",
id = "org.sleuthkit.autopsy.corecomponents.OnlineHelpAction"
)
@ActionRegistration(
displayName = "#CTL_OnlineHelpAction"
)
@ActionReferences({
@ActionReference(path = "Menu/Help", position = 0),
@ActionReference(path = "Shortcuts", name = "F1")
})
@Messages("CTL_OnlineHelpAction=Online Documentation")
public final class OnlineHelpAction implements ActionListener {
private URL url;
private static final Logger Logger = org.sleuthkit.autopsy.coreutils.Logger.getLogger(AboutWindowPanel.class.getName());
@Override
public void actionPerformed(ActionEvent e) {
// TODO implement action body
try {
url = new URL(NbBundle.getMessage(OnlineHelpAction.class, "URL_ON_HELP")); // NOI18N
showUrl();
} catch (MalformedURLException ex) {
Logger.log(Level.SEVERE, "Unable to load Online DOcumentation", ex);
}
url = null;
}
private void showUrl() {
if (url != null) {
org.openide.awt.StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(HTMLViewAction.class, "CTL_OpeningBrowser")); //NON-NLS
HtmlBrowser.URLDisplayer.getDefault().showURL(url);
}
}
}