Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class FileBrowser implements AppInstance

private FileBrowserController controller;

FileBrowser(final AppDescriptor app, final File directory)
FileBrowser(final AppDescriptor app, final File file)
{
this.app = app;

Expand All @@ -58,8 +58,14 @@ public class FileBrowser implements AppInstance
final DockItem tab = new DockItem(this, content);
DockPane.getActiveDockPane().addTab(tab);

if (controller != null && directory != null)
controller.setRoot(directory);
if (controller != null && file != null){
if(file.isDirectory()){
controller.setRoot(file);
}
else{
controller.setRootAndHighlight(file);
}
}

tab.addClosedNotification(controller::shutdown);
}
Expand Down
Loading