protected AbstractFile[] getInitialPaths(FolderPanelType folderPanelType, int window) {
boolean isCustom; // Whether the initial path is a custom one or the last used folder.
String[] folderPaths; // Paths to the initial folders.
// Snapshot configuration
Configuration snapshot = MuConfigurations.getSnapshot();
// Preferences configuration
MuPreferencesAPI preferences = MuConfigurations.getPreferences();
// Checks which kind of initial path we're dealing with.
isCustom = preferences.getVariable(MuPreference.STARTUP_FOLDERS, MuPreferences.DEFAULT_STARTUP_FOLDERS).equals(MuPreferences.STARTUP_FOLDERS_CUSTOM);
// Handles custom initial paths.
if (isCustom) {
folderPaths = new String[] {(folderPanelType == FolderPanelType.LEFT ? preferences.getVariable(MuPreference.LEFT_CUSTOM_FOLDER) :
preferences.getVariable(MuPreference.RIGHT_CUSTOM_FOLDER))};
}
// Handles "last folder" initial paths.
else {
// Set initial path to each tab
int nbFolderPaths = snapshot.getIntegerVariable(MuSnapshot.getTabsCountVariable(window, folderPanelType == FolderPanelType.LEFT));
folderPaths = new String[nbFolderPaths];
for (int i=0; i<nbFolderPaths;++i)
folderPaths[i] = snapshot.getVariable(MuSnapshot.getTabLocationVariable(window, folderPanelType == FolderPanelType.LEFT, i));
}
List<AbstractFile> initialFolders = new LinkedList<AbstractFile>(); // Initial folders
AbstractFile folder;