Autopsy  4.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CancellationProgressTask.java
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 package org.sleuthkit.autopsy.timeline;
7 
8 import javafx.beans.property.ReadOnlyBooleanProperty;
9 import javafx.concurrent.Task;
10 
18 public abstract class CancellationProgressTask<X> extends Task<X> {
19 
20  private boolean cancelRequested;
21 
22  public synchronized boolean isCancelRequested() {
23  return cancelRequested || isCancelled();
24  }
25 
26  public synchronized boolean requestCancel() {
27  this.cancelRequested = true;
28  return true;
29  }
30 
31  abstract public ReadOnlyBooleanProperty cancellableProperty();
32 
33  boolean isCancellable() {
34  return cancellableProperty().get();
35  }
36 }
abstract ReadOnlyBooleanProperty cancellableProperty()

Copyright © 2012-2015 Basis Technology. Generated on: Wed Apr 6 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.