ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: # ignite-32: Changed color for selected but not focused row. Added check for empty selection before rename/reset.
Date Fri, 30 Jan 2015 09:13:04 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-32 fac9a3332 -> 5a407fcd6


# ignite-32: Changed color for selected but not focused row. Added check for empty selection
before rename/reset.


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

Branch: refs/heads/ignite-32
Commit: 5a407fcd6e989f0b8b9ab0f1872fbaedecc72b7f
Parents: fac9a33
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Fri Jan 30 16:13:06 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Fri Jan 30 16:13:06 2015 +0700

----------------------------------------------------------------------
 .../schema-load/src/main/java/media/style.css   | 11 ++--
 .../apache/ignite/schema/ui/SchemaLoadApp.java  | 55 ++++++++++++--------
 2 files changed, 40 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5a407fcd/modules/schema-load/src/main/java/media/style.css
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/media/style.css b/modules/schema-load/src/main/java/media/style.css
index 90e1667..92fed78 100644
--- a/modules/schema-load/src/main/java/media/style.css
+++ b/modules/schema-load/src/main/java/media/style.css
@@ -34,12 +34,17 @@
     -fx-background-color: -fx-text-box-border, -fx-control-inner-background, -fx-control-inner-background;
 }
 
-.tree-view {
+.table-view {
     -fx-focus-color: gray;
 }
 
-.table-view {
-    -fx-focus-color: gray;
+.table-view .table-row-cell:selected {
+    -fx-background-color: -fx-table-cell-border-color, -fx-cell-hover-color;
+    -fx-background-insets: 0, 0 0 1 0;
+}
+
+.table-view:focused .table-row-cell:selected {
+     -fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar;
 }
 
 .table-row-cell:empty {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5a407fcd/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 f227fcf..58f597d 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
@@ -849,9 +849,9 @@ public class SchemaLoadApp extends Application {
 
                         String target = "\"" + sel + "\"";
 
-                        Collection<PojoDescriptor> selItems = selectedItems();
+                        Collection<PojoDescriptor> selPojos = pojosTbl.getSelectionModel().getSelectedItems();
 
-                        if (selItems.isEmpty()) {
+                        if (selPojos.isEmpty()) {
                             MessageBox.warningDialog(owner, "Please select " + src + " to
rename " + target + "!");
 
                             return;
@@ -867,13 +867,13 @@ public class SchemaLoadApp extends Application {
 
                         try {
                             switch (replaceCb.getSelectionModel().getSelectedIndex()) {
-                                case 0: renameKeyClassNames(regex, replace);
+                                case 0: renameKeyClassNames(selPojos, regex, replace);
                                     break;
 
-                                case 1: renameValueClassNames(regex, replace);
+                                case 1: renameValueClassNames(selPojos, regex, replace);
                                     break;
 
-                                default: renameJavaNames(regex, replace);
+                                default: renameJavaNames(selPojos, regex, replace);
                             }
                         }
                         catch (Exception e) {
@@ -883,8 +883,6 @@ public class SchemaLoadApp extends Application {
                 }),
             button("Reset Selected", "Revert changes for selected items to initial values",
new EventHandler<ActionEvent>() {
                 @Override public void handle(ActionEvent evt) {
-                    Collection<PojoDescriptor> selItems = selectedItems();
-
                     String sel = replaceCb.getSelectionModel().getSelectedItem();
 
                     boolean renFields = "Java names".equals(sel);
@@ -893,7 +891,9 @@ public class SchemaLoadApp extends Application {
 
                     String target = "\"" + sel + "\"";
 
-                    if (selItems.isEmpty()) {
+                    Collection<PojoDescriptor> selPojos = pojosTbl.getSelectionModel().getSelectedItems();
+
+                    if (selPojos.isEmpty()) {
                         MessageBox.warningDialog(owner, "Please select " + src + "to revert
" + target + "!");
 
                         return;
@@ -904,13 +904,13 @@ public class SchemaLoadApp extends Application {
                         return;
 
                     switch (replaceCb.getSelectionModel().getSelectedIndex()) {
-                        case 0: revertKeyClassNames();
+                        case 0: revertKeyClassNames(selPojos);
                             break;
 
-                        case 1: revertValueClassNames();
+                        case 1: revertValueClassNames(selPojos);
                             break;
 
-                        default: revertJavaNames();
+                        default: revertJavaNames(selPojos);
                     }
                 }
             })
@@ -945,58 +945,67 @@ public class SchemaLoadApp extends Application {
     /**
      * Rename key class name for selected tables.
      *
+     * @param selPojos Selected POJOs to rename.
      * @param regex Regex to search.
      * @param replace Text for replacement.
      */
-    private void renameKeyClassNames(String regex, String replace) {
-        for (PojoDescriptor pojo : pojosTbl.getSelectionModel().getSelectedItems())
+    private void renameKeyClassNames(Collection<PojoDescriptor> selPojos, String regex,
String replace) {
+        for (PojoDescriptor pojo : selPojos)
             pojo.keyClassName(pojo.keyClassName().replaceAll(regex, replace));
     }
 
     /**
      * Rename value class name for selected tables.
      *
+     * @param selPojos Selected POJOs to rename.
      * @param regex Regex to search.
      * @param replace Text for replacement.
      */
-    private void renameValueClassNames(String regex, String replace) {
-        for (PojoDescriptor pojo : pojosTbl.getSelectionModel().getSelectedItems())
+    private void renameValueClassNames(Collection<PojoDescriptor> selPojos, String
regex, String replace) {
+        for (PojoDescriptor pojo : selPojos)
             pojo.valueClassName(pojo.valueClassName().replaceAll(regex, replace));
     }
 
     /**
      * Rename fields java name for current or selected tables.
      *
+     * @param selPojos Selected POJOs to rename.
      * @param regex Regex to search.
      * @param replace Text for replacement.
      */
-    private void renameJavaNames(String regex, String replace) {
-        for (PojoDescriptor pojo : pojosTbl.getSelectionModel().getSelectedItems())
+    private void renameJavaNames(Collection<PojoDescriptor> selPojos, String regex,
String replace) {
+        for (PojoDescriptor pojo : selPojos)
             for (PojoField field : pojo.fields())
                 field.javaName(field.javaName().replaceAll(regex, replace));
     }
 
     /**
      * Revert key class name for selected tables to initial value.
+     *
+     * @param selPojos Selected POJOs to revert.
      */
-    private void revertKeyClassNames() {
-        for (PojoDescriptor pojo : pojosTbl.getSelectionModel().getSelectedItems())
+    private void revertKeyClassNames(Collection<PojoDescriptor> selPojos) {
+        for (PojoDescriptor pojo : selPojos)
             pojo.revertKeyClassName();
     }
 
     /**
      * Revert value class name for selected tables to initial value.
+     *
+     * @param selPojos Selected POJOs to revert.
      */
-    private void revertValueClassNames() {
-        for (PojoDescriptor pojo : pojosTbl.getSelectionModel().getSelectedItems())
+    private void revertValueClassNames(Collection<PojoDescriptor> selPojos) {
+        for (PojoDescriptor pojo : selPojos)
             pojo.revertValueClassName();
     }
 
     /**
      * Revert fields java name for selected or current table to initial value.
+     *
+     * @param selPojos Selected POJOs to revert.
      */
-    private void revertJavaNames() {
-        for (PojoDescriptor pojo : pojosTbl.getSelectionModel().getSelectedItems())
+    private void revertJavaNames(Collection<PojoDescriptor> selPojos) {
+        for (PojoDescriptor pojo : selPojos)
             pojo.revertJavaNames();
     }
 


Mime
View raw message