Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ReportProgressIndicator.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2019 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.report.infrastructure;
20
21import org.openide.util.NbBundle;
22import org.sleuthkit.autopsy.progress.ProgressIndicator;
23import org.sleuthkit.autopsy.report.ReportProgressPanel;
24
31
32 private static final long serialVersionUID = 1L;
34 private int workUnitsCompleted;
35
46
47 @Override
48 @NbBundle.Messages({
49 "ReportProgressIndicator.startMessage=Report generation started"
50 })
51 public void start() {
54 progressIndicator.start(Bundle.ReportProgressIndicator_startMessage());
55 }
56
57 @Override
58 @NbBundle.Messages({
59 "ReportProgressIndicator.switchToDeterminateMessage=Report generation progress switched to determinate"
60 })
61 public void setMaximumProgress(int max) {
62 progressIndicator.switchToDeterminate(Bundle.ReportProgressIndicator_switchToDeterminateMessage(), 0, max);
63 }
64
65 @Override
66 public void increment() {
69 }
70
71 @Override
72 public void setProgress(int value) {
73 workUnitsCompleted = value;
75 }
76
77 @Override
78 @NbBundle.Messages({
79 "ReportProgressIndicator.switchToIndeterminateMessage=Report generation progress switched to indeterminate"
80 })
81 public void setIndeterminate(boolean indeterminate) {
82 progressIndicator.switchToIndeterminate(Bundle.ReportProgressIndicator_switchToIndeterminateMessage());
83 }
84
85 @Override
86 public void updateStatusLabel(String statusMessage) {
88 progressIndicator.progress(statusMessage);
89 }
90 }
91
92 @Override
93 @NbBundle.Messages({
94 "ReportProgressIndicator.completedMessage=Report generation completed",
95 "ReportProgressIndicator.completedWithErrorsMessage=Report generation completed with errors",})
96 public void complete(ReportStatus reportStatus) {
98 switch (reportStatus) {
99 case COMPLETE: {
100 progressIndicator.progress(Bundle.ReportProgressIndicator_completedMessage());
101 break;
102 }
103 case ERROR: {
104 progressIndicator.progress(Bundle.ReportProgressIndicator_completedWithErrorsMessage());
105 break;
106 }
107 default: {
108 break;
109 }
110 }
111 }
112 progressIndicator.finish();
113 }
114
115 @Override
116 public void complete(ReportStatus reportStatus, String statusMessage) {
118 progressIndicator.progress(statusMessage);
119 }
120 complete(reportStatus);
121 }
122
123 @Override
124 @NbBundle.Messages({
125 "ReportProgressIndicator.cancelledMessage=Report generation cancelled",})
126 public void cancel() {
127 switch (getStatus()) {
128 case COMPLETE:
129 break;
130 case CANCELED:
131 break;
132 case ERROR:
133 break;
134 default:
136 progressIndicator.progress(Bundle.ReportProgressIndicator_cancelledMessage());
137 break;
138 }
139 }
140
141}
void complete(ReportStatus reportStatus, String statusMessage)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.