MenuController.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:zest-writer 作者:
@FXML private void handleSwitchWorkspaceAction(ActionEvent event) throws IOException{
    DirectoryChooser fileChooser = new DirectoryChooser();
    fileChooser.setInitialDirectory(MainApp.getDefaultHome());
    fileChooser.setTitle(Configuration.getBundle().getString("ui.dialog.switchworkspace"));
    File selectedDirectory = fileChooser.showDialog(MainApp.getPrimaryStage());
    if(selectedDirectory!=null) {
        MainApp.getConfig().setWorkspacePath(selectedDirectory.getAbsolutePath());
        MainApp.getConfig().loadWorkspace();

        Alert alert = new CustomAlert(AlertType.INFORMATION);
        alert.setTitle(Configuration.getBundle().getString("ui.options.workspace"));
        alert.setHeaderText(Configuration.getBundle().getString("ui.dialog.workspace.header"));
        alert.setContentText(Configuration.getBundle().getString("ui.dialog.workspace.text") + " " + MainApp.getConfig().getWorkspacePath());
        alert.setResizable(true);

        alert.showAndWait();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号