Search in sources :

Example 1 with CommonsSqllPan

use of com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan 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 CommonsSqllPan

use of com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan in project Gargoyle by callakrsos.

the class SystemLayoutViewController method lblDatabaseMouseClick.

@FXML
public void lblDatabaseMouseClick(MouseEvent e) {
    try {
        CommonsSqllPan sqlPane = CommonsSqllPan.getSqlPane();
        loadNewSystemTab(String.format("Database[%s]", sqlPane.getClass().getSimpleName()), sqlPane);
    //			Stage stage = new Stage();
    //			sqlPane.setStage(stage);
    //			Scene scene = new Scene(new BorderPane(sqlPane), 1100, 900);
    //			scene.getStylesheets().add(SkinManager.getInstance().getSkin());
    //			stage.setScene(scene);
    //			stage.setAlwaysOnTop(false);
    //			stage.initOwner(SharedMemory.getPrimaryStage());
    //			stage.show();
    } catch (Exception ex) {
        LOGGER.error(ValueUtil.toString(ex));
        DialogUtil.showExceptionDailog(ex);
    }
}
Also used : CommonsSqllPan(com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException) FXML(javafx.fxml.FXML)

Example 3 with CommonsSqllPan

use of com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan in project Gargoyle by callakrsos.

the class SqlTabPanExample method start.

@Override
public void start(Stage primaryStage) throws NotYetSupportException, GargoyleConnectionFailException, InstantiationException, IllegalAccessException, ClassNotFoundException {
    primaryStage.setTitle("Database Exam");
    CommonsSqllPan sqlPane = CommonsSqllPan.getSqlPane();
    sqlPane.getStylesheets().add(SkinManager.getInstance().getSkin());
    BorderPane root = new BorderPane(sqlPane);
    Menu menu = new Menu("Exam");
    MenuItem e = new MenuItem("exam");
    e.setOnAction(System.out::println);
    e.setAccelerator(new KeyCodeCombination(KeyCode.E, KeyCombination.CONTROL_DOWN));
    menu.getItems().add(e);
    root.setTop(new MenuBar(menu));
    primaryStage.setScene(new Scene(root, 1100, 700));
    primaryStage.show();
// Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
// DockPane.initializeDefaultUserAgentStylesheet();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) CommonsSqllPan(com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan) MenuBar(javafx.scene.control.MenuBar) MenuItem(javafx.scene.control.MenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Menu(javafx.scene.control.Menu) Scene(javafx.scene.Scene)

Aggregations

CommonsSqllPan (com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan)3 DockNode (com.kyj.fx.voeditor.visual.component.dock.pane.DockNode)1 GargoyleException (com.kyj.fx.voeditor.visual.exceptions.GargoyleException)1 NotYetSupportException (com.kyj.fx.voeditor.visual.exceptions.NotYetSupportException)1 IOException (java.io.IOException)1 FXML (javafx.fxml.FXML)1 Scene (javafx.scene.Scene)1 Menu (javafx.scene.control.Menu)1 MenuBar (javafx.scene.control.MenuBar)1 MenuItem (javafx.scene.control.MenuItem)1 KeyCodeCombination (javafx.scene.input.KeyCodeCombination)1 BorderPane (javafx.scene.layout.BorderPane)1 JSONObject (org.json.simple.JSONObject)1