Skip to content

Commit

Permalink
CSSTUDIO-2371 Restrict access to GoBackAndGoForwardActions and its me…
Browse files Browse the repository at this point in the history
…thods.
  • Loading branch information
abrahamwolk committed Aug 27, 2024
1 parent 536f705 commit 8430392
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ public void logEntryChanged(LogEntry logEntry){
controller.logEntryChanged(logEntry);
}

public class GoBackAndGoForwardActions {
protected class GoBackAndGoForwardActions {

public GoBackAndGoForwardActions() {
private GoBackAndGoForwardActions() {
goBackActions = FXCollections.observableArrayList();
goForwardActions = FXCollections.observableArrayList();
}

public ObservableList<Runnable> goBackActions;
public ObservableList<Runnable> goForwardActions;
protected ObservableList<Runnable> goBackActions;
protected ObservableList<Runnable> goForwardActions;

private boolean isRecordingHistoryDisabled = false; // Used to not add go-back actions when clicking "back".

public boolean getIsRecordingHistoryDisabled() {
protected boolean getIsRecordingHistoryDisabled() {
return isRecordingHistoryDisabled;
}
public void setIsRecordingHistoryDisabled(boolean isRecordingHistoryDisabled) {
Expand All @@ -155,31 +155,31 @@ private void gotoLogEntry(LogEntry logEntry) {
isRecordingHistoryDisabled = false;
}

public void addGoBackAction() {
protected void addGoBackAction() {
LogEntry currentLogEntry = controller.getLogEntry();

if (currentLogEntry != null) {
goBackActions.add(0, () -> gotoLogEntry(currentLogEntry));
}
}

public void addGoForwardAction() {
private void addGoForwardAction() {
LogEntry currentLogEntry = controller.getLogEntry();

if (currentLogEntry != null) {
goForwardActions.add(0, () -> gotoLogEntry(currentLogEntry));
}
}

public void loadLogEntryWithID(Long id) {
private void loadLogEntryWithID(Long id) {
goForwardActions.clear();
addGoBackAction();

LogEntry logEntry = controller.client.getLog(id);
gotoLogEntry(logEntry);
}

public void goBack() {
protected void goBack() {
if (goBackActions.size() > 0) {
addGoForwardAction();
Runnable goBackAction = goBackActions.get(0);
Expand All @@ -188,7 +188,7 @@ public void goBack() {
}
}

public void goForward() {
protected void goForward() {
if (goForwardActions.size() > 0) {
addGoBackAction();
Runnable goForwardAction = goForwardActions.get(0);
Expand Down

0 comments on commit 8430392

Please sign in to comment.