Skip to content

Commit

Permalink
Merge pull request #2993 from ControlSystemStudio/CSSTUDIO-1881-tab-c…
Browse files Browse the repository at this point in the history
…ontext-menu

Add tab context menu items for easier access to (file) resources
  • Loading branch information
georgweiss authored Apr 5, 2024
2 parents 911f3e2 + e15a7a3 commit 0dfc323
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 371 deletions.
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

0 comments on commit 0dfc323

Please sign in to comment.