Bug 198242

Summary: [Snippets] Customize Palette dialog does resize on selecting template
Product: [WebTools] WTP Common Tools Reporter: Benno Baumgartner <benno.baumgartner>
Component: Snippets FrameworkAssignee: Wang Chaobin <wangchaobin>
Status: ASSIGNED --- QA Contact: Konstantin Komissarchik <konstantin>
Severity: normal    
Priority: P3 CC: for.work.things, konstantin, shr31223, thatnitind, wangchaobin
Version: 2.0Flags: shr31223: review? (konstantin)
shr31223: review? (thatnitind)
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
screen shot
none
screen shot
none
Patch
none
patch none

Description Benno Baumgartner CLA 2007-07-30 06:42:02 EDT
In snippets view
1. Customize...
2. New
3. Type in a long string without new lines as template pattern
4. Ok
5. Customize...
6. Select the template you've created before
Is:
 Dialog resizes to show the whole string. No scrollbar shown in template pattern text field. The dialog spans over two screens on my machine.
Should:
 Not resize, show scrollbars.

See screen shot.

Sorry, I don't know which component to use
Comment 1 Benno Baumgartner CLA 2007-07-30 06:42:23 EDT
Created attachment 74914 [details]
screen shot
Comment 2 Wang Chaobin CLA 2015-06-01 03:02:52 EDT
Created attachment 253961 [details]
screen shot

Also happened on Luna SR1.

When you type too much characters(ex. above 200) in step 3, 
next time when you open [Customize Pelatte] in step 5, 
the window would expand the full screen, 
and [New]/[Delete] button on the right side of [Variables] would be missed.
see the attachment.
Comment 3 Wang Chaobin CLA 2015-06-01 08:10:44 EDT
Set contentData.widthHint in createContents(Composite parent) method in VariableItemEditor.java(around Line 359) solves this.
Comment 4 Wang Chaobin CLA 2015-06-01 12:07:27 EDT
(In reply to Wang Chaobin from comment #3)
> Set contentData.widthHint in createContents(Composite parent) method in
> VariableItemEditor.java(around Line 359) solves this.

Seems webtools.common.snippets.git could not be found in Gerrit(?), diff like blow.

plugin:webtools.common.snippets.git
file:org\eclipse\wst\common\snippets\internal\editors\VariableItemEditor.java
before:
--------------------------------------------------------
GridData contentData = new GridData(GridData.FILL_BOTH);
contentData.heightHint = parent.getDisplay().getClientArea().height / 5;
content.setLayoutData(contentData);
--------------------------------------------------------
after:
--------------------------------------------------------
GridData contentData = new GridData(GridData.FILL_BOTH);
contentData.heightHint = parent.getDisplay().getClientArea().height / 5;
contentData.widthHint = 300;
content.setLayoutData(contentData);
--------------------------------------------------------
Comment 5 Roberto Sanchez Herrera CLA 2015-06-01 12:22:36 EDT
Hello Wang, 

Could you please attach a patch to this bugzilla so we can review it and merge it? 

I'm triaging this to Mars SR1.
Comment 6 Wang Chaobin CLA 2015-06-02 03:12:19 EDT
Created attachment 254002 [details]
Patch

Hi Roberto,

Please review this patch.

#155974,#157428 are probably the duplicate of this bug.
Comment 7 Wang Chaobin CLA 2015-06-02 09:22:36 EDT
Created attachment 254025 [details]
patch

please review this path. without hard code.
Comment 8 Roberto Sanchez Herrera CLA 2015-06-02 11:08:09 EDT
I tested the second patch (and marked the first one as obsolete) and verified that it fixes the problem reported in this bug, and the other two bug mentioned by Wang.

Requesting review from Konstantin
Comment 9 Roberto Sanchez Herrera CLA 2015-06-02 11:08:51 EDT
*** Bug 157428 has been marked as a duplicate of this bug. ***
Comment 10 Konstantin Komissarchik CLA 2015-06-03 11:15:24 EDT
I can review, but are you sure I am the best person to do so? I haven't looked at the snippets code base before. Perhaps you meant to request a review from Nitin?
Comment 11 Roberto Sanchez Herrera CLA 2015-06-03 11:30:12 EDT
(In reply to Konstantin Komissarchik from comment #10)
> I can review, but are you sure I am the best person to do so? I haven't
> looked at the snippets code base before. Perhaps you meant to request a
> review from Nitin?

I added you as reviewer because you are in the QA Contact field, but I'm adding  Nitin as well.