|
34 | 34 | import org.phoebus.ui.application.ApplicationLauncherService;
|
35 | 35 | import org.phoebus.ui.application.ContextMenuService;
|
36 | 36 | import org.phoebus.ui.application.PhoebusApplication;
|
| 37 | +import org.phoebus.ui.application.ResourceOpenedNotifierService; |
37 | 38 | import org.phoebus.ui.dialog.DialogHelper;
|
38 | 39 | import org.phoebus.ui.javafx.ImageCache;
|
39 | 40 | import org.phoebus.ui.spi.ContextMenuEntry;
|
@@ -179,14 +180,17 @@ private void assertTreeDoesntContain(final TreeItem<FileInfo> item, final Path f
|
179 | 180 | }
|
180 | 181 |
|
181 | 182 | /**
|
182 |
| - * Try to open resource, show error dialog on failure |
| 183 | + * Try to open resource, tell listeners on success, show error dialog on failure |
183 | 184 | *
|
184 | 185 | * @param file Resource to open
|
185 | 186 | * @param stage Stage to use to prompt for specific app.
|
186 | 187 | * Otherwise <code>null</code> to use default app.
|
187 | 188 | */
|
188 | 189 | private void openResource(final File file, final Stage stage) {
|
189 |
| - if (!ApplicationLauncherService.openFile(file, stage != null, stage)) { |
| 190 | + if (ApplicationLauncherService.openFile(file, stage != null, stage)) { |
| 191 | + Platform.runLater(() -> ResourceOpenedNotifierService.notifyListeners(file.getAbsolutePath(), FileBrowserApp.Name)); |
| 192 | + } |
| 193 | + else{ |
190 | 194 | final Alert alert = new Alert(AlertType.ERROR);
|
191 | 195 | alert.setHeaderText(Messages.OpenAlert1 + file + Messages.OpenAlert2);
|
192 | 196 | DialogHelper.positionDialog(alert, treeView, -300, -200);
|
|
0 commit comments