Better accessability to '>' operator in Object browser filter issue #959
authorEriks Jenkevics <eriks@netxms.org>
Wed, 17 Aug 2016 09:57:11 +0000 (12:57 +0300)
committerEriks Jenkevics <eriks@netxms.org>
Wed, 17 Aug 2016 10:01:57 +0000 (13:01 +0300)
ChangeLog
src/java/netxms-eclipse/Core/src/org/netxms/ui/eclipse/widgets/FilterText.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/ObjectTree.java
webui/webapp/Core/src/org/netxms/ui/eclipse/widgets/FilterText.java
webui/webapp/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/ObjectTree.java

index f5e19e0..df7f77d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,7 +16,7 @@
 - Management console
        - New editors for Agent Config Policy and Log Parser Policy. 
        - DCI summary tables with empty menu path not shown in object context menu
-- Fixed issues: #92, #906, #1051, #1096, #1187, #1191, #1230, #1237, #1254, #1263
+- Fixed issues: #92, #906, #959, #1051, #1096, #1187, #1191, #1230, #1237, #1254, #1263
 
 
 *
index b1c5a41..dbad8ac 100644 (file)
@@ -49,6 +49,7 @@ public class FilterText extends Composite
 {
        private Text text;
        private Composite buttonArea;
+       private Composite textArea;
        private List<Button> attrButtons = new ArrayList<Button>(4);
        private Label closeButton;
        private Label clearButton;
@@ -57,15 +58,21 @@ public class FilterText extends Composite
        private Set<ModifyListener> modifyListeners = new HashSet<ModifyListener>();
        private ModifyEvent lastModifyEvent = null;
        
+       public FilterText(Composite parent, int style)
+   {
+      this(parent, style, null);
+   }
+       
        /**
         * @param parent
         * @param style
         */
-       public FilterText(Composite parent, int style)
+       public FilterText(Composite parent, int style, String tooltip)
        {
-               super(parent, style);
+               super(parent, style);           
                GridLayout layout = new GridLayout();
                layout.numColumns = 5;
+         
                setLayout(layout);
                
                final Label label = new Label(this, SWT.NONE);
@@ -74,9 +81,27 @@ public class FilterText extends Composite
                gd.verticalAlignment = SWT.CENTER;
                label.setLayoutData(gd);
                
-               text = new Text(this, SWT.BORDER);
+               textArea = new Composite(this, SWT.BORDER);
+               GridLayout textLayout = new GridLayout();
+               textLayout.numColumns = 2;
+               textLayout.marginBottom = 0;
+               textLayout.marginTop = 0;
+               textLayout.marginLeft = 0;
+      textLayout.marginRight = 0;
+      textArea.setLayout(textLayout);
+      gd = new GridData();
+      gd.verticalAlignment = SWT.CENTER;
+      gd.horizontalAlignment = SWT.FILL;
+      gd.grabExcessHorizontalSpace = true;
+      gd.verticalAlignment = SWT.CENTER;
+      textArea.setLayoutData(gd);
+               
+               text = new Text(textArea, SWT.NONE);
                text.setTextLimit(64);
                text.setMessage(Messages.get().FilterText_FilterIsEmpty);
+               if (tooltip != null) {
+                  text.setToolTipText(tooltip);
+               }
                gd = new GridData();
                gd.horizontalAlignment = SWT.FILL;
                gd.grabExcessHorizontalSpace = true;
@@ -105,6 +130,19 @@ public class FilterText extends Composite
          }
       });
                
+               if (tooltip != null) {
+               final Label icon = new Label(textArea, SWT.NONE);
+               icon.setImage(SharedIcons.IMG_INFORMATION);
+         gd = new GridData();
+         gd.verticalAlignment = SWT.CENTER;
+         icon.setLayoutData(gd);
+         icon.setToolTipText(tooltip);
+         
+         icon.setBackground(text.getBackground());
+               }
+               
+               textArea.setBackground(text.getBackground());
+               
                buttonArea = new Composite(this, SWT.NONE);
                RowLayout buttonLayout = new RowLayout();
                buttonLayout.type = SWT.HORIZONTAL;
@@ -134,7 +172,7 @@ public class FilterText extends Composite
                   @Override
                   public void mouseDoubleClick(MouseEvent e)
                   {
-                     if (e.button ==1)
+                     if (e.button == 1)
                         doAction = false;
                   }
                   
index af00667..265eca1 100644 (file)
@@ -121,9 +121,9 @@ public class ObjectTree extends Composite
 
                FormLayout formLayout = new FormLayout();
                setLayout(formLayout);
-               
+               String tooltip = " > - Search by IP \n # - Search by ID \n / - Search by comment";
                // Create filter area
-               filterText = new FilterText(this, SWT.NONE);
+               filterText = new FilterText(this, SWT.NONE, tooltip);
                filterText.addModifyListener(new ModifyListener() {
                        @Override
                        public void modifyText(ModifyEvent e)
index 500d2ce..868a7ec 100644 (file)
@@ -49,6 +49,7 @@ public class FilterText extends Composite
 {
        private Text text;
        private Composite buttonArea;
+       private Composite textArea;
        private List<Button> attrButtons = new ArrayList<Button>(4);
        private Label closeButton;
        private Label clearButton;
@@ -57,13 +58,18 @@ public class FilterText extends Composite
        private Set<ModifyListener> modifyListeners = new HashSet<ModifyListener>();
        private ModifyEvent lastModifyEvent = null;
        
+       public FilterText(Composite parent, int style)
+   {
+      this(parent, style, null);
+   }
+       
        /**
         * @param parent
         * @param style
         */
-       public FilterText(Composite parent, int style)
+       public FilterText(Composite parent, int style, String tooltip)
        {
-               super(parent, style);
+               super(parent, style);           
                GridLayout layout = new GridLayout();
                layout.numColumns = 5;
                setLayout(layout);
@@ -74,9 +80,27 @@ public class FilterText extends Composite
                gd.verticalAlignment = SWT.CENTER;
                label.setLayoutData(gd);
                
-               text = new Text(this, SWT.BORDER);
+               textArea = new Composite(this, SWT.BORDER);
+               GridLayout textLayout = new GridLayout();
+               textLayout.numColumns = 2;
+               textLayout.marginBottom = 0;
+               textLayout.marginTop = 0;
+               textLayout.marginLeft = 0;
+      textLayout.marginRight = 0;
+      textArea.setLayout(textLayout);
+      gd = new GridData();
+      gd.verticalAlignment = SWT.CENTER;
+      gd.horizontalAlignment = SWT.FILL;
+      gd.grabExcessHorizontalSpace = true;
+      gd.verticalAlignment = SWT.CENTER;
+      textArea.setLayoutData(gd);
+               
+               text = new Text(textArea, SWT.NONE);
                text.setTextLimit(64);
                text.setMessage(Messages.get().FilterText_FilterIsEmpty);
+               if (tooltip != null) {
+                  text.setToolTipText(tooltip);
+               }
                gd = new GridData();
                gd.horizontalAlignment = SWT.FILL;
                gd.grabExcessHorizontalSpace = true;
@@ -105,6 +129,19 @@ public class FilterText extends Composite
          }
       });
                
+               if (tooltip != null) {
+               final Label icon = new Label(textArea, SWT.NONE);
+               icon.setImage(SharedIcons.IMG_INFORMATION);
+         gd = new GridData();
+         gd.verticalAlignment = SWT.CENTER;
+         icon.setLayoutData(gd);
+         icon.setToolTipText(tooltip);
+         
+         icon.setBackground(text.getBackground());
+               }
+               
+               textArea.setBackground(text.getBackground());
+               
                buttonArea = new Composite(this, SWT.NONE);
                RowLayout buttonLayout = new RowLayout();
                buttonLayout.type = SWT.HORIZONTAL;
@@ -136,7 +173,7 @@ public class FilterText extends Composite
                   @Override
                   public void mouseDoubleClick(MouseEvent e)
                   {
-                     if (e.button ==1)
+                     if (e.button == 1)
                         doAction = false;
                   }
                   
index af00667..265eca1 100644 (file)
@@ -121,9 +121,9 @@ public class ObjectTree extends Composite
 
                FormLayout formLayout = new FormLayout();
                setLayout(formLayout);
-               
+               String tooltip = " > - Search by IP \n # - Search by ID \n / - Search by comment";
                // Create filter area
-               filterText = new FilterText(this, SWT.NONE);
+               filterText = new FilterText(this, SWT.NONE, tooltip);
                filterText.addModifyListener(new ModifyListener() {
                        @Override
                        public void modifyText(ModifyEvent e)