1. Execute some statement in separated SQL editors.
2. Open "SQL History" dialog.
3. Select some other SQL editor, select some record in "SQL History" dialog and click "Insert".
Result: Statement is inserted, but in opened SQL editor. Statement was inserted in SQL editor, which had had focus when
"SQL History" dialog was opened.
Integrated into 'main-golden', will be available in build *200811231401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: John Baker <firstname.lastname@example.org>
Log: #153632 fix
The issue didn't pass the nomination process by nomination cut-off date. It has been marked as 65fixes2-candidate.
Verified with build 081123.
John, Roman, could you explain what the fix does? Sorry for jumping in so late.
It looks like this fix causes the insert to happen in the sql editor that it was originally
executed in. That will cause blind inserts. I don't think that's what the user would expect.
Since the user launched the sql history dialog from a specific editor, I think that's where the
insert should take place.
Am I understanding the fix correctly?
The following is what the fix intends to do:
Use case is
1) Open the SQL Editor A
2) Open another SQL Editor B
3) Launch SQL History from B
4) With SQL History still open, click on SQL Editor A
5) Select a statement in History and click Insert
statement should be inserted in Editor A, not B
This is one advantage of making the History non-modal - when there's more than one SQL file to edit
Exactly. The SQL editor I currently have opened with the cursor is where SQL history should be placed. This should
basically work like all other editor actions such as in the Java editor when I am typing and use CTRL+V to paste. It
inserts this pasted information where the cursor resides. I haven't tried this out yet, but does it put it where the
cursor is? This is how I would expect it to work...follow the cursor not only to locate an editor, but too, to find
where in the editor to place the text.
Looking at the fix source. If a .java file has the last focus the insert of source will take place there is this
correct? Seems a good candidate for an SPI to allow different editors to support special formatters and transormations
to the SQL history module to allow queries to be injected into source code.
...the formatters and transformations would allow the history module to ask them to format logic for a given file type
mime, ext, something, and then that would be used to transform the logic for the given editor to insert it correctly as
needed versus a straight text dump. Either way, I definitely think the way it should work is to insert into the editor
with the cursor which is what the fixes source does.
The issue is marked as the candidate for 65patch2. Since it has P3 priority, in accord with rules "How to include issues into patch"
(http://wiki.netbeans.org/NetBeansPatches) it must include an explanation as to why its backport is necessary and how
safe it is.
Could you please provide such explanation?
The justification is the same as for issue #153160, since this issue is a consequence of that issue.
This issue was reported after users compliance and it will help to improve work flow.
John, can you provide some information how safe this fix is.
Users wanted the SQL History dialog to be non-modal. Once the dialog is not modal and there are multiple SQL editors
open, then when statements are to be inserted from the dialog to the Editor, the statements should be inserted in the
SQL editor in focus.
Fix ensures statements are only inserted in the SQL editor, not Java or other editor. Fix has been reviewed and is safe
The fix has been ported into the release65_fixes repository.