This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 237806 - [SQL] Reformat mouse over text for sql result
Summary: [SQL] Reformat mouse over text for sql result
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: matthias42
URL:
Keywords: PATCH_AVAILABLE
: 202710 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-30 11:57 UTC by tomzi
Modified: 2015-01-31 07:56 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
proposed patch v1 (1.95 KB, patch)
2014-08-26 19:25 UTC, matthias42
Details | Diff
proposed patch part 2 v1 (3.10 KB, patch)
2014-08-26 19:28 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tomzi 2013-10-30 11:57:05 UTC
Current:
When executing several queries on different databases, for each query a new tab is opened. When hovering over one tab a text will appea like following:
'with     myWith as (     select       column1,     column2,     column3    ...'

Exected:
- For each tab also the database should be shown in the 'hover text'
- The text should be trimmed such that all multiple whitespaces are removed
eg. 'DB1: with myWith as (select column1, column2, column3    ...'



Product Version = NetBeans IDE 7.4 (Build 201310111528)
Operating System = Linux version 3.8.0-31-generic running on amd64
Java; VM; Vendor = 1.7.0_45
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Comment 1 matthias42 2014-08-26 19:25:59 UTC
Created attachment 148910 [details]
proposed patch v1

Simplify the code (no need to postprocess tooltips multiple times)
Comment 2 matthias42 2014-08-26 19:28:32 UTC
Created attachment 148911 [details]
proposed patch part 2 v1

Modify tooltip of Output Tab of SQL Result: Show database name used to invoke SQL and show complete SQL (without removing new lines).
Comment 3 markiewb 2014-08-26 19:47:56 UTC
IMHO: You cannot replace all multiple whitespaces with a single one. 

If you have a SQL query which contains multiple whitespaces in literals this procedure would alter the query
Comment 4 matthias42 2014-08-27 16:50:07 UTC
(In reply to markiewb from comment #3)
> IMHO: You cannot replace all multiple whitespaces with a single one. 

You are right and I did not implement that (to be fair the patch changes the display, but does not completly follow the request presented here). There are two parts:

1. The "name" of the Tab-Component - after the patch that is whitespace reduced (multiple whitespaces are replaced by one space) and limited to 25 chars.

2. The tooltip - after the change it has the structure:

DB: <NAME_OF_CONNECTION>

<SQL_AS_TYPED>

If the user inputs whitespace he most probably did it, because it was good for overview or better structured or ...

> If you have a SQL query which contains multiple whitespaces in literals this
> procedure would alter the query

Nope - this changes the display, not the query itself.
Comment 5 matthias42 2014-09-20 12:50:58 UTC
*** Bug 202710 has been marked as a duplicate of this bug. ***
Comment 6 matthias42 2015-01-29 21:17:30 UTC
The patches were further modified and committed as:

http://hg.netbeans.org/core-main/rev/9cd65bbf6712
http://hg.netbeans.org/core-main/rev/c4e63d4b0162

This is the result:
- tooltips for results are fixed (before the fixes only the tooltip of the first result worked)
- The name of the result tab is build from the sql by replacing all whitespace with one space and limit it to 25 chars
- The tooltip shows the database connection formatted bold and the first 512 chars of the executed sql

I decided against integrating the DB name into the result tab name, as in the common case one db connection is used and the db name takes significant space. I think this can be discussed into both directions, but I also think integrating the db name into the tooltip is a good compromise.

In the next few hours/days nightly build should begin to carry this change. A message will be appended to this bug when that happens. Please help with QA and check that version if this meets your expectations (keeping my reasining above in mind). If you agree, that it is fixed, please change the status of this bug to VERIFIED. Thank you for helping!
Comment 7 Quality Engineering 2015-01-31 07:56:19 UTC
Integrated into 'main-silver', will be available in build *201501310002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9cd65bbf6712
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #237806: Part1: Simplify the code (no need to postprocess tooltips multiple times)