SaveAsInSQLEditor
Save-As In SQLEditor
Issue
Review page
Description
Currently the SQL Editor automatically saves the current editor in a file named "SQL Command n" where n is just incremented to the next available number and the file is saved in the userdir.
When the user wants to save, the default directory should be the root of the project directory. When a user picks a location to save a SQL file, we should remember that, and use that same location next time they invoke Save As.
Use cases
- User opens an SQL file and wants to rename the file by using Save-As.
- The Save As dialog opens with the target folder the same as this file's parent folder
- User renames the file and now there are 2 SQL files with different names but the same content
- User chooses View Data on a database table in Services or chooses
Execute Command from a database connection. A new console is opened
named, SQL Command n is opened with the query executed when choosing View->Data. The label for the File tab is set to "SQL Command n" and the icon in the tab is TBD 1
- User chooses Save As for the first time
- The Save As dialog opens with the target folder reset to the user's system home directory.
- File is saved using the default name in the user's system home directory . As a result, the label in the File tab changes from "SQL Command n" to "SQL Command n.sql" and the new icon TBD changes to the SQL file icon
- User chooses View Data on a database table in Services or chooses
Execute Command from a database connection. A new console is opened
named, SQL Command n is opened with the query executed when choosing View->Data. The label for the File tab is set to "SQL Command n" and the icon in the tab is TBD 1
- User chooses Save As
- The Save As dialog opens
- User changes the target folder
- File is saved using the default name in the new folder specified by the user . As a result, the label in the File tab changes from "SQL Command n" to "SQL Command n.sql" and the icon changes to the SQL file icon
Result: the label in the File tab changes from "SQL Command n" to "SQL Command n.sql" and the icon changes to the SQL file icon
- User chooses View Data on a database table in Services or chooses
Execute Command from a database connection. A new console is opened
named, SQL Command n is opened with the query executed when choosing View->Data. The label for the File tab is set to "SQL Command n" and the icon in the tab is TBD 1
- User chooses Save As
- The Save As dialog opens and the target folder is the last used folder as changed in use case #3
- File is saved using the default name in the last used folder specified by the user . As a result, the label in the File tab changes from "SQL Command n" to "SQL Command n.sql" and the icon changes to the SQL file icon
Result: the label in the File tab changes from "SQL Command n" to "SQL Command n.sql" and the icon changes to the SQL file icon
- If the file that has been named through Save-As is modified, then
Save is enabled.
- if File->Save main menuitem is chosen
or the save icon is clicked then the file is saved using the
current name and location.
- User makes changes to a regular SQL file then exits NetBeans. The
Save dialog should open.
- User modifies a temporary file and exits NetBeans - The
Save dialog should not open.
- The user has saved the file as an SQL file, but wants to
rename it. Save As is available
- If Save As is chosen and the same name is provided again then a "Select another name" dialog opens (Same behavior as for Java files)
- If Save As is chosen and a different but existing filename is provided then a dialog should open prompting the user to overwrite the file or not
1 Mike to provide the icon

