ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: # IGNITE-32 WIP: Minor UI tweaks.
Date Mon, 12 Jan 2015 09:53:17 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-32 a22a81e91 -> f5c1ed148


# IGNITE-32 WIP: Minor UI tweaks.


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

Branch: refs/heads/ignite-32
Commit: f5c1ed1483352290b4ca27198b32c6256ca97497
Parents: a22a81e
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Mon Jan 12 16:53:40 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Mon Jan 12 16:53:40 2015 +0700

----------------------------------------------------------------------
 .../org/apache/ignite/schema/ui/Controls.java   |  2 +
 .../apache/ignite/schema/ui/SchemaLoadApp.java  | 56 ++++++++++++++++++--
 .../java/org/apache/ignite/Organization.java    |  8 +--
 .../java/org/apache/ignite/OrganizationKey.java |  4 +-
 .../src/test/java/org/apache/ignite/Person.java |  8 +--
 .../test/java/org/apache/ignite/PersonKey.java  |  4 +-
 6 files changed, 67 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5c1ed14/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/Controls.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/Controls.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/Controls.java
index 2131a8d..0bda823 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/Controls.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/Controls.java
@@ -288,6 +288,8 @@ public class Controls {
 
         col.setGraphic(tipLb);
 
+        col.setSortable(false);
+
         if (minWidth > 0)
             col.setMinWidth(minWidth);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5c1ed14/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 55a5eb3..7e018c6 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
@@ -503,11 +503,37 @@ public class SchemaLoadApp extends Application {
     }
 
     /**
+     * Check that text field is non empty.
+     *
+     * @param tf Text field to check.
+     * @param msg Warning message.
+     * @return {@code true} If text field is empty.
+     */
+    private boolean checkInput(TextField tf, String msg) {
+        if (tf.getText().trim().isEmpty()) {
+            tf.requestFocus();
+
+            MessageBox.warningDialog(owner, msg);
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
      * Go to &quot;Generate XML And POJOs&quot; panel or generate XML and POJOs.
      */
     private void next() {
-        if (rootPane.getCenter() == connLayerPnl)
+        if (rootPane.getCenter() == connLayerPnl) {
+            if (checkInput(jdbcDrvJarTf, "Path to JDBC driver is not specified!") ||
+                checkInput(jdbcDrvClsTf, "JDBC driver class name is not specified!") ||
+                checkInput(jdbcUrlTf, "JDBC URL connection string is not specified!") ||
+                checkInput(userTf, "User name is not specified!"))
+                return;
+
             fill();
+        }
         else
             generate();
     }
@@ -593,7 +619,7 @@ public class SchemaLoadApp extends Application {
 
         jdbcDrvClsTf = connPnl.addLabeled("JDBC Driver:", textField("", "Class name for JDBC
driver"), 2);
 
-        jdbcUrlTf = connPnl.addLabeled("URL:", textField("", "URL of the database connection
string"), 2);
+        jdbcUrlTf = connPnl.addLabeled("JDBC URL:", textField("", "JDBC URL of the database
connection string"), 2);
 
         userTf = connPnl.addLabeled("User:", textField("", "User name"), 2);
 
@@ -649,10 +675,34 @@ public class SchemaLoadApp extends Application {
 
         tbl.setMinHeight(50);
         tbl.setPlaceholder(text("Select table to see table columns", 0));
-        tbl.getColumns().addAll(keyCol, dbNameCol, dbTypeNameCol, javaNameCol, javaTypeNameCol);
+
+        final TableColumn[] cols = {keyCol, dbNameCol, dbTypeNameCol, javaNameCol, javaTypeNameCol};
+
+        //noinspection unchecked
+        tbl.getColumns().addAll(cols);
         tbl.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
         tbl.setEditable(true);
 
+        tbl.getColumns().addListener(new ListChangeListener<TableColumn<Field,?>>()
{
+            public boolean suspended;
+
+            /** {@inheritDoc} */
+            @Override public void onChanged(Change change) {
+                change.next();
+                if (change.wasReplaced() && !suspended) {
+                    suspended = true;
+
+                    try {
+                        //noinspection unchecked
+                        tbl.getColumns().setAll(cols);
+                    }
+                    finally {
+                        suspended = false;
+                    }
+                }
+            }
+        });
+
         final Button upBtn = button(imageView("navigate_up", 24), "Move selected row up",
             new EventHandler<ActionEvent>() {
                 @Override public void handle(ActionEvent evt) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5c1ed14/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/Organization.java b/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
index 7a8f988..8c163bb 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
@@ -129,9 +129,9 @@ public class Organization implements Serializable {
     /** {@inheritDoc} */
     @Override public String toString() {
         return "Organization [" + 
-            " id=" + id + 
-            " name=" + name + 
-            " city=" + city + 
-        "]";
+            " id=" + id +
+            " name=" + name +
+            " city=" + city +
+            "]";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5c1ed14/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java b/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
index 305d75d..1535619 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
@@ -74,7 +74,7 @@ public class OrganizationKey implements Serializable {
     /** {@inheritDoc} */
     @Override public String toString() {
         return "OrganizationKey [" + 
-            " id=" + id + 
-        "]";
+            " id=" + id +
+            "]";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5c1ed14/modules/schema-load/src/test/java/org/apache/ignite/Person.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/Person.java b/modules/schema-load/src/test/java/org/apache/ignite/Person.java
index 369fdc4..ef1f96f 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/Person.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/Person.java
@@ -129,9 +129,9 @@ public class Person implements Serializable {
     /** {@inheritDoc} */
     @Override public String toString() {
         return "Person [" + 
-            " id=" + id + 
-            " orgId=" + orgId + 
-            " name=" + name + 
-        "]";
+            " id=" + id +
+            " orgId=" + orgId +
+            " name=" + name +
+            "]";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5c1ed14/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java b/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
index 326c930..27caa80 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
@@ -74,7 +74,7 @@ public class PersonKey implements Serializable {
     /** {@inheritDoc} */
     @Override public String toString() {
         return "PersonKey [" + 
-            " id=" + id + 
-        "]";
+            " id=" + id +
+            "]";
     }
 }


Mime
View raw message