Search in sources :

Example 1 with NotYetSupportException

use of com.kyj.fx.voeditor.visual.exceptions.NotYetSupportException in project Gargoyle by callakrsos.

the class DatabaseUrlManagementView method showSqlPane.

public void showSqlPane(int nRow) throws Exception {
    Map<String, Object> map = tbDatabase.getItems().get(nRow);
    Object object = map.get("dbms");
    if (object == null)
        return;
    String dbms = object.toString();
    if (dbms == null || dbms == "") {
        String msg = "not yet supported..." + dbms;
        LOGGER.error(msg);
        throw new NotYetSupportException(msg);
    }
    String jdbcDriver = ConfigResourceLoader.getInstance().get("dbms." + dbms);
    map.put("driver", jdbcDriver);
    CommonsSqllPan sqlPane = CommonsSqllPan.getSqlPane(dbms);
    sqlPane.initialize(map);
    // Scene scene = new Scene(root, 1100, 700);
    sqlPane.setPrefSize(1100, 900);
    String title = String.format("Database[%s]", sqlPane.getClass().getSimpleName());
    DockNode dockNode = new DockNode(sqlPane, title);
    //		Platform.runLater(() -> {
    //			dockNode.setMaximized(true);
    //		});
    // dockNode.setFloating(true, new Point2D(0,0));
    // dockNode.getStage().centerOnScreen();
    FxUtil.createDockStageAndShow(null, dockNode);
// FxUtil.createStageAndShow(title, dockNode, stage -> {
// stage.getScene().getStylesheets().add(SkinManager.getInstance().getSkin());
// dockNode.floatingProperty().addListener((oba, o, n) -> {
// if (n)
// stage.close();
// });
// });
// Stage stage = new Stage();
// sqlPane.setStage(stage);
// scene.getStylesheets().add(SkinManager.getInstance().getSkin());
// stage.setScene(scene);
// stage.setTitle(dbms);
//
//
//
// stage.show();
}
Also used : CommonsSqllPan(com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan) DockNode(com.kyj.fx.voeditor.visual.component.dock.pane.DockNode) JSONObject(org.json.simple.JSONObject) NotYetSupportException(com.kyj.fx.voeditor.visual.exceptions.NotYetSupportException)

Example 2 with NotYetSupportException

use of com.kyj.fx.voeditor.visual.exceptions.NotYetSupportException in project Gargoyle by callakrsos.

the class CommonsSqllPan method getSqlPane.

/**
	 * 설정에 정의된 BASE_KEY_JDBC_DRIVER에 맞는 jdbc Driver의 SQL 패널을 반환
	 *
	 * @return
	 * @throws NotYetSupportException
	 */
public static CommonsSqllPan getSqlPane(String dbms) throws Exception {
    CommonsSqllPan sqlPane = null;
    String classLocation = ResourceLoader.getInstance().get("dbms." + dbms + ".pane");
    try {
        Class<?> forName = Class.forName(classLocation);
        Constructor<?> constructor = forName.getConstructor(String.class);
        constructor.setAccessible(true);
        sqlPane = (CommonsSqllPan) constructor.newInstance(dbms);
        // 특화된 스타일적용처리 -> 트리에서 기본키이면 붉은색으로 색칠.
        sqlPane.getSchemaTree().setCellFactory(new DatabaseTreeCallback<>());
    } catch (Exception e) {
        // e.printStackTrace();
        String msg = "not yet supported..." + e.getMessage();
        LOGGER.error(msg);
        throw new NotYetSupportException(msg);
    }
    return sqlPane;
}
Also used : NotYetSupportException(com.kyj.fx.voeditor.visual.exceptions.NotYetSupportException) GargoyleConnectionFailException(com.kyj.fx.voeditor.visual.exceptions.GargoyleConnectionFailException) SQLException(java.sql.SQLException) IOException(java.io.IOException) GagoyleParamEmptyException(com.kyj.fx.voeditor.visual.exceptions.GagoyleParamEmptyException) NotYetSupportException(com.kyj.fx.voeditor.visual.exceptions.NotYetSupportException)

Aggregations

NotYetSupportException (com.kyj.fx.voeditor.visual.exceptions.NotYetSupportException)2 DockNode (com.kyj.fx.voeditor.visual.component.dock.pane.DockNode)1 CommonsSqllPan (com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan)1 GagoyleParamEmptyException (com.kyj.fx.voeditor.visual.exceptions.GagoyleParamEmptyException)1 GargoyleConnectionFailException (com.kyj.fx.voeditor.visual.exceptions.GargoyleConnectionFailException)1 IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 JSONObject (org.json.simple.JSONObject)1