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.
Current SQL editor implementation opens new dataview tab for every SQL query. However, the common use case is that users tune the SQL query and want to see new result set and don't need to compare set to previous query often. See the attached screenshot with several tabs that just reduced the area where dataview would be displayed. There should be option if you want to open new view tab for every query.
Created attachment 68098 [details] screenshot
I think it's better to have different tabs for different queries. For example user want to compare results from 2 queries. However I think new results tab for the same query shouldn't be opened. Now if you run, for example, the same query 3 times, 3 results tab will be opened.
The spec of the integration of dataview with the SQL editor planned to have a button in the toolbar to determine whether to automatically close tabs from previous executions. It seems the button was never implemented. Do we still want to do it?
Yes, it would be great to implement that if time permits. I think that slipped through the cracks. The workaround for now is you can right-click on any tab and choose "Close Tabs for Previous Executions."
I think I'll add my two cents worth on this one... Forgive me if this is covered in the integration spec that was referenced. Where might I find that? Anyway, I think it would be a good idea to look at the SQL statement and attempt to determine if the statement that is about to be executed has an existing corresponding tab. If so, the contents of that existing tab should be replaced with the new results and that tab should be brought forward. I think that ends my 2 cents, but you never know.
is this a feature or enhancement ?
I think it's a defect because it was supposed to be an option we were going to provide as part of this feature and we didn't do it. I agree with Petr's concerns that the common use case is to *not* see a new tab for each execution.
Re desc6: I think the most common use case is an user creating a non-trivial SELECT statement. The user edits the statement, then runs it to check if it is correct, then edits, runs, etc. The statement is likely to be modified before each execution, so the proposal to try to match it with an existing tab would not help.
We're at UI freeze, and at this point I don't believe I can justify this UI change. Petr, others, what is your take on this?
Why not? Impact seems pretty high, and it is unlikely this breaks a lot of documentation. Perhaps you should check with James.
I wasn't convinced of the high impact - it's easy enough to close other tabs if it gets to be too many. But if James is OK with doing it, then let's do it, I'm all for making our product as usable as possible. Adding it to the late UI change page.
The usability impact I meant. When you are focusing on fixing a SELECT statement in the edit-fix-edit-fix cycle, having to manually close the tabs, even from time to time, becomes very annoying. Well, at least IMHO. Also, this behavior differs from the one in previous versions. Releasing 6.5 with the new behavior knowing that it is wrong for most users looks like a bad idea.
So, I just want to clarify what it is we want here. We were going to add as a toolbar to the top of the SQL editor. This would toggle the behavior as follows: - Each execution uses the same results tab - Each execution creates a new results tab I'll assume this is correct, but someone speak up if that's not their recollection. I'll post an email to dev@db as well.
We should probably decide this very soon if you want me to document it. Help freeze is coming up very fast (Sep. 8).
I'm working on it right now. When is Help Freeze?
We're supposed to have all the Help done and checked in by Friday. Monday (September 8) is the official Help freeze date. I'll be available all weekend to document this, but the more time I have the better.
OK, this is fixed, changeset 6ccb2195e655. James, here is the information for your Help documentation: When you execute SQL, normally the results tabs from the previous execution are closed. You can change this behavior so that the old tab(s) remain open. To do this you toggle the "keep prior results" setting. You can do this by selecting the tool bar, by choosing "Keep prior result tabs" in the context menu for the editor, or by using the keyboard shortcut CTRL-CMD-T (on Mac, I'm not sure what it is on Windows/Linux). This setting is saved for all subsequent SQL executions, until/if you toggle it off again.
I would suggest that the shortcut for this action be removed. I don't think the action will be used that often to deserver a shortcut, and moreover, NetBeans is running out of shortcuts.
Reopening. The way this was fixed is too complex and works around for a bug in the editor toolbar which I filed as issue 146312. I simplified the code, remove the shortcut (cf. desc19) and fixed some consistency glitches. Will attach a patch. Nothing changes from the docs' point of view -- only the shortcut is removed.
Created attachment 69143 [details] Proposed changes
Ah, there is one UI change: the name of the action (displayed when you hover above it) is "Toggle Keep Tabs From Previous Executions".
Integrated into 'main-golden', will be available in build *200809051401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/6ccb2195e655 User: David Van Couvering <davidvc@netbeans.org> Log: #144829 - Add toggle button to control whether old tabs are removed on SQL execution
Thanks, Andrei. I thought I the default BooleanStateAction didn't support an icon (what I was seeing was just text with no icon), and assumed this meant I had to build my own toolbar button. I basically copied this from the Toggle Highlight Search Text action, but I guess there's a danger with cut-and-paste because often it's old code that doesn't take advantage of features it should. It looks like you have to override iconResource(), but glad it works! Please go ahead and commit your changes and mark as fixed.
This has been documented in the Help.
#5c46d9ee77fa Help already uses "Keep Prior Tabs" as the name of the action, so I sticked to that.
Product Version: NetBeans IDE Dev (Build 080909)
Integrated into 'main-golden', will be available in build *200809100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/5c46d9ee77fa User: Andrei Badea <abadea@netbeans.org> Log: #144829: Don't open new dataview tab for every query