feat: ADD Refresh library menu item#391
feat: ADD Refresh library menu item#391luca-domenichini wants to merge 4 commits intogluonhq:masterfrom
Conversation
on closing the library manager dialog and if the user made some modifications only
|
@abhinayagarwal any news on this? |
There was a problem hiding this comment.
Hi @luca-domenichini,
I've reviewed the code in a very basic way yet. Still playing around with it but I like the idea.
Those license headers require updates (unfortunately) and please consider replacing the ReturningRunnable with a standard Java Supplier (actually supplier does the job and we won't have to maintain the code).
Nevertheless, at a first view this looks good but I'll run a 2nd review to see if we can hook in some tests.
Sorry for the long delay!
| package com.oracle.javafx.scenebuilder.kit.util; | ||
|
|
||
| @FunctionalInterface | ||
| public interface ReturningRunnable<T> { |
There was a problem hiding this comment.
Would it be okay to replace ReturningRunnable with java.util.function.Supplier?
The reason I can imagine here is just to lower maintenance efforts. Supplier is pretty much standard and we won't have to care for license and other stuff.
| <RadioMenuItem fx:id="libraryViewAsSections" mnemonicParsing="false" onAction="#onLibraryViewAsSections" text="%library.panel.menu.view.sections" toggleGroup="$libraryDisplayOptionTG" /> | ||
| <SeparatorMenuItem mnemonicParsing="false" /> | ||
| <MenuItem mnemonicParsing="false" onAction="#onManageJarFxml" text="%library.panel.menu.manage.jar.fxml" /> | ||
| <MenuItem mnemonicParsing="false" onAction="#onLibraryRefresh" text="%library.panel.menu.refresh" /> |
There was a problem hiding this comment.
Please update the license header in line 4 from Copyright (c) 2016, 2019, Gluon and/or its affiliates. to Copyright (c) 2016, 2022, Gluon and/or its affiliates..
|
|
||
| private Runnable onAddJar; | ||
| private Runnable onAddFolder; | ||
| private ReturningRunnable<Boolean> onAddJar; |
There was a problem hiding this comment.
Please consider replacing the ReturningRunnable with JDKs default java.util.function.Supplier interface.
| import com.oracle.javafx.scenebuilder.kit.preferences.MavenPreferences; | ||
| import com.oracle.javafx.scenebuilder.kit.preferences.PreferencesControllerBase; | ||
| import com.oracle.javafx.scenebuilder.kit.preferences.PreferencesRecordArtifact; | ||
| import com.oracle.javafx.scenebuilder.kit.util.ReturningRunnable; |
There was a problem hiding this comment.
Please change line 2 from * Copyright (c) 2016, 2021, Gluon and/or its affiliates. into * Copyright (c) 2016, 2022, Gluon and/or its affiliates..
| }; | ||
|
|
||
| private final PreferencesControllerBase preferencesControllerBase; | ||
| private boolean confirmed; |
There was a problem hiding this comment.
Please update line 2 from * Copyright (c) 2016, 2017 Gluon and/or its affiliates. into * Copyright (c) 2016, 2022 Gluon and/or its affiliates..
| @@ -31,15 +31,6 @@ | |||
| */ | |||
| package com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.search; | |||
There was a problem hiding this comment.
Please update license header here in line 2 from * Copyright (c) 2016, 2017 Gluon and/or its affiliates. to * Copyright (c) 2016, 2022 Gluon and/or its affiliates..
| @@ -43,10 +43,6 @@ | |||
| import java.nio.file.Files; | |||
There was a problem hiding this comment.
Please update license header here in line 2 from * Copyright (c) 2017, 2021 Gluon and/or its affiliates. to * Copyright (c) 2017, 2022 Gluon and/or its affiliates..
| @@ -75,7 +75,7 @@ | |||
| */ | |||
There was a problem hiding this comment.
Please update license header here from * Copyright (c) 2017, Gluon and/or its affiliates. to * Copyright (c) 2017, 2022, Gluon and/or its affiliates..
Implemenation of #390
Pressing the menù item updates the library from scratch.