mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +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 &&
|
e instanceof NoClassDefFoundError &&
|
||||||
!SceneBuilderUtil.getSceneBuilder11Path().toFile().isFile()) {
|
!SceneBuilderUtil.getSceneBuilder11Path().toFile().isFile()) {
|
||||||
myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.open.file.error"));
|
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(
|
||||||
//myErrorNotification.createActionLabel(
|
JavaFXBundle.message("javafx.scene.builder.editor.download.scene.builder.kit"),
|
||||||
// JavaFXBundle.message("javafx.scene.builder.editor.download.scene.builder.kit"),
|
() -> {
|
||||||
// () -> {
|
DownloadableFileService service = DownloadableFileService.getInstance();
|
||||||
// DownloadableFileService service = DownloadableFileService.getInstance();
|
var description = service.createFileDescription("https://download.openide.ru" +
|
||||||
// var description = service.createFileDescription("https://cache-redirector.jetbrains.com/" +
|
"/deps/scenebuilderkit/" +
|
||||||
// "intellij-dependencies/org/jetbrains/intellij/deps/scenebuilderkit/" +
|
SceneBuilderUtil.SCENE_BUILDER_VERSION + "/" + SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME, SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME);
|
||||||
// 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");
|
||||||
// FileDownloader downloader = service.createDownloader(Collections.singletonList(description), "Scene Builder Kit");
|
try {
|
||||||
// try {
|
Path tempDir = Files.createTempDirectory("");
|
||||||
// Path tempDir = Files.createTempDirectory("");
|
|
||||||
//
|
final var list = downloader.downloadWithProgress(tempDir.toString(), myProject, myErrorPanel);
|
||||||
// final var list = downloader.downloadWithProgress(tempDir.toString(), myProject, myErrorPanel);
|
if (list == null || list.isEmpty()) {
|
||||||
// if (list == null || list.isEmpty()) {
|
myErrorNotification.clear();
|
||||||
// myErrorNotification.clear();
|
myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.download.kit.error"));
|
||||||
// myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.download.kit.error"));
|
return;
|
||||||
// return;
|
}
|
||||||
// }
|
|
||||||
//
|
FileUtil.copy(VfsUtilCore.virtualToIoFile(list.get(0).first), SceneBuilderUtil.getSceneBuilder11Path().toFile());
|
||||||
// FileUtil.copy(VfsUtilCore.virtualToIoFile(list.get(0).first), SceneBuilderUtil.getSceneBuilder11Path().toFile());
|
FileUtil.delete(tempDir.toFile());
|
||||||
// FileUtil.delete(tempDir.toFile());
|
|
||||||
//
|
SceneBuilderUtil.updateLoader();
|
||||||
// SceneBuilderUtil.updateLoader();
|
updateState();
|
||||||
// updateState();
|
}
|
||||||
// }
|
catch (IOException e2) {
|
||||||
// catch (IOException e2) {
|
LOG.warn("Can't download SceneBuilderKit", e2);
|
||||||
// LOG.warn("Can't download SceneBuilderKit", e2);
|
}
|
||||||
// }
|
}
|
||||||
// }
|
);
|
||||||
//);
|
|
||||||
myLayout.show(myPanel, ERROR_CARD);
|
myLayout.show(myPanel, ERROR_CARD);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user