Skip to content

Commit

Permalink
Added Javadoc for handleOpenFilesAction(...) methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-Loeffler committed Nov 8, 2022
1 parent 4c5dfa2 commit f2436bd
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,24 @@ private void createEmptyDocumentWindow() {
newWindow.updateWithDefaultContent();
}

/**
* By default all necessary actions to open a single file or a group of files take place in this method.
* If it is required to perform certain actions after successfully loading all files, please use {@code handleOpenFilesAction(List<String> files, Runnable onSuccess)} instead.
*
* All error handling takes place here within, there is no way yet to access exceptional results and to work with them.
*/
@Override
public void handleOpenFilesAction(List<String> files) {
handleOpenFilesAction(files, null);
}

/**
* As file loading errors are handled within this method (all exceptions are handled within), it can be helpful to be able to run a certain action after successful file loading (e.g. closing a certain stage).
* For this case this method offers the argument {@code Runnable onSuccess} which will be executed after successful file open activity. The {@code Runnable onSuccess} is only ran once, despite how many files have been loaded.
*
* @param files List of Strings denoting file paths to be opened
* @param onSuccess {@link Runnable} to be executed after all files have been opened successfully
*/
public void handleOpenFilesAction(List<String> files, Runnable onSuccess) {
assert files != null;
assert files.isEmpty() == false;
Expand Down

0 comments on commit f2436bd

Please sign in to comment.