Search in sources :

Example 1 with VariableMappingView

use of com.kyj.fx.voeditor.visual.component.popup.VariableMappingView in project Gargoyle by callakrsos.

the class SqlPane method execute.

private void execute() {
    SqlTab selectedItem = sqlTabPane.getSelectedTab();
    String sql = selectedItem.getSelectedSQLText();
    if (sql == null || sql.isEmpty()) {
        sql = selectedItem.getSqlText();
        if (sql == null || sql.isEmpty())
            return;
    }
    String trimedSql = sql.trim();
    // 2016-09-03 오라클에서는 쿼리문장끝에 ';' 이 포함되면 안되므로 제거
    if (trimedSql.endsWith(";")) {
        trimedSql = trimedSql.substring(0, trimedSql.length() - 1);
    }
    String _sql = trimedSql;
    if (ValueUtil.isVelocityContext(_sql)) {
        VariableMappingView mappingView = new VariableMappingView(stage);
        mappingView.extractVariableFromSql(_sql);
        mappingView.showAndWait(dynamicParams -> {
            execute(_sql, dynamicParams);
        });
    } else
        execute(_sql);
}
Also used : VariableMappingView(com.kyj.fx.voeditor.visual.component.popup.VariableMappingView) SqlTab(com.kyj.fx.voeditor.visual.component.sql.tab.SqlTab)

Example 2 with VariableMappingView

use of com.kyj.fx.voeditor.visual.component.popup.VariableMappingView in project Gargoyle by callakrsos.

the class MapValueFactoryExam method start.

/*
	 * (non-Javadoc)
	 * 
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    VariableMappingView controller = new VariableMappingView();
    controller.extractVariableFromSql("select * from tbm_sm_user where user_id = :userId");
    //controller.setVariableItems(extractVariableFromSql);
    primaryStage.setScene(new Scene(new BorderPane(controller)));
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) VariableMappingView(com.kyj.fx.voeditor.visual.component.popup.VariableMappingView) Scene(javafx.scene.Scene)

Example 3 with VariableMappingView

use of com.kyj.fx.voeditor.visual.component.popup.VariableMappingView in project Gargoyle by callakrsos.

the class DialogExam method start.

/*
	 * (non-Javadoc)
	 * 
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    String sql = "select * from tbm_sm_user where user_id = :userId";
    Button center = new Button("클릭");
    center.setOnMouseClicked(event -> {
        VariableMappingView variableMappingView = new VariableMappingView();
        variableMappingView.extractVariableFromSql(sql);
        variableMappingView.showAndWait(item -> {
            System.out.println(item);
        });
    });
    primaryStage.setScene(new Scene(new BorderPane(center)));
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Button(javafx.scene.control.Button) VariableMappingView(com.kyj.fx.voeditor.visual.component.popup.VariableMappingView) Scene(javafx.scene.Scene)

Example 4 with VariableMappingView

use of com.kyj.fx.voeditor.visual.component.popup.VariableMappingView in project Gargoyle by callakrsos.

the class SqlMultiplePane method execute.

private void execute() {
    SqlTab selectedItem = sqlTabPane.getSelectedTab();
    String sql = selectedItem.getSelectedSQLText();
    if (sql == null || sql.isEmpty()) {
        sql = selectedItem.getSqlText();
    }
    if (sql == null || sql.isEmpty())
        return;
    final String _sql = sql;
    if (ValueUtil.isVelocityContext(_sql)) {
        VariableMappingView mappingView = new VariableMappingView(stage);
        mappingView.extractVariableFromSql(_sql);
        mappingView.showAndWait(dynamicParams -> {
            execute(_sql, dynamicParams);
        });
    } else
        execute(_sql);
}
Also used : VariableMappingView(com.kyj.fx.voeditor.visual.component.popup.VariableMappingView) SqlTab(com.kyj.fx.voeditor.visual.component.sql.tab.SqlTab)

Aggregations

VariableMappingView (com.kyj.fx.voeditor.visual.component.popup.VariableMappingView)4 SqlTab (com.kyj.fx.voeditor.visual.component.sql.tab.SqlTab)2 Scene (javafx.scene.Scene)2 BorderPane (javafx.scene.layout.BorderPane)2 Button (javafx.scene.control.Button)1