Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 66526 - [Dialogs] Review the design of MessageDialogWithToggle.createButtonsForButtonBar
Summary: [Dialogs] Review the design of MessageDialogWithToggle.createButtonsForButtonBar
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC All
: P4 normal (vote)
Target Milestone: 3.2 M2   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 90840 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-10 11:42 EDT by Douglas Pollock CLA
Modified: 2007-06-29 14:08 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Pollock CLA 2004-06-10 11:42:37 EDT
I200406090800. 
 
Tod has mentioned some concerns over the large if statement structure used to 
look up labels and match them to identifiers.  This seems cumbersome, and 
should be looked over again.
Comment 1 Susan McCourt CLA 2005-08-22 15:28:37 EDT
The method is cumbersome, but I did not want to create new state (such as a 
map) for the sake of readability.  I reorganized the code a bit to move the 
string matching to a separate method.  This improves the readability of the 
button creation code, and also allows for multiple if/return statements in the 
new method, which is a bit more readable than the old code.

More importantly, I changed the id used when a match is not found.  It was 
using the loop index to assign the button id, which could cause id collisions 
depending on the buttons provided.  Instead I use IDialogConstants.CLIENT_ID 
as the id if a match is not found, incrementing it each time used.  

Available >20050822.
Comment 2 Kim Horne CLA 2005-09-20 15:47:06 EDT
Looks good in I20050920-0010
Comment 3 Susan McCourt CLA 2007-06-29 14:08:40 EDT
*** Bug 90840 has been marked as a duplicate of this bug. ***