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 2020/11/19 13:11:50 UTC

[incubator-hop] branch master updated: HOP-2209 : ContextDialog: remove excess spacing and add "clear search" icon (#400)

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 1f1c1dd  HOP-2209 : ContextDialog: remove excess spacing and add "clear search" icon (#400)
1f1c1dd is described below

commit 1f1c1dd4fc48833330188e5f436df6e2f54de47d
Author: Matt Casters <ma...@gmail.com>
AuthorDate: Thu Nov 19 14:11:44 2020 +0100

    HOP-2209 : ContextDialog: remove excess spacing and add "clear search" icon (#400)
---
 .../org/apache/hop/ui/core/dialog/ContextDialog.java     | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/ui/src/main/java/org/apache/hop/ui/core/dialog/ContextDialog.java b/ui/src/main/java/org/apache/hop/ui/core/dialog/ContextDialog.java
index 05571d1..2e9c486 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/dialog/ContextDialog.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/dialog/ContextDialog.java
@@ -88,6 +88,7 @@ public class ContextDialog extends Dialog {
   public static final String TOOLBAR_ITEM_COLLAPSE_ALL = "ContextDialog-Toolbar-10010-CollapseAll";
   public static final String TOOLBAR_ITEM_EXPAND_ALL = "ContextDialog-Toolbar-10020-ExpandAll";
   public static final String TOOLBAR_ITEM_ENABLE_CATEGORIES = "ContextDialog-Toolbar-10030-EnableCategories";
+  public static final String TOOLBAR_ITEM_CLEAR_SEARCH = "ContextDialog-Toolbar-10040-ClearSearch";
 
   public static final String AUDIT_TYPE_TOOLBAR_SHOW_CATEGORIES = "ContextDialogShowCategories";
   public static final String AUDIT_TYPE_CONTEXT_DIALOG = "ContextDialog";
@@ -668,6 +669,17 @@ public class ContextDialog extends Dialog {
     return (Button) checkboxItem.getControl();
   }
 
+  @GuiToolbarElement(
+    root = GUI_PLUGIN_TOOLBAR_PARENT_ID,
+    id = TOOLBAR_ITEM_CLEAR_SEARCH,
+    toolTip = "Clear search filter",
+    image = "ui/images/ClearText.svg",
+    separator = true
+  )
+  public void clearSearchFilter() {
+    wSearch.setText("");
+  }
+
   /**
    * This is where all the actions are drawn
    *
@@ -849,7 +861,9 @@ public class ContextDialog extends Dialog {
       // Pick the next category
       //
       categoryNr++;
-      y += yMargin;
+      if (!itemsToPaint.isEmpty()) {
+        y += yMargin;
+      }
     }
 
     totalContentHeight = y + heightOffSet;