Community
Participate
Working Groups
The outline view doesn't fully support actions on multiple selections. For example delete.
The WSDL editor has a similar limitation.
Having multiple selections results in some problematic cases due to the limitation in the source editor, where only one continuous block of text can be selected at once in the source editor. When the selection change event is fired from the outline view to the source editor, this restriction can result in other items being selected. When the source editor changes and fires the event back to the outline view, unexpected new items may have been selected or removed. Problems: 1) User selecting items from multiple categories. For example, if the user selects a simple type from the Types category and then uses ctrl+click to select an element from the Elements category, the source editor will select anything between the declaration of the selected simple type to the selected element. 2) Using ctrl+click within a category or group to select non-consecutive items. For example, selecting the 1st and 4th element in a group will result in the selection of the 1st, 2nd, 3rd, and 4th element because the source editor must select a continuous block. One potential solution is to prevent select events from firing in the outline view if more than one item is selected. However, when delete is called, only the item selected in the source view is removed. Thus, actions like delete don't look at the outline view to determine what items are selected. If the source editor had the ability to select multiple (possibly disjoint) selection blocks instead of one continuous block, these problems would be eliminated. If the user only selects items within the same category or group using shift selection, multiple selection can easily be added. However, the unexpected behaviour associated with the valid user actions listed above makes this fix a lot trickier.
A suggested solution by Valentin was to prevent multiple selection in the outline tree viewer. If multiple selection is disabled, at least the "snap back" behaviour will not occur. The "snap back" behaviour is where multiple items are selected in the outline view, but becomes a single item selection shortly because of the selection change events being fired from the source view back to the outline view. Thus, it is possible to fix this "snap back" effect in the outline view by: 1) Allowing multiple selection - tricky in the current design 2) Disabling multiple selection - a new restriction to the outline view, which is a simple change (changing the tree viewer creation from using SWT.MULTI to SWT.SINGLE) The side-effect of disabling multiple selection is multiple items selected in the source view are no longer reflected in the outline view. The outline view will have an empty selection. Is this solution and side-effect appropriate? Any ideas?
Created attachment 116889 [details] Patch A patch for the solution discussed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=251474#c3. If there was a way to disable the modifiers like CTRL or SHIFT from working in the outline view and keeping the SWT.MULTI, that would at least fix the empty selection which occurs when multiple items are selected in the source view. At the same time, it would prevent the multiple selection problems in the outline view by restricting selections to single items.
Keith, please give this some thought for M4.
(In reply to comment #4) > Created an attachment (id=116889) [details] > Patch > A patch for the solution discussed in > https://bugs.eclipse.org/bugs/show_bug.cgi?id=251474#c3. > If there was a way to disable the modifiers like CTRL or SHIFT from working in > the outline view and keeping the SWT.MULTI, that would at least fix the empty > selection which occurs when multiple items are selected in the source view. At > the same time, it would prevent the multiple selection problems in the outline > view by restricting selections to single items. Let's keep it single selection. I've modified it so that if you multiple-select from the source or design, only the first component will be selected in the outline. Released for 3.1 M4.
Verified in wtp-sdk-S-3.1M4-20081215095735. Closing bug.