Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320905

Summary: DiagramDocumentEditor limits status line message to single element selection
Product: [Modeling] GMF-Runtime Reporter: Linda Damus <ldamus>
Component: GeneralAssignee: Linda Damus <ldamus>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse
Version: 1.4.0   
Target Milestone: 1.4.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix. none

Description Linda Damus CLA 2010-07-26 09:55:15 EDT
The DiagramDocumentEditor#handleSelectionChanged method updates the status line message contribution only for the first element in the diagram selection.

I would like to display a status line message that indicates the number (and possibly type) of elements in the selection, when more than one elements in selected in the diagram editor.

Please consider passing the entire selection to the status line label provider, like this:


protected void handleSelectionChanged() {

   if (isStatusLineOn() && statusLineLabelProvider != null) {

      IStructuredSelection selection = (IStructuredSelection) getSite().
				          getSelectionProvider().getSelection();
		
      updateStatusLineMessageContribution(
         statusLineLabelProvider.getText(selection),
         statusLineLabelProvider.getImage(selection));

   }
}
Comment 1 Anthony Hunter CLA 2010-07-26 10:39:18 EDT
Hi Linda, I do not think this is a breaking change, the label provider should be able to handle any object it gets.
Comment 2 Linda Damus CLA 2010-07-26 11:26:13 EDT
I agree, it should.  

My concern is for those clients who may not have been rigorous in checking the type of the input.  I was thinking we should avoid exposing the potential defect in their implementation until a major release.  Perhaps that is over-protective?
Comment 3 Anthony Hunter CLA 2010-07-26 11:59:30 EDT
(In reply to comment #2)
> [snip]  Perhaps that is
> over-protective?

Yes, I think this is over protective and we can make the change.
Comment 4 Linda Damus CLA 2010-07-27 09:16:29 EDT
Created attachment 175310 [details]
Proposed fix.
Comment 5 Linda Damus CLA 2010-07-27 09:19:03 EDT
Code reviewed by Anthony.

Committed the fix.
Comment 6 Anthony Hunter CLA 2010-07-28 17:02:18 EDT
Hi Linda, I can see the change in HEAD but not R1_4_maintenance. I am going to merge the change back.
Comment 7 Linda Damus CLA 2010-07-29 10:03:39 EDT
Thanks Anthony!

I was confused and thought HEAD was still the 1.4.x stream.