19 package org.sleuthkit.autopsy.timeline;
21 import java.awt.Component;
22 import java.io.IOException;
23 import java.util.logging.Level;
24 import javafx.application.Platform;
25 import javax.swing.ImageIcon;
26 import javax.swing.JButton;
27 import javax.swing.JMenuItem;
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.util.HelpCtx;
33 import org.openide.util.NbBundle;
34 import org.openide.util.actions.CallableSystemAction;
49 @ActionID(category =
"Tools",
id =
"org.sleuthkit.autopsy.timeline.Timeline")
50 @ActionRegistration(displayName =
"#CTL_MakeTimeline", lazy =
false)
51 @ActionReferences(value = {
52 @ActionReference(path =
"Menu/Tools", position = 102),
53 @ActionReference(path =
"Toolbars/Case", position = 102)})
56 private static final long serialVersionUID = 1L;
58 private static final int FILE_LIMIT = 6_000_000;
63 private final JButton toolbarButton =
new JButton(getName(),
64 new ImageIcon(getClass().getResource(
"images/btn_icon_timeline_colorized_26.png")));
70 synchronized static void invalidateController() {
71 timeLineController = null;
75 toolbarButton.addActionListener(actionEvent -> performAction());
76 menuItem = super.getMenuPresenter();
77 this.setEnabled(
false);
92 public
void performAction() {
94 Platform.runLater(PromptDialogManager::showTooManyFiles);
96 if (timeLineController != null) {
102 Platform.runLater(PromptDialogManager::showTimeLineDisabledMessage);
110 "OpenTimelineAction.settingsErrorMessage=Failed to initialize timeline settings.",
111 "OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."})
112 synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) {
115 if (currentCase.
hasData() ==
false) {
117 logger.log(Level.INFO,
"Could not create timeline, there are no data sources.");
121 if (timeLineController == null) {
128 timeLineController.showTimeLine(file, artifact);
130 }
catch (IOException iOException) {
132 logger.log(Level.SEVERE,
"Failed to initialize per case timeline settings.", iOException);
134 }
catch (IllegalStateException e) {
143 public
void showTimeline() {
144 showTimeline(null, null);
155 public
void showFileInTimeline(AbstractFile file) {
156 showTimeline(file, null);
166 public
void showArtifactInTimeline(BlackboardArtifact artifact) {
167 showTimeline(null, artifact);
171 @NbBundle.Messages(
"OpenTimelineAction.displayName=Timeline")
173 return Bundle.OpenTimelineAction_displayName();
178 return HelpCtx.DEFAULT_HELP;
193 super.setEnabled(enable);
194 menuItem.setEnabled(enable);
195 toolbarButton.setEnabled(enable);
205 return toolbarButton;
216 }
catch (IllegalStateException ex) {
217 logger.log(Level.SEVERE,
"Can not open timeline with no case open.", ex);
218 }
catch (TskCoreException ex) {
219 logger.log(Level.SEVERE,
"Error counting files in the DB.", ex);
Component getToolbarPresenter()
static boolean isJavaFxInited()
void setEnabled(boolean enable)
JMenuItem getMenuPresenter()
SleuthkitCase getSleuthkitCase()
synchronized void showTimeline(AbstractFile file, BlackboardArtifact artifact)
static String getConfigSetting(String moduleName, String settingName)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static void info(String message)
static boolean isCaseOpen()
static void error(String message)