DESCRIPTION

Bug 402439 - [Viewers] add method to return IStructuredSelection from
StructuredViewer 


Change-Id: I2b93f2393cb4e8f02396437fbbfbbcc8895e1564
Signed-off-by: Zaid Mosley xxx@xxx.xxx


COMMENTS

author: Zaid Mosley
date: 2013-09-10 20:33:33.000000000

Uploaded patch set 2.

-------------------------------------
author: Sebastian Porter
date: 2013-09-11 12:06:52.000000000

Abandoned

There are other implementations in the (subclass) hierarchy that return a different selection kind and hence adding getStructuredSelection() makes no sense.

-------------------------------------
author: Zaid Mosley
date: 2013-09-11 13:06:01.000000000

Patch Set 2:

@Dani, for example which StructuredViewer does not return a IStructuredSelection?

-------------------------------------
author: Sebastian Porter
date: 2013-09-12 06:27:10.000000000

Restored

We could indeed add this without breakage, but not as proposed in the change. If getStructuredSelection() just returns (IStructuredSelection) getSelection(); then it will work.

-------------------------------------
author: Sebastian Porter
date: 2013-09-12 06:28:05.000000000

Patch Set 2:

But we should not deprecated #getSelection()

-------------------------------------
author: Sebastian Porter
date: 2013-09-12 09:23:29.000000000

Patch Set 2:

And we should add panic code that checks whether getSelection() really returns am IStructuredSelection, since StructuredViewer#getSelection() only specifies:

 * The <code>StructuredViewer</code> implementation of this method returns
 * the result as an <code>IStructuredSelection</code>.

i.e. it does not explicitly say, that all sublcasses must return an IStructuredSelection.

-------------------------------------
