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;
50 @ActionID(category =
"Tools",
id =
"org.sleuthkit.autopsy.timeline.Timeline")
51 @ActionRegistration(displayName =
"#CTL_MakeTimeline", lazy =
false)
52 @ActionReferences(value = {
53 @ActionReference(path =
"Menu/Tools", position = 102),
54 @ActionReference(path =
"Toolbars/Case", position = 102)})
57 private static final long serialVersionUID = 1L;
59 private static final int FILE_LIMIT = 6_000_000;
64 private final JButton toolbarButton =
new JButton(getName(),
65 new ImageIcon(getClass().getResource(
"images/btn_icon_timeline_colorized_26.png")));
71 synchronized static void invalidateController() {
72 timeLineController = null;
76 toolbarButton.addActionListener(actionEvent -> performAction());
77 menuItem = super.getMenuPresenter();
78 this.setEnabled(
false);
93 public
void performAction() {
95 Platform.runLater(PromptDialogManager::showTooManyFiles);
97 if (timeLineController != null) {
103 Platform.runLater(PromptDialogManager::showTimeLineDisabledMessage);
111 "OpenTimelineAction.settingsErrorMessage=Failed to initialize timeline settings.",
112 "OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."})
113 synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) {
116 if (currentCase.
hasData() ==
false) {
118 logger.log(Level.INFO,
"Could not create timeline, there are no data sources.");
122 if (timeLineController == null) {
129 timeLineController.showTimeLine(file, artifact);
131 }
catch (IOException iOException) {
133 logger.log(Level.SEVERE,
"Failed to initialize per case timeline settings.", iOException);
144 public
void showTimeline() {
145 showTimeline(null, null);
156 public
void showFileInTimeline(AbstractFile file) {
157 showTimeline(file, null);
167 public
void showArtifactInTimeline(BlackboardArtifact artifact) {
168 showTimeline(null, artifact);
172 @NbBundle.Messages(
"OpenTimelineAction.displayName=Timeline")
174 return Bundle.OpenTimelineAction_displayName();
179 return HelpCtx.DEFAULT_HELP;
194 super.setEnabled(enable);
195 menuItem.setEnabled(enable);
196 toolbarButton.setEnabled(enable);
206 return toolbarButton;
218 logger.log(Level.SEVERE,
"Can not open timeline with no case open.", ex);
219 }
catch (TskCoreException ex) {
220 logger.log(Level.SEVERE,
"Error counting files in the DB.", ex);
Component getToolbarPresenter()
static boolean isJavaFxInited()
static Case getOpenCase()
void setEnabled(boolean enable)
JMenuItem getMenuPresenter()
SleuthkitCase getSleuthkitCase()
synchronized void showTimeline(AbstractFile file, BlackboardArtifact artifact)
static String getConfigSetting(String moduleName, String settingName)
synchronized static Logger getLogger(String name)
static void info(String message)
static boolean isCaseOpen()
static void error(String message)