You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2021/06/24 09:13:14 UTC

[incubator-hop] branch master updated: HOP-2950 Sorting table and schema names in Database explorer and fix database image

This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hop.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e9482a  HOP-2950 Sorting table and schema names in Database explorer and fix database image
     new 2024661  Merge pull request #900 from nadment/HOP-2950
9e9482a is described below

commit 9e9482a2dd8f18ddc330de0b511bbd59a876537c
Author: nadment <na...@gmail.com>
AuthorDate: Wed Jun 23 18:54:57 2021 +0200

    HOP-2950 Sorting table and schema names in Database explorer and fix
    database image
---
 .../org/apache/hop/core/database/Database.java     |  3 +++
 .../database/dialog/DatabaseExplorerDialog.java    |  6 +++---
 .../hop/ui/core/database/dialog/SqlEditor.java     |  4 +---
 .../hop/ui/core/dialog/SqlStatementsDialog.java    |  5 +----
 .../org/apache/hop/ui/core/gui/GuiResource.java    | 22 +++++++++++-----------
 .../org/apache/hop/ui/hopgui/shared/SwtGc.java     |  2 +-
 6 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/core/src/main/java/org/apache/hop/core/database/Database.java b/core/src/main/java/org/apache/hop/core/database/Database.java
index 79b4003..6d140cb 100644
--- a/core/src/main/java/org/apache/hop/core/database/Database.java
+++ b/core/src/main/java/org/apache/hop/core/database/Database.java
@@ -3768,6 +3768,7 @@ public class Database implements IVariables, ILoggingObject {
         }
       }
     }
+    res.sort(String.CASE_INSENSITIVE_ORDER);  
     return res.toArray(new String[res.size()]);
   }
 
@@ -3886,6 +3887,7 @@ public class Database implements IVariables, ILoggingObject {
         }
       }
     }
+    res.sort(String.CASE_INSENSITIVE_ORDER);
     return res.toArray(new String[res.size()]);
   }
 
@@ -3988,6 +3990,7 @@ public class Database implements IVariables, ILoggingObject {
         }
       }
     }
+    res.sort(String.CASE_INSENSITIVE_ORDER);
     return res.toArray(new String[res.size()]);
   }
 
diff --git a/ui/src/main/java/org/apache/hop/ui/core/database/dialog/DatabaseExplorerDialog.java b/ui/src/main/java/org/apache/hop/ui/core/database/dialog/DatabaseExplorerDialog.java
index c26327a..f4c34a2 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/database/dialog/DatabaseExplorerDialog.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/database/dialog/DatabaseExplorerDialog.java
@@ -182,7 +182,7 @@ public class DatabaseExplorerDialog extends Dialog {
       shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
     }
     props.setLook(shell);
-    shell.setImage(GuiResource.getInstance().getImageConnection());
+    shell.setImage(GuiResource.getInstance().getImageDatabase());
 
     shell.setText(BaseMessages.getString(PKG, "DatabaseExplorerDialog.Title", dbMeta.toString()));
 
@@ -504,7 +504,7 @@ public class DatabaseExplorerDialog extends Dialog {
 
       // New entry in the tree
       tiTree = new TreeItem(wTree, SWT.NONE);
-      tiTree.setImage(GuiResource.getInstance().getImageFolderConnections());
+      tiTree.setImage(GuiResource.getInstance().getImageDatabase());
       tiTree.setText(dbMeta == null ? "" : dbMeta.getName());
 
       // Show the catalogs...
@@ -516,7 +516,7 @@ public class DatabaseExplorerDialog extends Dialog {
 
         for (int i = 0; i < catalogs.length; i++) {
           TreeItem newCat = new TreeItem(tiCat, SWT.NONE);
-          newCat.setImage(GuiResource.getInstance().getImageConnection());
+          newCat.setImage(GuiResource.getInstance().getImageFolder());
           newCat.setText(catalogs[i].getCatalogName());
 
           for (int j = 0; j < catalogs[i].getItems().length; j++) {
diff --git a/ui/src/main/java/org/apache/hop/ui/core/database/dialog/SqlEditor.java b/ui/src/main/java/org/apache/hop/ui/core/database/dialog/SqlEditor.java
index 18e842f..b0e6827 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/database/dialog/SqlEditor.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/database/dialog/SqlEditor.java
@@ -50,8 +50,6 @@ import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.MouseAdapter;
 import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
@@ -106,7 +104,7 @@ public class SqlEditor {
   public void open() {
     shell = new Shell(parentShell, style);
     props.setLook(shell);
-    shell.setImage(GuiResource.getInstance().getImageConnection());
+    shell.setImage(GuiResource.getInstance().getImageDatabase());
 
     FormLayout formLayout = new FormLayout();
     formLayout.marginWidth = Const.FORM_MARGIN;
diff --git a/ui/src/main/java/org/apache/hop/ui/core/dialog/SqlStatementsDialog.java b/ui/src/main/java/org/apache/hop/ui/core/dialog/SqlStatementsDialog.java
index 848c7fe..0cc0940 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/dialog/SqlStatementsDialog.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/dialog/SqlStatementsDialog.java
@@ -34,8 +34,6 @@ import org.apache.hop.ui.core.widget.ColumnInfo;
 import org.apache.hop.ui.core.widget.TableView;
 import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
@@ -43,7 +41,6 @@ import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Dialog;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.TableItem;
@@ -93,7 +90,7 @@ public class SqlStatementsDialog extends Dialog {
 
     shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX);
     props.setLook(shell);
-    shell.setImage(GuiResource.getInstance().getImageConnection());
+    shell.setImage(GuiResource.getInstance().getImageDatabase());
 
     FormLayout formLayout = new FormLayout();
     formLayout.marginWidth = Const.FORM_MARGIN;
diff --git a/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java b/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java
index ab7db0f..5f9ec30 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java
@@ -158,7 +158,7 @@ public class GuiResource {
 
   private SwtUniversalImage imageLogo;
   private SwtUniversalImage imageDisabledHop;
-  private SwtUniversalImage imageConnection;
+  private SwtUniversalImage imageDatabase;
   private SwtUniversalImage imageData;
   private SwtUniversalImage imagePreview;
   private SwtUniversalImage imageMissing;
@@ -440,7 +440,7 @@ public class GuiResource {
       // Common images
       imageLogo.dispose();
       imageDisabledHop.dispose();
-      imageConnection.dispose();
+      imageDatabase.dispose();
       imageData.dispose();
       imageAdd.dispose();
       imageTable.dispose();
@@ -776,7 +776,7 @@ public class GuiResource {
     imageFolder = SwtSvgImageUtil.getImageAsResource(display, "ui/images/folder.svg");
     imagePartitionSchema =
         SwtSvgImageUtil.getImageAsResource(display, "ui/images/partition_schema.svg");
-    imageConnection = SwtSvgImageUtil.getImageAsResource(display, "ui/images/database.svg");
+    imageDatabase = SwtSvgImageUtil.getImageAsResource(display, "ui/images/database.svg");
     imageData = SwtSvgImageUtil.getImageAsResource(display, "ui/images/data.svg");
     imageEdit = SwtSvgImageUtil.getImageAsResource(display, "ui/images/edit.svg");
     imageMissing = SwtSvgImageUtil.getImageAsResource(display, "ui/images/missing.svg");
@@ -1038,19 +1038,19 @@ public class GuiResource {
         display, ConstUi.SMALL_ICON_SIZE, ConstUi.SMALL_ICON_SIZE);
   }
 
-  /** @return Returns the imageConnection. */
-  public Image getImageConnection() {
-    return imageConnection.getAsBitmapForSize(
+  /** @return Returns the database image. */
+  public Image getImageDatabase() {
+    return imageDatabase.getAsBitmapForSize(
         display, ConstUi.SMALL_ICON_SIZE, ConstUi.SMALL_ICON_SIZE);
   }
 
-  /** @return Returns the imageConnection. */
+  /** @return Returns the data image. */
   public Image getImageData() {
     return imageData.getAsBitmapForSize(display, ConstUi.SMALL_ICON_SIZE, ConstUi.SMALL_ICON_SIZE);
   }
 
-  public SwtUniversalImage getSwtImageConnection() {
-    return imageConnection;
+  public SwtUniversalImage getSwtImageDatabase() {
+    return imageDatabase;
   }
 
   public SwtUniversalImage getSwtImageData() {
@@ -1061,12 +1061,12 @@ public class GuiResource {
     return imageAdd;
   }
 
-  /** @return Returns the imageTable. */
+  /** @return Returns the table image. */
   public Image getImageTable() {
     return imageTable;
   }
 
-  /** @return Returns the imageTable. */
+  /** @return Returns the preview image. */
   public Image getImagePreview() {
     return imagePreview.getAsBitmapForSize(
         display, ConstUi.SMALL_ICON_SIZE, ConstUi.SMALL_ICON_SIZE);
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/shared/SwtGc.java b/ui/src/main/java/org/apache/hop/ui/hopgui/shared/SwtGc.java
index c51ae2d..8016a82 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/shared/SwtGc.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/shared/SwtGc.java
@@ -199,7 +199,7 @@ public class SwtGc implements IGc {
       case CHECKPOINT:
         return GuiResource.getInstance().getSwtImageCheckpoint();
       case DB:
-        return GuiResource.getInstance().getSwtImageConnection();
+        return GuiResource.getInstance().getSwtImageDatabase();
       case PARALLEL:
         return GuiResource.getInstance().getSwtImageParallelHop();
       case UNCONDITIONAL: