Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320905 - DiagramDocumentEditor limits status line message to single element selection
Summary: DiagramDocumentEditor limits status line message to single element selection
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.4.0   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: 1.4.1   Edit
Assignee: Linda Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-26 09:55 EDT by Linda Damus CLA
Modified: 2010-07-29 10:03 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix. (7.06 KB, patch)
2010-07-27 09:16 EDT, Linda Damus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.