Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320661

Summary: Label editor on connectors should be shorter
Product: [Modeling] GMF-Runtime Reporter: Anthony Hunter <ahunter.eclipse>
Component: GeneralAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aboyko
Version: 1.4.0   
Target Milestone: 1.4.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch to fix the issue. none

Description Anthony Hunter CLA 2010-07-22 15:35:14 EDT
When creating a connector, direct label editor pops up. It is currently too long and can interfere with other actions. 

In addition, If you look at the text field, as soon as you type the first character "a", the text field shrinks back to the size of "a".

The issue is in TextDirectEditManager, 

if (label.getText().length() <= 0) {
            // if there is no text, let's assume a default size
            // because it looks silly when the cell editor it tiny.
            rect.setSize(new Dimension(text.computeSize(
                SWT.DEFAULT, SWT.DEFAULT)));
                            
Since we are passing in SWT.DEFAULT, computeSize returns an OS dependent value, which is big (64 pixels on linux). 

Rather than default to SWT.DEFAULT, we should default of the side of "a".
Comment 1 Anthony Hunter CLA 2010-07-22 15:36:11 EDT
Created attachment 175016 [details]
Patch to fix the issue.
Comment 2 Alex Boyko CLA 2010-07-22 15:42:39 EDT
Looks good to me.
Comment 3 Anthony Hunter CLA 2010-08-12 15:16:09 EDT
(In reply to comment #2)
> Looks good to me.

Thanks Alex, committed to HEAD and R1_4_maintenance for 1.4.1.