[hg] main-silver: #188302: Add mouse over 'name' to each SQL Res...

  • From: Jaroslav Havlin < >
  • To:
  • Subject: [hg] main-silver: #188302: Add mouse over 'name' to each SQL Res...
  • Date: Fri, 01 Mar 2013 12:40:20 -0800

changeset 0b7bc77e489a in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/0b7bc77e489a
description:
        #188302: Add mouse over 'name' to each SQL Result Tab

diffstat:

 db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java |  18 
++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diffs (37 lines):

diff --git 
a/db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java 
b/db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java
--- a/db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java
+++ b/db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java
@@ -166,8 +166,10 @@
             resultComponent.removeAll();
         }
         
+        int i = 0;
         for (Component comp : components ) {
             resultComponent.add(comp);            
+            resultComponent.setToolTipTextAt(i++, 
getToolTipForComponent(comp));
         }
 
         // Put focus on the first result from the set
@@ -178,6 +180,22 @@
         showResultComponent();
     }
     
+    private String getToolTipForComponent(Component comp) {
+        if (comp instanceof JComponent) {
+            String rawToolTip = ((JComponent) comp).getToolTipText();
+            if (rawToolTip == null) {
+                return null;
+            } else {
+                String shortened = rawToolTip.length() > 128
+                        ? rawToolTip.substring(0, 128) + "\u2026" //NOI18N
+                        : rawToolTip;
+                return shortened.replace("\n", " ");                    
//NOI18N
+            }
+        } else {
+            return null;
+        }
+    }
+
     @SuppressWarnings("deprecation")
     private void createResultComponent() {
         JPanel container = findContainer(this);

[hg] main-silver: #188302: Add mouse over 'name' to each SQL Res...

Jaroslav Havlin 03/01/2013

Project Features

About this Project

DB was started in November 2009, is owned by Antonin Nebuzelsky, and has 113 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close