19 package org.sleuthkit.autopsy.timeline;
21 import java.io.IOException;
23 import java.util.List;
24 import java.util.logging.Level;
25 import javafx.collections.FXCollections;
26 import javafx.scene.Node;
27 import javafx.scene.control.Alert;
28 import javafx.scene.control.ButtonBar;
29 import javafx.scene.control.ButtonType;
30 import javafx.scene.control.Dialog;
31 import javafx.scene.control.DialogPane;
32 import javafx.scene.control.ListView;
33 import javafx.scene.image.Image;
34 import javafx.stage.Modality;
35 import javafx.stage.Stage;
36 import org.controlsfx.dialog.ProgressDialog;
37 import org.controlsfx.tools.Borders;
38 import org.openide.util.NbBundle;
50 @NbBundle.Messages(
"PrompDialogManager.buttonType.showTimeline=Continue")
51 private static final ButtonType
CONTINUE =
new ButtonType(Bundle.PrompDialogManager_buttonType_showTimeline(), ButtonBar.ButtonData.OK_DONE);
53 @NbBundle.Messages(
"PrompDialogManager.buttonType.continueNoUpdate=Continue Without Updating")
54 private static final ButtonType
CONTINUE_NO_UPDATE =
new ButtonType(Bundle.PrompDialogManager_buttonType_continueNoUpdate(), ButtonBar.ButtonData.CANCEL_CLOSE);
56 @NbBundle.Messages(
"PrompDialogManager.buttonType.update=Update DB")
57 private static final ButtonType
UPDATE =
new ButtonType(Bundle.PrompDialogManager_buttonType_update(), ButtonBar.ButtonData.OK_DONE);
65 tempImg =
new Image(
new URL(
"nbresloc:/org/netbeans/core/startup/frame.gif").openStream());
66 }
catch (IOException ex) {
67 logger.log(Level.WARNING,
"Failed to load branded icon for progress dialog.", ex);
69 AUTOPSY_ICON = tempImg;
93 boolean bringCurrentDialogToFront() {
95 ((Stage)
currentDialog.getDialogPane().getScene().getWindow()).toFront();
106 @NbBundle.Messages({
"PromptDialogManager.progressDialog.title=Populating Timeline Data"})
107 @ThreadConfined(type = ThreadConfined.ThreadType.JFX)
108 void showDBPopulationProgressDialog(CancellationProgressTask<?> task) {
111 currentDialog.setTitle(Bundle.PromptDialogManager_progressDialog_title());
113 currentDialog.headerTextProperty().bind(task.titleProperty());
116 dialogPane.setPrefSize(400, 200);
123 dialogPane.getButtonTypes().setAll(ButtonType.CANCEL);
124 final Node cancelButton = dialogPane.lookupButton(ButtonType.CANCEL);
125 cancelButton.disableProperty().bind(task.cancellableProperty().not());
127 if (task.isRunning()) {
128 closeRequest.consume();
130 if (task.isCancellable() && task.isCancelRequested() ==
false) {
131 task.requestCancel();
143 @ThreadConfined(type = ThreadConfined.ThreadType.JFX)
145 ((Stage) dialog.getDialogPane().getScene().getWindow()).getIcons().setAll(AUTOPSY_ICON);
155 "PromptDialogManager.confirmDuringIngest.headerText=Ingest is still going, and the Timeline may be incomplete.",
156 "PromptDialogManager.confirmDuringIngest.contentText=Do you want to continue?"})
157 @ThreadConfined(type = ThreadConfined.ThreadType.JFX)
158 boolean confirmDuringIngest() {
159 currentDialog =
new Alert(Alert.AlertType.CONFIRMATION, Bundle.PromptDialogManager_confirmDuringIngest_contentText(),
CONTINUE, ButtonType.CANCEL);
163 currentDialog.setHeaderText(Bundle.PromptDialogManager_confirmDuringIngest_headerText());
166 return currentDialog.showAndWait().map(CONTINUE::equals).orElse(
false);
178 "PromptDialogManager.rebuildPrompt.headerText=The Timeline DB is incomplete and/or out of date."
179 +
" Some events may be missing or inaccurate and some features may be unavailable.",
180 "PromptDialogManager.rebuildPrompt.details=Details"})
181 @ThreadConfined(type = ThreadConfined.ThreadType.JFX)
182 boolean confirmRebuild(List<String> rebuildReasons) {
188 currentDialog.setHeaderText(Bundle.PromptDialogManager_rebuildPrompt_headerText());
191 ListView<String> listView =
new ListView<>(FXCollections.observableArrayList(rebuildReasons));
192 listView.setCellFactory(lstView ->
new WrappingListCell());
193 listView.setMaxHeight(75);
196 Node wrappedListView = Borders.wrap(listView)
198 .title(Bundle.PromptDialogManager_rebuildPrompt_details())
202 dialogPane.setExpandableContent(wrappedListView);
203 dialogPane.setMaxWidth(500);
206 return currentDialog.showAndWait().map(UPDATE::equals).orElse(
false);
210 "PromptDialogManager.showTooManyFiles.contentText="
211 +
"There are too many files in the DB to ensure reasonable performance."
212 +
" Timeline will be disabled. ",
213 "PromptDialogManager.showTooManyFiles.headerText="})
214 static void showTooManyFiles() {
215 Alert dialog =
new Alert(Alert.AlertType.INFORMATION,
216 Bundle.PromptDialogManager_showTooManyFiles_contentText(), ButtonType.OK);
217 dialog.initModality(Modality.APPLICATION_MODAL);
218 dialog.setTitle(Bundle.Timeline_dialogs_title());
220 dialog.setHeaderText(Bundle.PromptDialogManager_showTooManyFiles_headerText());
221 dialog.showAndWait();
225 "PromptDialogManager.showTimeLineDisabledMessage.contentText="
226 +
"Timeline functionality is not available yet."
227 +
" Timeline will be disabled. ",
228 "PromptDialogManager.showTimeLineDisabledMessage.headerText="})
229 static void showTimeLineDisabledMessage() {
230 Alert dialog =
new Alert(Alert.AlertType.INFORMATION,
231 Bundle.PromptDialogManager_showTimeLineDisabledMessage_contentText(), ButtonType.OK);
232 dialog.initModality(Modality.APPLICATION_MODAL);
233 dialog.setTitle(Bundle.Timeline_dialogs_title());
235 dialog.setHeaderText(Bundle.PromptDialogManager_showTimeLineDisabledMessage_headerText());
236 dialog.showAndWait();
static final Logger logger
static final ButtonType CONTINUE_NO_UPDATE
static final Image AUTOPSY_ICON
static final ButtonType UPDATE
static final ButtonType CONTINUE
final TimeLineController controller
synchronized static Logger getLogger(String name)
static void setDialogIcons(Dialog<?> dialog)