|Show dialog on startup in JFace application [message #1725673]
||Sun, 06 March 2016 15:36
| Kay Schröer
Registered: April 2014
I need some help to find the right place to load my configuration file.|
I have a JFace application and want to have the GUI in different languages. For that I have a flag in a config file. Dependding on this flag I later load the ResourceBundle.
Now I have the problem that I'm adding a SWT.Show listener to the shell and then load the config file. But this doesn't work because the createContents() method of the ApplicationWindow is called before the show event triggers so all controls will appear in the default language.
Then I thought to move the config loading process to the createContents() method but there's another point to consider: The user should be able to load config files from several locations. So I also built a selection dialog in which the user can choose the right file and this window has to be opened directly on startup.
So my workflow is now as follows:
Immediately after starting the program, the selection dialog has to popup. In this dialog the user can choose the right config file. If the user clicked the ok button then the main window is opened and the GUI controls should get my internationalized labels. But if the user clicked the cancel button then the program should be exited.
So far so well, but I have some problems to find the right way to realize this workflow or rather which method is the best one to place the code?
Powered by FUDForum
. Page generated in 0.01696 seconds