ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/2] incubator-ignite git commit: # IGNITE-32 WIP: Do not show root in tree view. Workaround for Mac OS doc icon. Use user.home as default path.
Date Thu, 08 Jan 2015 12:24:02 GMT
# IGNITE-32 WIP: Do not show root in tree view. Workaround for Mac OS doc icon. Use user.home
as default path.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8626532d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8626532d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8626532d

Branch: refs/heads/ignite-32
Commit: 8626532d7aedc6004a1b8ef9d8065f38cb0d6d73
Parents: 21b12d6
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Thu Jan 8 19:24:02 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Thu Jan 8 19:24:02 2015 +0700

----------------------------------------------------------------------
 .../apache/ignite/schema/ui/SchemaLoadApp.java  | 49 ++++++++++++--------
 1 file changed, 29 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8626532d/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
b/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
index 3007115..f6518f5 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
@@ -21,6 +21,7 @@ import org.apache.ignite.schema.xml.*;
 import org.gridgain.grid.cache.query.*;
 import org.gridgain.grid.util.typedef.internal.*;
 
+import java.awt.Toolkit;
 import java.io.*;
 import java.net.*;
 import java.sql.*;
@@ -586,6 +587,8 @@ public class SchemaLoadApp extends Application {
 
         tree = new TreeView<>(rootItem);
 
+        tree.setShowRoot(false);
+
         tree.setCellFactory(CheckBoxTreeCell.<String>forTreeView());
 
         tree.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<String>>()
{
@@ -642,8 +645,6 @@ public class SchemaLoadApp extends Application {
             }
         });
 
-        btnNaming.setDisable(true);
-
         dfltNamingCh.setOnAction(new EventHandler<ActionEvent>() {
             /** {@inheritDoc} */
             @Override public void handle(ActionEvent evt) {
@@ -665,25 +666,13 @@ public class SchemaLoadApp extends Application {
 
         primaryStage.setTitle("Schema Load");
 
-        Image logo128 = image("ignite", 128);
-
         primaryStage.getIcons().addAll(
             image("ignite", 16),
             image("ignite", 24),
             image("ignite", 32),
             image("ignite", 48),
             image("ignite", 64),
-            logo128);
-
-        try {
-            Class<?> appCls = Class.forName("com.apple.eawt.Application");
-
-            Object osxApp = appCls.getDeclaredMethod("getApplication").invoke(null);
-
-            appCls.getDeclaredMethod("setDockIconImage", Image.class).invoke(osxApp, fromFXImage(logo128,
null));
-        } catch (Throwable ignore) {
-            // No-op.
-        }
+            image("ignite", 128));
 
         rootPane = new BorderPane();
 
@@ -699,7 +688,7 @@ public class SchemaLoadApp extends Application {
 
         primaryStage.setScene(scene(rootPane));
 
-        primaryStage.setWidth(400);
+        primaryStage.setWidth(500);
         primaryStage.setMinWidth(400);
 
         primaryStage.setHeight(600);
@@ -712,7 +701,7 @@ public class SchemaLoadApp extends Application {
         // Restore window pos and size.
         double x = userPrefs.getDouble("window.x", 100);
         double y = userPrefs.getDouble("window.y", 100);
-        double w = userPrefs.getDouble("window.width", 400);
+        double w = userPrefs.getDouble("window.width", 500);
         double h = userPrefs.getDouble("window.height", 600);
 
         // Ensure that window fit any available screen.
@@ -727,16 +716,18 @@ public class SchemaLoadApp extends Application {
             primaryStage.setHeight(h);
         }
 
+        String userHome = System.getProperty("user.home").replace('\\', '/');
+
         // Restore connection pane settings.
         jdbcDrvJarTf.setText(userPrefs.get("jdbc.driver.jar", "h2.jar"));
         jdbcDrvClsTf.setText(userPrefs.get("jdbc.driver.class", "org.h2.Driver"));
-        jdbcUrlTf.setText(userPrefs.get("jdbc.url", "jdbc:h2:~/test"));
+        jdbcUrlTf.setText(userPrefs.get("jdbc.url", "jdbc:h2:" + userHome + "/schema-load/db"));
         userTf.setText(userPrefs.get("jdbc.user", "sa"));
 
         // Restore generation pane settings.
-        outFolderTf.setText(userPrefs.get("out.folder", "~/temp"));
+        outFolderTf.setText(userPrefs.get("out.folder", userHome + "/schema-load/out"));
         pkgTf.setText(userPrefs.get("pojo.package", "org.apache.ignite"));
-        pojoIncludeKeysCh.setSelected(userPrefs.getBoolean("pojo.include", false));
+        pojoIncludeKeysCh.setSelected(userPrefs.getBoolean("pojo.include", true));
         pojoConstructorCh.setSelected(userPrefs.getBoolean("pojo.constructor", false));
         xmlSingleFileCh.setSelected(userPrefs.getBoolean("xml.single", true));
         dfltNamingCh.setSelected(userPrefs.getBoolean("naming.default", true));
@@ -776,6 +767,24 @@ public class SchemaLoadApp extends Application {
      * @param args Command line arguments passed to the application.
      */
     public static void main(String[] args) {
+        // Workaround for JavaFX + Mac OS dock icon.
+        if (System.getProperty("os.name").toLowerCase().contains("mac os")) {
+            System.setProperty("javafx.macosx.embedded", "true");
+
+            Toolkit.getDefaultToolkit();
+
+            try {
+                Class<?> appCls = Class.forName("com.apple.eawt.Application");
+
+                Object osxApp = appCls.getDeclaredMethod("getApplication").invoke(null);
+
+                appCls.getDeclaredMethod("setDockIconImage", Image.class)
+                    .invoke(osxApp, fromFXImage(image("ignite", 128), null));
+            } catch (Throwable ignore) {
+                // No-op.
+            }
+        }
+
         launch(args);
     }
 }


Mime
View raw message