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")));
68 synchronized static void invalidateController() {
69 timeLineController = null;
73 toolbarButton.addActionListener(actionEvent -> performAction());
74 this.setEnabled(
false);
89 public
void performAction() {
94 "OpenTimelineAction.settingsErrorMessage=Failed to initialize timeline settings.",
95 "OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."})
96 synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) {
99 if (currentCase.
hasData() ==
false) {
101 LOGGER.log(Level.INFO,
"Could not create timeline, there are no data sources.");
105 if (timeLineController == null) {
112 timeLineController.showTimeLine(file, artifact);
114 }
catch (IOException iOException) {
116 LOGGER.log(Level.SEVERE,
"Failed to initialize per case timeline settings.", iOException);
118 }
catch (IllegalStateException e) {
127 public
void showTimeline() {
128 showTimeline(null, null);
139 public
void showFileInTimeline(AbstractFile file) {
140 showTimeline(file, null);
150 public
void showArtifactInTimeline(BlackboardArtifact artifact) {
151 showTimeline(null, artifact);
155 @NbBundle.Messages(
"OpenTimelineAction.displayName=Timeline")
157 return Bundle.OpenTimelineAction_displayName();
162 return HelpCtx.DEFAULT_HELP;
177 super.setEnabled(value);
178 toolbarButton.setEnabled(value);
188 ImageIcon icon =
new ImageIcon(getClass().getResource(
"images/btn_icon_timeline_colorized_26.png"));
189 toolbarButton.setIcon(icon);
190 toolbarButton.setText(this.getName());
191 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)