Review Workspace restore of ADS to see if Floating windows can be included.
"When I do the File --> New --> Query Analyzer, it just opens a new place to write and run a new query. It's exactly how I've always opened new connections to run more queries.
Found that ADS did not have tabbed panes restored correctly under certain conditions (logged as issue #13688) when reviewing ADS for this issue. We probably need to get issue #13688 fixed first before continue working on this feature request. It seems to me ADS needs to get panel object displayed in floating window restored in tabbed pane as the first step before ADS can make it floating.
I am done with the initial implementation for this feature request on Windows.
Implementation notes:
(1) In the current implementation, saving tabs is handled by RestoreWindows.storeTabs(...)
which does not handle tabs presented in floating windows. I don't want to modify the logic/code implemented in RestoreWindows.storeTabs(...)
because it will be called under different conditions (for example: moving tabs in tabbed pane), not just exiting ADS; I do not know what is the purpose for this.
In order to accommodate RestoreWindows.storeTabs(...)
's logic, I did the followings: (1-a) Save floating windows related information after user confirmed 'Exit' ADS. (1-b) Programmatically dock all of tabs presented in floating windows to tabbed pane. (1-c) Proceed to RestoreWindows.storeTabs(...)
to save tabs specific data.
(2) In the current implementation, restoring tabs is handled by RestoreWindows.restoreTabs(...)
, I don't want to modify this method's logic/code, either. RestoreWindows.restoreTabs(...)
's implementation remains unchanged, and after ADS is reopened, all of tabs should be restored in tabbed pane by this method. After this method is done, those tabs that used to be presented in floating windows will be programmatically floated to floating windows based on information stored in 1-a.
(3) To restore a tab back to a floating window, ADS needs a way to uniquely identify a tab. In the current implementation, there is a document-name attribute which can be used to uniquely identify a tab in ADS. However, we cannot use 'document-name' to identify a tab for the sake of store-restore because document-name is generated at run time; the generated document-name after ADS is reopened could be different than those names before ADS is closed, a similar use case is described in ADS #13750 (the generation of document-name is similar to the generation of title). In order to provide an unique id, I added a _restoreId attribute to the CommonDocument class which is a wrapper of jide's DocumentComponent.
ADS behavior after initial implementation is applied:
(a) Not all of tabs presented in ADS tabbed pane or ADS floating windows are restorable.
Here is the list of restorable tabs I know and have been tested:
Query Analyzer,
AquaScript Panel,
SSH Terminal,
FluidShell Terminal,
MongoShell Terminal,
Image Panel,
Editor Panel.
Other tabs are not restorable, for examples
Schema object visual editor launched from schema browser,
DBA Tools panels,
Import/Export Data
etc.
(b) Floating windows should be correctly restored to their old locations if they contain at least one restorable tab; this implies a flowing window won't be restored if all of tabs in it are non-restorable tabs. If a floating window was iconified, it should be iconified after restore. This location/iconify behavior is only tested on Windows platform, not sure what other platforms would behave.
(c) If the selected tab in a floating window is a restorable tab, then after floating window is restored, the selected tab should be restored as well.
(d) If the selected tab in a floating window is a non-restorable tab, then after floating window is restored, the first tab will be selected.
(e) User can open multiple ADS windows, there is no difference between restoring single ADS window or multiple ADS windows.
Known problems:
(I) The title of restored tabs (regardless whether they are floating or not) may not be restored correctly, this is logged as ADS #13750. If this problem should be fixed, we need to modify RestoreWindows.storeTabs(...)
and RestoreWindows.restoreTabs(...)
; it has nothing to do with floating window.
(II) After tabs are restored to floating windows, if later on user manually dock these tabs back to tabbed pane, tabs maybe docked to unexpected location, possibly in a separate split pane. Scenario 3 and Scenario 4 descirbed in ADS #13688 provide a simple use case to manually produce this problem. This is handled by jide, not sure if there is anything ADS can do.
I am done with the initial implementation for this feature request on Windows.
Implementation notes:
(1) In the current implementation, saving tabs is handled by RestoreWindows.storeTabs(...)
which does not handle tabs presented in floating windows. I don't want to modify the logic/code implemented in RestoreWindows.storeTabs(...)
because it will be called under different conditions (for example: moving tabs in tabbed pane), not just exiting ADS; I do not know what is the purpose for this.
In order to accommodate RestoreWindows.storeTabs(...)
's logic, I did the followings: (1-a) Save floating windows related information after user confirmed 'Exit' ADS. (1-b) Programmatically dock all of tabs presented in floating windows to tabbed pane. (1-c) Proceed to RestoreWindows.storeTabs(...)
to save tabs specific data.
(2) In the current implementation, restoring tabs is handled by RestoreWindows.restoreTabs(...)
, I don't want to modify this method's logic/code, either. RestoreWindows.restoreTabs(...)
's implementation remains unchanged, and after ADS is reopened, all of tabs should be restored in tabbed pane by this method. After this method is done, those tabs that used to be presented in floating windows will be programmatically floated to floating windows based on information stored in 1-a.
(3) To restore a tab back to a floating window, ADS needs a way to uniquely identify a tab. In the current implementation, there is a document-name attribute which can be used to uniquely identify a tab in ADS. However, we cannot use 'document-name' to identify a tab for the sake of store-restore because document-name is generated at run time; the generated document-name after ADS is reopened could be different than those names before ADS is closed, a similar use case is described in ADS #13750 (the generation of document-name is similar to the generation of title). In order to provide an unique id, I added a _restoreId attribute to the CommonDocument class which is a wrapper of jide's DocumentComponent.
ADS behavior after initial implementation is applied:
(a) Not all of tabs presented in ADS tabbed pane or ADS floating windows are restorable.
Here is the list of restorable tabs I know and have been tested:
Query Analyzer,
AquaScript Panel,
SSH Terminal,
FluidShell Terminal,
MongoShell Terminal,
Image Panel,
Editor Panel.
Other tabs are not restorable, for examples
Schema object visual editor launched from schema browser,
DBA Tools panels,
Import/Export Data
etc.
(b) Floating windows should be correctly restored to their old locations if they contain at least one restorable tab; this implies a flowing window won't be restored if all of tabs in it are non-restorable tabs. If a floating window was iconified, it should be iconified after restore. This location/iconify behavior is only tested on Windows platform, not sure what other platforms would behave.
(c) If the selected tab in a floating window is a restorable tab, then after floating window is restored, the selected tab should be restored as well.
(d) If the selected tab in a floating window is a non-restorable tab, then after floating window is restored, the first tab will be selected.
(e) User can open multiple ADS windows, there is no difference between restoring single ADS window or multiple ADS windows.
Known problems:
(I) The title of restored tabs (regardless whether they are floating or not) may not be restored correctly, this is logged as ADS #13750. If this problem should be fixed, we need to modify RestoreWindows.storeTabs(...)
and RestoreWindows.restoreTabs(...)
; it has nothing to do with floating window.
(II) After tabs are restored to floating windows, if later on user manually dock these tabs back to tabbed pane, tabs maybe docked to unexpected location, possibly in a separate split pane. Scenario 3 and Scenario 4 descirbed in ADS #13688 provide a simple use case to manually produce this problem. This is handled by jide, not sure if there is anything ADS can do.
@Sachin,
I am done with the initial implementation but have not checked in my changes yet. Please review this comment and let me know how do you want to proceed.
@Sachin,
I am done with the initial implementation but have not checked in my changes yet. Please review this comment and let me know how do you want to proceed.
When looking into ADS #13730, noticed that ADS offers a [Confirm exit of application]
option.
When I checked in SVN r45995 here, I thought user always gets a prompt to confirm if s/he wants to exit ADS; and SVN r45995 only works if user has confirmed the exit. Now, there is a [Confirm exit of application]
option provided by ADS; if user turned this option off and exited ADS, floating windows won't be restored in this scenario. Need to reopen this issue to take care this use case.
When looking into ADS #13730, noticed that ADS offers a [Confirm exit of application]
option.
When I checked in SVN r45995 here, I thought user always gets a prompt to confirm if s/he wants to exit ADS; and SVN r45995 only works if user has confirmed the exit. Now, there is a [Confirm exit of application]
option provided by ADS; if user turned this option off and exited ADS, floating windows won't be restored in this scenario. Need to reopen this issue to take care this use case.
SVN r46059/17.0.0-beta-26
This check-in will handle the following ADS options:
(1) File > Options > General > Workspace > Behavior of window close button
(2) File > Options > General > Workspace > Confirm exit of application
SVN r46059/17.0.0-beta-26
This check-in will handle the following ADS options:
(1) File > Options > General > Workspace > Behavior of window close button
(2) File > Options > General > Workspace > Confirm exit of application
Issue #13549 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 17.0.0-beta-26 |
No time estimate |
3 issue links |
relates to #13730
Issue #13730Add option Option->General->Workspace->[Save files on exit without prompting] |
depends upon #13688
Issue #13688ADS tabbed panes are not restored correctly on opening ADS under certain scenarios |
depends upon #13750
Issue #13750ADS tab titles are not restored the same as they used to be |
Found that ADS did not have tabbed panes restored correctly under certain conditions (logged as issue #13688) when reviewing ADS for this issue. We probably need to get issue #13688 fixed first before continue working on this feature request. It seems to me ADS needs to get panel object displayed in floating window restored in tabbed pane as the first step before ADS can make it floating.