-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Version specific store of app data, and preferences #396
Conversation
There is one question - its about the "Manage Repositories" function. The configuration behind (its all in Preferences) is basically shareable between all versions. So this one could be designed as ashared element. Otherwise users probably wil complain, that they have to import their repository settings manually between different SB versions. What do you think? This could be a different PR. |
As I said in #369 I think SB should store all settings per workspace location |
8012608
to
ff8d084
Compare
Okay, with the current status each SceneBuilder has its own repositories setup - which is not a workspace yet but each version has its own config. As a next step, in order to enable workspaces later, another PR could introduce the capability to save settings to files and read them from files. @mimmoz81 |
@Oliver-Loeffler I was thinking about that too.. |
We should talk about that in a specific issue I think |
Issue #14 is probably the better space. Just found this one. |
How do we make sure if an existing application is being updated, the newer version has all the settings/preferences from the older version? |
At least the following approaches are thinkable: Approach 1
Approach 2
What do you think? |
I am more inclined towards Approach 2 |
I like the NetBeans approach here: when installing a new version, it says it detected an old version, and recommends copying the data from that old version. |
I will have more time to dig into this again starting next week. Personally, I do prefer approach 1 over approach 2, I appreciate being asked over being forced to do things in a certain way. For that, let's see, I'll prepare a prototype for each approach so we can test this. |
1196252
to
2015844
Compare
…c to each SceneBuilder version. Thus multiple versions can run in parallel.
2015844
to
ed03147
Compare
It took me a moment to get back into it but now I have a plan to create the prototype. I'm going to use the existing PR for that. Also it can be helpful to document where and how SceneBuilder stores its settings. As of now its only a a markdown snippet in |
🎉 Happy new year to all friends of Scene Builder! 🎉 There is now the first prototype. It detects settings of older SB versions (well, until now its always SB_2.0) and asks one single time at first start if an import is desired. The user decision is memorized. It works like that:
The I was thinking about approach 2, silently doing the import as @abhinayagarwal mentioned this. A silent import would match the way Scene Builder works as of now. So user experience would be as usual but with the benefit of the ability to operate different versions in parallel. What works:
The MessageBox contents is not imported. Remark:
@abhinayagarwal & @johanvos What do you think? |
…ersion Preferences.
d4f8a76
to
34bd44f
Compare
May be you can help me @abhinayagarwal: |
interface to access platform directories in order to make the OS specific behavior testable.
Hello, first of all my apologies, this one turned out getting larger than expected - the import was partially kind of tricky. After playing a while, I'm with @abhinayagarwal (approach 2) to do all the imports silently and never ask. Goals of this PR:
It works as follows:
This PR consists of 3 larger changes:To achieve this goal and to get most components of this tested, following work has been performed: 1 - version specific settings
2 - Import of application specific preferences
PreferencesImporter prefsImporter = PreferencesController.getSingleton().getImporter();
prefsImporter.askForActionAndRun();
// if the user opts out, the import action for User Library is disabled via a preferences key
3 - Import of user library
// The import will start as soon as the user library is initialized.
// Import status, if triggered, if failed or completed, will be written to log.
// Only files are copied which do not exist in target library directory
Platform.runLater(UserLibraryImporter.createImportTask()); The import progress and possible issues are stored in Scene Builder log file. Here it is then possible to see from which version the import was started and also which JARs were imported. I'll add a flow / state diagram to illustrate what where happens. |
app/src/main/java/com/oracle/javafx/scenebuilder/app/preferences/PreferencesImporter.java
Outdated
Show resolved
Hide resolved
User library is imported using a task, so it runs in the background. Progress and results are logged.
a371a5f
to
0c98a20
Compare
@AlmasB Hi Almas, I'll make this one fit to properly merge with the current main line. |
I've only skimmed through this, but I was wondering if you can split this into multiple smaller PRs: one for tests, one for production code change, one for refactor, etc. That way it's easier to review and manage scope. See if that is possible? |
Hello @AlmasB, exactly as you proposed, I'll rework this one and re-issue smaller PRs. |
Application data, User Library and Preferences are now stored specific to each SceneBuilder version. Thus multiple versions can run in parallel.
Until now, all Scene Builder versions shared the same settings tree in file system (application data) which prevented parallel execution of Scene Builder versions. It was not possible, to compare e.g. SB11 with SB16 or SB8 side by side. This works now.
Also, user library was shared amongst all SB versions which in some cases lead to trouble as e.g. when there were multiple versions of the same control for different JDKs.
Issue
Fixes #369
Fixes #395 (partially)
Fixes #346
Progress