Search in sources :

Example 1 with LoadFileOptionHandler

use of com.kyj.fx.voeditor.visual.functions.LoadFileOptionHandler in project Gargoyle by callakrsos.

the class SqlTab method miOenOnAction.

public void miOenOnAction(ActionEvent e) {
    File showFileDialog = DialogUtil.showFileDialog(/*SharedMemory.getPrimaryStage()*/
    null, choser -> {
        choser.getExtensionFilters().add(new ExtensionFilter(GargoyleExtensionFilters.SQL_NAME, GargoyleExtensionFilters.SQL));
    });
    //선택한 파일이 정상적으로 선택된 경우는 null이 아님.
    if (showFileDialog != null) {
        String fileContent = FileUtil.readFile(showFileDialog, new LoadFileOptionHandler());
        if (fileContent != null) /*공백여부는 체크안함. 파일 내용에 실제 공백이 포함될 수 있으므로...*/
        {
            setTxtSql(fileContent);
            setText(showFileDialog.getName());
        }
    }
    e.consume();
}
Also used : LoadFileOptionHandler(com.kyj.fx.voeditor.visual.functions.LoadFileOptionHandler) ExtensionFilter(javafx.stage.FileChooser.ExtensionFilter) File(java.io.File)

Example 2 with LoadFileOptionHandler

use of com.kyj.fx.voeditor.visual.functions.LoadFileOptionHandler in project Gargoyle by callakrsos.

the class DimCat method cat.

public String cat(String prjSpec, String path, String revision, String encoding) {
    File copy = copy(prjSpec, path, revision, encoding);
    LoadFileOptionHandler defaultHandler = LoadFileOptionHandler.getDefaultHandler();
    defaultHandler.setEncoding(encoding);
    return FileUtil.readFile(copy, defaultHandler);
}
Also used : LoadFileOptionHandler(com.kyj.fx.voeditor.visual.functions.LoadFileOptionHandler) File(java.io.File)

Aggregations

LoadFileOptionHandler (com.kyj.fx.voeditor.visual.functions.LoadFileOptionHandler)2 File (java.io.File)2 ExtensionFilter (javafx.stage.FileChooser.ExtensionFilter)1