/
rgd045
/
crypt-file
Обзор
Документация
Войти
/
rgd045
/
crypt-file
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/main/java/org/cryptomator/ui/quit/QuitComponent.java
50 строк
1 KB
Jan-Peter Klein
switch scene in quitDialog to quitForcedDialog instead of init new window
05 июл 2022, 15:22
05 июл 2022, 15:22
683276a
Код
Авторство
О чём код?
/******************************************************************************* * Copyright (c) 2017 Skymatic UG (haftungsbeschränkt). * All rights reserved. This program and the accompanying materials * are made available under the terms of the accompanying LICENSE file. *******************************************************************************/ package org.cryptomator.ui.quit; import dagger.Lazy; import dagger.Subcomponent; import org.cryptomator.ui.common.FxmlFile; import org.cryptomator.ui.common.FxmlScene; import javafx.scene.Scene; import javafx.stage.Stage; import java.awt.desktop.QuitResponse; import java.util.concurrent.atomic.AtomicReference; @QuitScoped @Subcomponent(modules = {QuitModule.class}) public interface QuitComponent { @QuitWindow Stage window(); @FxmlScene(FxmlFile.QUIT) Lazy<Scene> quitScene(); @FxmlScene(FxmlFile.QUIT_FORCED) Lazy<Scene> quitForcedScene(); @QuitWindow AtomicReference<QuitResponse> quitResponse(); default void showQuitWindow(QuitResponse response, boolean forced) { Stage stage = window(); quitResponse().set(response); if(forced){ stage.setScene(quitForcedScene().get()); } else{ stage.setScene(quitScene().get()); } stage.sizeToScene(); stage.show(); } @Subcomponent.Builder interface Builder { QuitComponent build(); } }