19 package org.sleuthkit.autopsy.coreutils;
21 import java.util.Objects;
22 import javafx.beans.property.ReadOnlyBooleanProperty;
23 import javafx.beans.property.ReadOnlyBooleanWrapper;
24 import javafx.beans.property.ReadOnlyObjectProperty;
25 import javafx.beans.property.ReadOnlyObjectWrapper;
26 import javafx.beans.property.SimpleListProperty;
27 import javafx.collections.FXCollections;
28 import javax.annotation.concurrent.GuardedBy;
29 import javax.annotation.concurrent.ThreadSafe;
46 private final ObservableStack<T>
historyStack = new ObservableStack<>();
50 private final ObservableStack<T>
forwardStack = new ObservableStack<>();
54 private final ReadOnlyObjectWrapper<T>
currentState = new ReadOnlyObjectWrapper<>();
58 private final ReadOnlyBooleanWrapper
canAdvance = new ReadOnlyBooleanWrapper();
62 private final ReadOnlyBooleanWrapper
canRetreat = new ReadOnlyBooleanWrapper();
98 synchronized public void reset(T newState) {
113 if (peek != null && peek.equals(
currentState.get()) ==
false) {
130 if (pop != null && pop.equals(
currentState.get()) ==
false) {
134 }
else if (pop != null && pop.equals(
currentState.get())) {
149 synchronized public void advance(T newState)
throws IllegalArgumentException {
150 if (newState != null && Objects.equals(
currentState.get(), newState) ==
false) {
179 super(FXCollections.<T>synchronizedObservableList(FXCollections.<T>observableArrayList()));
183 synchronized (
this) {
189 synchronized (
this) {
199 synchronized (
this) {
final ObservableStack< T > forwardStack
final ObservableStack< T > historyStack
synchronized boolean canRetreat()
synchronized void reset(T newState)
synchronized T getCurrentState()
synchronized boolean canAdvance()
synchronized ReadOnlyObjectProperty< T > currentState()
synchronized ReadOnlyBooleanProperty getCanRetreat()
synchronized void advance(T newState)
synchronized ReadOnlyBooleanProperty getCanAdvance()
synchronized void clear()