Bug 198242 - [Snippets] Customize Palette dialog does resize on selecting template
Summary: [Snippets] Customize Palette dialog does resize on selecting template
Status: ASSIGNED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Snippets Framework (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Wang Chaobin CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
: 157428 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-30 06:42 EDT by Benno Baumgartner CLA
Modified: 2015-06-03 11:30 EDT (History)
5 users (show)

See Also:
shr31223: review? (konstantin)
shr31223: review? (thatnitind)


Attachments
screen shot (64.43 KB, image/png)
2007-07-30 06:42 EDT, Benno Baumgartner CLA
no flags Details
screen shot (738.63 KB, image/bmp)
2015-06-01 03:02 EDT, Wang Chaobin CLA
no flags Details
Patch (1.24 KB, patch)
2015-06-02 03:12 EDT, Wang Chaobin CLA
no flags Details | Diff
patch (994 bytes, patch)
2015-06-02 09:22 EDT, Wang Chaobin CLA
no flags Details | Diff

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