Bug 237503 - task editor does not allow comment text to flow to fill available space
Summary: task editor does not allow comment text to flow to fill available space
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: dev   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P2 normal (vote)
Target Milestone: 3.1   Edit
Assignee: David Green CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2008-06-17 13:57 EDT by David Green CLA
Modified: 2008-10-28 17:23 EDT (History)
4 users (show)

See Also:


Attachments
screenshot showing unused (wasted) space (88.58 KB, image/png)
2008-06-17 14:01 EDT, David Green CLA
no flags Details
patch that causes comments and description to flow to fill horizontal space (10.77 KB, patch)
2008-06-18 11:53 EDT, David Green CLA
no flags Details | Diff
mylyn/context/zip (7.36 KB, application/octet-stream)
2008-06-18 11:54 EDT, David Green CLA
no flags Details
screenshot showing editor with patch applied (94.53 KB, image/png)
2008-06-18 11:54 EDT, David Green CLA
no flags Details
white space below comment (17.08 KB, image/png)
2008-06-20 19:14 EDT, Steffen Pingel CLA
no flags Details
a new patch solving layout issues (12.22 KB, patch)
2008-06-23 16:05 EDT, David Green CLA
no flags Details | Diff
mylyn/context/zip (42.67 KB, application/octet-stream)
2008-06-23 16:05 EDT, David Green CLA
no flags Details
restored editor (60.25 KB, image/png)
2008-06-23 19:11 EDT, Steffen Pingel CLA
no flags Details
patch with margins (10.93 KB, patch)
2008-06-23 22:15 EDT, David Green CLA
no flags Details | Diff
patch that solves the workspace initialization problem (11.20 KB, patch)
2008-06-23 23:37 EDT, David Green CLA
no flags Details | Diff
mylyn/context/zip (57.20 KB, application/octet-stream)
2008-06-23 23:37 EDT, David Green CLA
no flags Details
new patch addresses workspace startup issue (13.89 KB, patch)
2008-06-24 20:58 EDT, David Green CLA
no flags Details | Diff
new patch that updates layout algorithm (16.23 KB, patch)
2008-07-09 13:20 EDT, David Green CLA
no flags Details | Diff
screenshot showing new layout algorithm in action painted with picasso (88.86 KB, image/png)
2008-07-09 13:21 EDT, David Green CLA
no flags Details
cut off text and horizontal scroll bar (bug 239087) (4.20 KB, image/png)
2008-07-10 19:56 EDT, Steffen Pingel CLA
no flags Details
patch that fixes word cut-off issue (16.27 KB, text/plain)
2008-07-11 11:54 EDT, David Green CLA
no flags Details
new patch that fixes horizontal scrollbar issue (16.68 KB, patch)
2008-08-19 21:13 EDT, David Green CLA
no flags Details | Diff
mylyn/context/zip (16.48 KB, application/octet-stream)
2008-08-19 21:13 EDT, David Green CLA
no flags Details
updated patch (19.21 KB, patch)
2008-10-01 02:05 EDT, Steffen Pingel CLA
no flags Details | Diff
white space below description of this bug (23.33 KB, image/png)
2008-10-01 02:14 EDT, Steffen Pingel CLA
no flags Details
optimizations (2.54 KB, patch)
2008-10-28 00:16 EDT, Steffen Pingel CLA
no flags Details | Diff
patch that delays reflow on resize (1.79 KB, patch)
2008-10-28 11:52 EDT, David Green CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Green CLA 2008-06-17 13:57:31 EDT
Build ID: I20080609-1311

Steps To Reproduce:
1. Open a task editor on a task with lots of comment text
2. Expand the task editor to a horizontal width greater than 550 pixels wide
3. Observe the wasted space on the right side of the editor where comment text is not flowing
Comment 1 David Green CLA 2008-06-17 14:01:40 EDT
Created attachment 105187 [details]
screenshot showing unused (wasted) space
Comment 2 David Green CLA 2008-06-17 14:03:16 EDT
fix for this bug must not cause performance issues.  See related bug 168557
Comment 3 Steffen Pingel CLA 2008-06-17 16:25:57 EDT
It is intentional that the text has a fixed width. I find it difficult to follow long lines on the screen when reading comments or descriptions. 

+1 for adding a sandbox setting to experiment with dynamic resizing of comments
Comment 4 David Green CLA 2008-06-17 19:16:59 EDT
Though individuals may have a preference on layout, the 'eclipse way' with other editors (such as the Java editor, XML editor, Text editor, etc) is to use all available space.

+1 for default behaviour to use all available space
Comment 5 David Green CLA 2008-06-17 23:07:58 EDT
I guess I should put my comment into context:

If I've invested in a nice big monitor, I want to be able to use it.  Failure to make good use of available screen space means more vertical scrolling.  This is why most (all?) other editors and views use available horizontal space.

If you want your editor to be less wide for any reason, there are lots of options available to you:

# you can resize the eclipse window
# you can resize the editor space by making adjoining views larger
# you can put multiple editors side-by-side
# you can make eclipse create a new window
Comment 6 Steffen Pingel CLA 2008-06-17 23:25:28 EDT
I am aware of that and it was not at all my intention to suggest that this is a bad idea. It is a significant change of the UI though and I believe that there is a benefit to the way the task editor works currently. Making it a sandbox preference would enable us to gather feedback from a larger user base and to get a sense of the performance impact without affecting all users. 
I am not sure if it is worth discussing if this has to be a sandbox option or not at this point. If there is a patch everybody interested can apply it to their workspace and if the benefit is obvious I am sure it'll make it into cvs soon enough :).
Comment 7 David Green CLA 2008-06-18 11:53:55 EDT
Created attachment 105303 [details]
patch that causes comments and description to flow to fill horizontal space
Comment 8 David Green CLA 2008-06-18 11:54:00 EDT
Created attachment 105304 [details]
mylyn/context/zip
Comment 9 David Green CLA 2008-06-18 11:54:41 EDT
Created attachment 105305 [details]
screenshot showing editor with patch applied
Comment 10 Steffen Pingel CLA 2008-06-20 19:13:22 EDT
With the patch applied I now get a horizontal scroll bar in every task editor. Is there a way to reduce the width of the comment viewer widgets by a few pixels to avoid that? 

I have also noticed that I sometimes get whitespace below expanded comments now. I'll attach a screen shot.
Comment 11 Steffen Pingel CLA 2008-06-20 19:14:00 EDT
Created attachment 105557 [details]
white space below comment
Comment 12 David Green CLA 2008-06-20 19:37:51 EDT
(In reply to comment #10)
> With the patch applied I now get a horizontal scroll bar in every task editor.
> Is there a way to reduce the width of the comment viewer widgets by a few
> pixels to avoid that? 

Sure.  Chances are the LayoutManager is not accounting for insets, margins or borders in some way.  I'll take a look.

> I have also noticed that I sometimes get whitespace below expanded comments
> now. I'll attach a screen shot.

Hmmm... that's no good.  I'll take a look at that, too.  Does this happen for all comments or just for specific ones?
Comment 13 Steffen Pingel CLA 2008-06-20 19:47:30 EDT
I don't always see it. The problem might be that the parent composite does not have its final width set when the editor is constructed. That would cause the SyledText to calculate the wrong height because it calculates it's wrapping based on that width. Take a look at TaskEditorRichTextPart.getEditorWidth(), it has some code approximate the width on editor construction.
Comment 14 David Green CLA 2008-06-21 22:59:24 EDT
thanks for the tip.  BTW, if I resize the editor the whitespace issue disappears.  That makes me think you're right about it being a problem during initialization.
Comment 15 David Green CLA 2008-06-23 16:05:55 EDT
Created attachment 105660 [details]
a new patch solving layout issues

this patch is based on the first and solves the following issues:

- no horizontal scroll bar unless non-flowing controls require it
- no excess whitespace below comments or description
- cleaner code in AbstractTaskEditorPage
Comment 16 David Green CLA 2008-06-23 16:05:59 EDT
Created attachment 105661 [details]
mylyn/context/zip
Comment 17 Steffen Pingel CLA 2008-06-23 18:37:04 EDT
I still get the horizontal scroll bar on Linux with the latest patch on open and refresh. I can also not "shrink" a task editor, when I make it less wide I get a horizontal scroll bar as well. I also noticed that the task editor that was restored on startup did not wrap the text in the description, the editor was as wide as the longest sentence in the description.

As a minor nit the task editor looks more crowded without the margins for comments. The old code used to set a bit of spacing around each comment:

			ecLayout.marginBottom = 3;
			ecLayout.marginLeft = 15;
Comment 18 David Green CLA 2008-06-23 19:00:58 EDT
(In reply to comment #17)
> I still get the horizontal scroll bar on Linux with the latest patch on open
> and refresh. I can also not "shrink" a task editor, when I make it less wide I
> get a horizontal scroll bar as well. I also noticed that the task editor that

There are still some items in the editor that require a minimum width (not the comments or description) and these can force the editor to have a horizontal scroll bar.  Can you attach a screenshot where you think the horizontal scroll bar should not appear? 

> was restored on startup did not wrap the text in the description, the editor
> was as wide as the longest sentence in the description.

If the description has a newline in it then text following the newline will always be on the next line.  Is that what you observed?

> 
> As a minor nit the task editor looks more crowded without the margins for
> comments. The old code used to set a bit of spacing around each comment:
> 
>                         ecLayout.marginBottom = 3;
>                         ecLayout.marginLeft = 15;
> 

We can put these margins in if you think they're needed.  Personally I like greater information density.  Please let me know what you want.
Comment 19 Steffen Pingel CLA 2008-06-23 19:11:43 EDT
Created attachment 105668 [details]
restored editor
Comment 20 Steffen Pingel CLA 2008-06-23 19:21:10 EDT
(In reply to comment #18)
> (In reply to comment #17)
> > I still get the horizontal scroll bar on Linux with the latest patch on open
> > and refresh. I can also not "shrink" a task editor, when I make it less wide I
> > get a horizontal scroll bar as well.
> 
> There are still some items in the editor that require a minimum width (not the
> comments or description) and these can force the editor to have a horizontal
> scroll bar.  Can you attach a screenshot where you think the horizontal scroll
> bar should not appear?

My mistake, it was a really wide email address in the People section that was causing the scroll bar to appear.

> > was restored on startup did not wrap the text in the description, the editor
> > was as wide as the longest sentence in the description.
> 
> If the description has a newline in it then text following the newline will
> always be on the next line.  Is that what you observed?

I think it is related to calculating the width of the first editor that is restored before the workbench is visible (see screenshot).

> We can put these margins in if you think they're needed.  Personally I like
> greater information density.  Please let me know what you want.

On second thought the layout without margins does look more concise. I think I still want the margin on the bottom to separate the comments more but we can keep it for now and get some more mileage and feedback from others.

Comment 21 David Green CLA 2008-06-23 22:13:19 EDT
(In reply to comment #18)
> (In reply to comment #17)
> > As a minor nit the task editor looks more crowded without the margins for
> > comments. The old code used to set a bit of spacing around each comment:
> >
> >                         ecLayout.marginBottom = 3;
> >                         ecLayout.marginLeft = 15;
> >
> 
> We can put these margins in if you think they're needed.  Personally I like
> greater information density.  Please let me know what you want.

Forget my comment about information density: the editor looks way better with the margins as you described.  I've updated the layout to support margins.
Comment 22 David Green CLA 2008-06-23 22:15:30 EDT
Created attachment 105673 [details]
patch with margins

added margins
renamed ShowAllLayout -> FillWidthLayout
javadocs
Comment 23 David Green CLA 2008-06-23 22:52:19 EDT
(In reply to comment #20)
> > We can put these margins in if you think they're needed.  Personally I like
> > greater information density.  Please let me know what you want.
> 
> On second thought the layout without margins does look more concise. I think I
> still want the margin on the bottom to separate the comments more but we can
> keep it for now and get some more mileage and feedback from others.

Oopps!  Too bad we're not communicating in real time!  Ok, what'll it be -- margins or no margins?  Your call.
Comment 24 David Green CLA 2008-06-23 23:37:21 EDT
Created attachment 105675 [details]
patch that solves the workspace initialization problem

hopefully this is the final cut.  It has margins, causes text to wrap and fill available space, and it works around the restored editor issue.
Comment 25 David Green CLA 2008-06-23 23:37:24 EDT
Created attachment 105676 [details]
mylyn/context/zip
Comment 26 Steffen Pingel CLA 2008-06-24 00:04:09 EDT
> Oopps!  Too bad we're not communicating in real time!  Ok, what'll it be --
> margins or no margins?  Your call.

It feels like real time ;). I'm fine with either layout.

I'm still seeing horizontal scroll bars on Linux when opening tasks that have a vertical scroll bar:

1. Open task  197455
2. Horizontal scroll bar appears (it scrolls about 4 pixels)
3. Resize Eclipse to make scroll bar go away
4. Close and reopen the task

The scroll bar reappears. It is fixed when I tweak FillWidthLayout.computeSize() to subtract 25 instead of 15. It would be best if these numbers would be extracted to constants with meaningful names.

I see some flickering on open that seems to be caused by the asyncExec() in AbstractTaskEditorPage.reflow(). Is there a way to avoid the reflow does not need to be delayed?
Comment 27 David Green CLA 2008-06-24 00:17:40 EDT
(In reply to comment #26)
> I'm still seeing horizontal scroll bars on Linux when opening tasks that have a
> vertical scroll bar:
> 
> 1. Open task  197455
> 2. Horizontal scroll bar appears (it scrolls about 4 pixels)
> 3. Resize Eclipse to make scroll bar go away
> 4. Close and reopen the task
> 
> The scroll bar reappears. It is fixed when I tweak FillWidthLayout.computeSize()
> to subtract 25 instead of 15. It would be best if these numbers would be

This must be a platform-specific number, since 15 works fine on my Mac.  I'm not sure why it's needed, it could be related to the width of a scrollbar.  Any thoughts on how to fix this isuse?

> extracted to constants with meaningful names.

Yes.

> 
> I see some flickering on open that seems to be caused by the asyncExec() in
> AbstractTaskEditorPage.reflow(). Is there a way to avoid the reflow does not
> need to be delayed?

The reflow is only needed if the editor is restored during workbench startup.  Any other editor creation doesn't need it at all.  Perhaps we could detect that case and live with flicker for those editors only.  What do you think?
Comment 28 Steffen Pingel CLA 2008-06-24 02:33:06 EDT
> This must be a platform-specific number, since 15 works fine on my Mac.  I'm not
> sure why it's needed, it could be related to the width of a scrollbar.  Any
> thoughts on how to fix this isuse?

Let's pick a reasonable large integer that works on Linux, Mac and Windows. Mylyn does this in a number of places.
 
> > I see some flickering on open that seems to be caused by the asyncExec() in
> > AbstractTaskEditorPage.reflow(). Is there a way to avoid the reflow does not
> > need to be delayed?
> 
> The reflow is only needed if the editor is restored during workbench startup.
> Any other editor creation doesn't need it at all.  Perhaps we could detect that
> case and live with flicker for those editors only.  What do you think?

Yes, that would be perfect. 

Another thing that would be worth investigating is the resizing of the new comment section when opening task editors. It seems that once a all controls are constructed and displayed the form is reflown and the new comment section is assigned its final size causing it to flicker. 

The reason why the section is handled differently than other sections is the code in AbstractTaskEditorPage.initializePart() which makes it expand vertically:

 GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(part.getControl());

David, do you have any ideas how this could be avoided? Note that this is entirely unrelated to your patch and present in the current implementation as well.
Comment 29 David Green CLA 2008-06-24 12:09:22 EDT
(In reply to comment #28)
> Let's pick a reasonable large integer that works on Linux, Mac and Windows.
> Mylyn does this in a number of places.

Any chance you could come up with the smallest possible number for Windows and Linux?  I don't have access to those platforms.

> 
> > > I see some flickering on open that seems to be caused by the asyncExec() in
> > > AbstractTaskEditorPage.reflow(). Is there a way to avoid the reflow does not
> > > need to be delayed?
> >
> > The reflow is only needed if the editor is restored during workbench startup.
> > Any other editor creation doesn't need it at all.  Perhaps we could detect
> that
> > case and live with flicker for those editors only.  What do you think?
> 
> Yes, that would be perfect.

Okay.... do you know of a reliable way of detecting this scenario?

> 
> Another thing that would be worth investigating is the resizing of the new
> comment section when opening task editors. It seems that once a all controls are
> constructed and displayed the form is reflown and the new comment section is
> assigned its final size causing it to flicker.
> 
> The reason why the section is handled differently than other sections is the
> code in AbstractTaskEditorPage.initializePart() which makes it expand
> vertically:
> 
> GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
> true).applyTo(part.getControl());
> 
> David, do you have any ideas how this could be avoided? Note that this is
> entirely unrelated to your patch and present in the current implementation as
> well.

There are two approaches that might work that I'm familiar with.  One is to add a resize listener on the control's parent, and whenever the control is resized set the width hint on the control.  Very much a hack, but relatively easy.  The other way is to use a layout manager similar to FillWidthLayout. 

Comment 30 David Green CLA 2008-06-24 20:58:13 EDT
Created attachment 105771 [details]
new patch addresses workspace startup issue

issues addressed in this patch:

* editors created on workspace startup reflow(), other editors do not (eliminating unnecessary flicker)
* hard-coded right margin for width hint is now OS-dependant
Comment 31 David Green CLA 2008-07-03 19:01:03 EDT
What is left to do here?  Steffen?
Comment 32 Steffen Pingel CLA 2008-07-04 17:23:44 EDT
I'll apply the latest patch to my base workspace and run on it for a bit.
Comment 33 Robert Elves CLA 2008-07-04 18:27:29 EDT
I noticed a couple things:
* Editor min size is lager (horizontal scroll bar visible until editor resized quite wide)
* Last few characters along rh margin of description/comments not visible in some scenarios requiring manual sizing of editor to make visible
Comment 34 David Green CLA 2008-07-04 19:04:30 EDT
(In reply to comment #33)
> I noticed a couple things:
> * Editor min size is lager (horizontal scroll bar visible until editor resized
> quite wide)
> * Last few characters along rh margin of description/comments not visible in
> some scenarios requiring manual sizing of editor to make visible
> 

I assumed that this was due to other elements (like email, attributes) pushing out the width of the editor.  If that's not the case then it'll need fixing.  We may need to resort to SWTSpy to figure it out.
Comment 35 Steffen Pingel CLA 2008-07-05 01:33:37 EDT
> I assumed that this was due to other elements (like email, attributes) pushing
> out the width of the editor.  If that's not the case then it'll need fixing.  We
> may need to resort to SWTSpy to figure it out.

The (Bugzilla) task editor should now shrink to 550 px of width. Email addresses in the people section should get cut off when they are too wide. 

With the latest version of the patch I ran into a scenario again where I was not able to shrink the editor. It would retain it's width and get a horizontal scroll bar. The scroll bar disappeared when I closed the task editor and reopened it.
Comment 36 David Green CLA 2008-07-09 12:30:35 EDT
(In reply to comment #35)
> The (Bugzilla) task editor should now shrink to 550 px of width. Email
> addresses in the people section should get cut off when they are too wide. 

Do email addresses (or their container) have a maximum width setting?  If not they'll just flow to occupy as much space as they can get.

> With the latest version of the patch I ran into a scenario again where I was
> not able to shrink the editor. It would retain it's width and get a horizontal
> scroll bar. The scroll bar disappeared when I closed the task editor and
> reopened it.

Interesting.  When I have time I'll take a look.  I've noticed http://wiki.eclipse.org/PDE/Incubator/Picasso which looks like it could be very helpful.

Remember that with this patch the text of comments/description should occupy the width determined by the widest component on the page.
Comment 37 David Green CLA 2008-07-09 13:18:39 EDT
I've made some changes to how the layout works that I believe resolves the remaining issues.  The key to the solution is to use the editor CTabFolder parent as the 'advisor' to the size of the client area.  That seems to be the most reliable way to determine the size of the editor outside of the scrolling area.
Comment 38 David Green CLA 2008-07-09 13:20:09 EDT
Created attachment 106983 [details]
new patch that updates layout algorithm
Comment 39 David Green CLA 2008-07-09 13:21:27 EDT
Created attachment 106984 [details]
screenshot showing new layout algorithm in action painted with picasso

notice that the attributes area with margins is determining the editor width.  Any less wide than this and it gets a horizontal scrollbar.
Comment 40 Steffen Pingel CLA 2008-07-10 19:56:45 EDT
Created attachment 107152 [details]
cut off text and horizontal scroll bar (bug 239087)
Comment 41 David Green CLA 2008-07-11 11:46:28 EDT
(In reply to comment #40)
> Created an attachment (id=107152) [details]
> cut off text and horizontal scroll bar (bug 239087)
> 

Steffen, thanks for sticking with me on this one.  As it turns out, getting it right is very hard.  I'll iterate on this one again.
Comment 42 David Green CLA 2008-07-11 11:54:06 EDT
Created attachment 107213 [details]
patch that fixes word cut-off issue

turns out that FillWidthLayout was not correctly applying margins when performing the layout
Comment 43 David Green CLA 2008-08-01 23:24:24 EDT
Steffen, this one's ready for you!
Comment 44 Steffen Pingel CLA 2008-08-02 20:35:14 EDT
Thanks David. I'll keep working with the patch and have scheduled it for review early in the 3.1 release cycle.
Comment 45 David Green CLA 2008-08-19 21:13:02 EDT
Created attachment 110406 [details]
new patch that fixes horizontal scrollbar issue

I've discovered why the horizontal scroll bar would present itself.  Basically without a reflow() the height of the text control cannot be increased or decreased.  So we have two scenarios:

# when the editor is resized larger the source viewer would either be too high for the wrapped text and thus have excess whitespace
# when the editor is resized smaller the source viewer would be too short and thus force the wrapped text to use horizontal space, requiring the horizontal scrollbar

To solve this issue a reflow() is performed when the editor is resized.  This allows the height of the text control to become smaller or larger as required, thus eliminating unused whitespace and the horizontal scrollbar.
Comment 46 David Green CLA 2008-08-19 21:13:06 EDT
Created attachment 110407 [details]
mylyn/context/zip
Comment 47 Steffen Pingel CLA 2008-10-01 02:05:49 EDT
Created attachment 113955 [details]
updated patch
Comment 48 Steffen Pingel CLA 2008-10-01 02:12:43 EDT
I have committed the updated page. The only modification I made is to hide getLayoutAdvisor() in an internal class instead of adding new API. There are three concerns left that I would like to address before closing the bug:

* The listener in AbstractTaskEditorPage.createPartControl() causes an extraneous reflow on first open of a task editor.
* The listener in AbstractTaskEditorPage.createPartControl() slows resizing of the editor noticeably. Would it be feasible to delay the reflow until resizing has finished? In the past we have used UI jobs for that but it would be nicer if SWT had an event for that similar to the post selection events provided by JFace viewers.
* The layout is too heigh when making the editor smaller than its minimum width (see screenshot).
Comment 49 Steffen Pingel CLA 2008-10-01 02:14:23 EDT
Created attachment 113956 [details]
white space below description of this bug
Comment 50 David Green CLA 2008-10-01 10:11:20 EDT
(In reply to comment #48)
> * The listener in AbstractTaskEditorPage.createPartControl() slows resizing of
> the editor noticeably. Would it be feasible to delay the reflow until resizing
> has finished?

How about using some kind of 'nagle' delay with a timer?
Comment 51 David Green CLA 2008-10-01 11:34:49 EDT
(In reply to comment #48)
> I have committed the updated page. 

Thanks for getting this one in there... it really makes a difference!
Comment 52 Steffen Pingel CLA 2008-10-01 13:07:24 EDT
> > * The listener in AbstractTaskEditorPage.createPartControl() slows resizing of
> > the editor noticeably. Would it be feasible to delay the reflow until resizing
> > has finished?
> 
> How about using some kind of 'nagle' delay with a timer?

Yes, we use a heuristic for task list refresh where we queue up multiple refreshes to avoid constantly keeping the UI busy during synchronizations. The implementation is in DelayedRefreshJob.
Comment 53 Steffen Pingel CLA 2008-10-28 00:16:38 EDT
Created attachment 116251 [details]
optimizations
Comment 54 Steffen Pingel CLA 2008-10-28 00:25:10 EDT
The patch improves performance by a magnitude when the editor reflows by not recalculating unchanged values. FillWidthLayout now breaks the contract of Layout by not flushing it's cache. I have made it package protected to avoid reuse of the class outside of it's current use-case. 

I have also tweaked the margin to avoid blank lines (comment 49).

David, are you planning to work on delaying reflows when the editor is resized?
Comment 55 David Green CLA 2008-10-28 09:50:05 EDT
(In reply to comment #54) 
> David, are you planning to work on delaying reflows when the editor is resized?

I'll take a look
Comment 56 David Green CLA 2008-10-28 11:52:18 EDT
Created attachment 116309 [details]
patch that delays reflow on resize

the attached patch greatly reduces the number of reflows on editor resize by applying a 'nagle' algorithm
Comment 57 Steffen Pingel CLA 2008-10-28 16:53:12 EDT
Thanks David, I have applied the patch with a minor modification: the listener checks if the form is disposed before calling reflow in case the editor was closed in the meantime.

Thanks for your great work on this bug! Please feel free to resolve if we are done here.
Comment 58 David Green CLA 2008-10-28 17:23:57 EDT
(In reply to comment #57)
> Thanks David, I have applied the patch with a minor modification: the listener
> checks if the form is disposed before calling reflow in case the editor was
> closed in the meantime.

Oops... I'd forgotten to do that.  Thanks.
 
> Thanks for your great work on this bug! 

Thanks!  It took awhile, but the wait was worth it.  Thanks for collaborating with me on this one.

> Please feel free to resolve if we are done here.

Done.