19 package org.sleuthkit.autopsy.timeline;
21 import java.awt.Component;
22 import java.io.IOException;
23 import java.util.logging.Level;
24 import javax.swing.ImageIcon;
25 import javax.swing.JButton;
26 import org.openide.awt.ActionID;
27 import org.openide.awt.ActionReference;
28 import org.openide.awt.ActionReferences;
29 import org.openide.awt.ActionRegistration;
30 import org.openide.util.HelpCtx;
31 import org.openide.util.NbBundle;
32 import org.openide.util.actions.CallableSystemAction;
33 import org.openide.util.actions.Presenter;
46 @ActionID(category =
"Tools",
id =
"org.sleuthkit.autopsy.timeline.Timeline")
47 @ActionRegistration(displayName =
"#CTL_MakeTimeline", lazy =
false)
48 @ActionReferences(value = {
49 @ActionReference(path =
"Menu/Tools", position = 102),
50 @ActionReference(path =
"Toolbars/Case", position = 102)})
51 public final class OpenTimelineAction extends CallableSystemAction implements Presenter.Toolbar {
53 private static final long serialVersionUID = 1L;
60 private final JButton toolbarButton =
new JButton(getName(),
61 new ImageIcon(getClass().getResource(
"images/btn_icon_timeline_colorized_26.png")));
67 synchronized static void invalidateController() {
68 timeLineController = null;
72 toolbarButton.addActionListener(actionEvent -> performAction());
73 this.setEnabled(
false);
88 public
void performAction() {
93 "OpenTimelineAction.settingsErrorMessage=Failed to initialize timeline settings.",
94 "OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."})
95 synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) {
98 if (currentCase.
hasData() ==
false) {
100 LOGGER.log(Level.INFO,
"Could not create timeline, there are no data sources.");
104 if (timeLineController == null) {
111 timeLineController.showTimeLine(file, artifact);
113 }
catch (IOException iOException) {
115 LOGGER.log(Level.SEVERE,
"Failed to initialize per case timeline settings.", iOException);
117 }
catch (IllegalStateException e) {
126 public
void showTimeline() {
127 showTimeline(null, null);
138 public
void showFileInTimeline(AbstractFile file) {
139 showTimeline(file, null);
149 public
void showArtifactInTimeline(BlackboardArtifact artifact) {
150 showTimeline(null, artifact);
154 @NbBundle.Messages(
"OpenTimelineAction.displayName=Timeline")
156 return Bundle.OpenTimelineAction_displayName();
161 return HelpCtx.DEFAULT_HELP;
176 super.setEnabled(value);
177 toolbarButton.setEnabled(value);
187 ImageIcon icon =
new ImageIcon(getClass().getResource(
"images/btn_icon_timeline_colorized_26.png"));
188 toolbarButton.setIcon(icon);
189 toolbarButton.setText(this.getName());
190 return toolbarButton;
Component getToolbarPresenter()
static boolean isJavaFxInited()
synchronized void showTimeline(AbstractFile file, BlackboardArtifact artifact)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static void info(String message)
static boolean isCaseOpen()
void setEnabled(boolean value)
static void error(String message)