mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 06:59:44 +07:00
OPENIDE #29 Переложить артефакты из JB ресурсов к нам
(cherry picked from commit 15f3c6643b)
This commit is contained in:
@@ -113,36 +113,35 @@ public final class SceneBuilderEditor extends UserDataHolderBase implements File
|
||||
e instanceof NoClassDefFoundError &&
|
||||
!SceneBuilderUtil.getSceneBuilder11Path().toFile().isFile()) {
|
||||
myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.open.file.error"));
|
||||
// TODO [OpenIDE]: https://git.haulmont.com/platform/open-ide/idea/-/issues/29
|
||||
//myErrorNotification.createActionLabel(
|
||||
// JavaFXBundle.message("javafx.scene.builder.editor.download.scene.builder.kit"),
|
||||
// () -> {
|
||||
// DownloadableFileService service = DownloadableFileService.getInstance();
|
||||
// var description = service.createFileDescription("https://cache-redirector.jetbrains.com/" +
|
||||
// "intellij-dependencies/org/jetbrains/intellij/deps/scenebuilderkit/" +
|
||||
// SceneBuilderUtil.SCENE_BUILDER_VERSION + "/" + SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME, SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME);
|
||||
// FileDownloader downloader = service.createDownloader(Collections.singletonList(description), "Scene Builder Kit");
|
||||
// try {
|
||||
// Path tempDir = Files.createTempDirectory("");
|
||||
//
|
||||
// final var list = downloader.downloadWithProgress(tempDir.toString(), myProject, myErrorPanel);
|
||||
// if (list == null || list.isEmpty()) {
|
||||
// myErrorNotification.clear();
|
||||
// myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.download.kit.error"));
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// FileUtil.copy(VfsUtilCore.virtualToIoFile(list.get(0).first), SceneBuilderUtil.getSceneBuilder11Path().toFile());
|
||||
// FileUtil.delete(tempDir.toFile());
|
||||
//
|
||||
// SceneBuilderUtil.updateLoader();
|
||||
// updateState();
|
||||
// }
|
||||
// catch (IOException e2) {
|
||||
// LOG.warn("Can't download SceneBuilderKit", e2);
|
||||
// }
|
||||
// }
|
||||
//);
|
||||
myErrorNotification.createActionLabel(
|
||||
JavaFXBundle.message("javafx.scene.builder.editor.download.scene.builder.kit"),
|
||||
() -> {
|
||||
DownloadableFileService service = DownloadableFileService.getInstance();
|
||||
var description = service.createFileDescription("https://download.openide.ru" +
|
||||
"/deps/scenebuilderkit/" +
|
||||
SceneBuilderUtil.SCENE_BUILDER_VERSION + "/" + SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME, SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME);
|
||||
FileDownloader downloader = service.createDownloader(Collections.singletonList(description), "Scene Builder Kit");
|
||||
try {
|
||||
Path tempDir = Files.createTempDirectory("");
|
||||
|
||||
final var list = downloader.downloadWithProgress(tempDir.toString(), myProject, myErrorPanel);
|
||||
if (list == null || list.isEmpty()) {
|
||||
myErrorNotification.clear();
|
||||
myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.download.kit.error"));
|
||||
return;
|
||||
}
|
||||
|
||||
FileUtil.copy(VfsUtilCore.virtualToIoFile(list.get(0).first), SceneBuilderUtil.getSceneBuilder11Path().toFile());
|
||||
FileUtil.delete(tempDir.toFile());
|
||||
|
||||
SceneBuilderUtil.updateLoader();
|
||||
updateState();
|
||||
}
|
||||
catch (IOException e2) {
|
||||
LOG.warn("Can't download SceneBuilderKit", e2);
|
||||
}
|
||||
}
|
||||
);
|
||||
myLayout.show(myPanel, ERROR_CARD);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user