Community
Participate
Working Groups
Created attachment 106930 [details] An example Build ID: I20080617-2000 Dialog#createDialogArea javadoc says: * @return the dialog area control but ErrorDialog#createDialogArea overrides Dialog#createDialogArea, does not call super (what is acceptable) and creates some components that are out of the dialog area control. The problem appears when someone extends ErrorDialog and places additional widgets (createMessageArea overriden) *and* support area is enabled. Support Area increases the number of available columns in GridLayout, however it is created after message area. So increasing columns count causes all widget to be shifted. ChangeExceptionHandler#RefactorErrorDialog is a good example (see attachment 1 [details]).
Created attachment 106931 [details] Picasso Visualisation Note the blue rectangle just above the buttons - it is empty dialog area. Message components are placed somewhere else. Note also the shift of components.
Created attachment 106932 [details] Fix Fix is easy - message components have to be placed on the dialog area composite. We can also decrease vertical span for support, as we have one row less now.
Created attachment 106933 [details] Same screenshots with applied patch Now message components are correctly placed.
Created attachment 106934 [details] Manual Tests To reproduce: import project, optionally import picasso (http://wiki.eclipse.org/PDE/Incubator/Picasso) enable support (in testing menu), open error dialog (in testing menu) To open refactoring error dialog 0. enable support 1. Open Java File with WORD. 2. Try to rename it.
Could this fix possibly help 220250 ?
(In reply to comment #5) > Could this fix possibly help 220250 ? I do not think so... I am trying to work dialog better in certain conditions, and I do not intend to change its behavior.
Good investigation. I agree that the fix must have the characteristic that the message and support areas are each single sibling composites. That's the only way to control layout. Another fix would be for IconAndMessageDialog.createMessageArea() to create and return its own (new) composite. This makes createMessageArea() and createSupportArea() similar (both create composites in parent from createDialogArea()). However we must then trust that someone isn't overriding createMessageArea() and not calling super. Nothing in the Javadoc prevents that. So ok I think your solution is better although it looks odd in ErrorDialog.createDialogArea() to have: createMessageArea(composite); createSupportArea(parent); I'm ok with this patch as is but it needs a comment in createDialogArea() explaining why the args of those to creates are different.
Thinking more, you're right that this observes the contract from Dialog better. Patch released with an additional explanatory comment. Thanks for the patch!
Marking as "greatbug" because: 1) You reported it 2) Analyzed why it was happening 3) Provided proof of issue via picasso snaps 4) Provided patch to fix 5) Provided test case and further picasso snaps to show fixed Wow!!! Nice work!
verified with following procedure: 0. add support area to error dialog 1. create java project with some class 2. open the class with ms word 3. try to rename the class ErrorDialog appears, picasso shows that everything is OK. Code is in repository.