Unable to run CIF simulation in stand-alone mode using ./bin/cifsim
When running the CIF simulator in stand-alone mode using .`/bin/cifsim` it crashes showing the following message:
```
ERROR: Failed to open editor "org.eclipse.escet.cif.simulator.input.InteractiveGuiInputEditor" for file "philosophers1.cif".
CAUSE: (IllegalStateException) Workbench has not been created yet.
```
Looking into the code, this error is caused by `EclipseThemeUtils.isDarkThemeInUse()` as it calls `PlatformUI.getWorkbench()`. Because the workbench is not active in stand-alone mode, this call fails.
Modifying the code to work around this issue revealed a second issue where the application crashes when it calls `InstanceScope.INSTANCE.getNode(ThemeEngine.THEME_PLUGIN_ID)` in the `EclipseThemePreferenceChangeListener` class.
The `InstanceScope.INSTANCE.getNode()` functionality requires the workspace location to be specified. Again, when running in stand-alone mode this location is not specified.
Browsing the git history, it seems the introduction of "Dark theme" support broke the escet stand-alone tools .`/bin/cifsim` and `./bin/cifsynthanalys` as it added dependencies to the Eclipse Workbench environment and workspace location which are not present in stand-alone mode.
See [#417 More ESCET dark theme support](https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/385)
As suggested in, the canceled, merge request !555 I propose seperatly resolving the follwoing related issues:
- [x] (!557) Resolve startup error for all eventbased stand-alone application. [!555 comment](https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/555#startup-error-for-all-eventbased-stand-alone-application)
- [x] (!558) Adding run configuration to run/debug stand-alone CIF simulator from Eclipse.
- [x] (!561) Resolve error running stand-alone applications without a workspace. [!555 comment](https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/555#support-running-without-a-workspace)
- [x] (!561) Resolve error checking for Dark mode by stand-alone applications. [!555 comment](https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/555#support-dark-mode)
- [x] (!559) Resolve standalone cifsynthanaly closing immediately. [!555 comment](https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/555#eclipse-cifsynthanaly-closing-immediately)
issue