Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-10-28 20:49:35 +0000
committerspingel2008-10-28 20:49:35 +0000
commita6055984db5f4b9e25030563c9c8ec0a853b1998 (patch)
treea689656c41756d7311b79deedace5019e5600f1c
parent242f8620b704c9ae55b2d6e44e83ba8f82694819 (diff)
downloadorg.eclipse.mylyn.tasks-a6055984db5f4b9e25030563c9c8ec0a853b1998.tar.gz
org.eclipse.mylyn.tasks-a6055984db5f4b9e25030563c9c8ec0a853b1998.tar.xz
org.eclipse.mylyn.tasks-a6055984db5f4b9e25030563c9c8ec0a853b1998.zip
ASSIGNED - bug 237503: task editor does not allow comment text to flow to fill available space
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237503
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java33
1 files changed, 28 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
index e002200e8..7a1ed8e84 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
@@ -159,6 +159,33 @@ import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
*/
public abstract class AbstractTaskEditorPage extends FormPage implements ISelectionProvider, ISelectionChangedListener {
+ /**
+ * Causes the form page to reflow on resize.
+ */
+ private final class ParentResizeHandler implements Listener {
+ private int generation;
+
+ public void handleEvent(Event event) {
+ ++generation;
+
+ Display.getCurrent().timerExec(300, new Runnable() {
+ int scheduledGeneration = generation;
+
+ public void run() {
+ if (getManagedForm().getForm().isDisposed()) {
+ return;
+ }
+
+ // only reflow if this is the latest generation to prevent
+ // unnecessary reflows while the form is being resized
+ if (scheduledGeneration == generation) {
+ getManagedForm().reflow(true);
+ }
+ }
+ });
+ }
+ }
+
private class SubmitTaskJobListener extends SubmitJobListener {
private final boolean attachContext;
@@ -497,11 +524,7 @@ public abstract class AbstractTaskEditorPage extends FormPage implements ISelect
@Override
public void createPartControl(Composite parent) {
- parent.addListener(SWT.Resize, new Listener() {
- public void handleEvent(Event event) {
- getManagedForm().reflow(true);
- }
- });
+ parent.addListener(SWT.Resize, new ParentResizeHandler());
super.createPartControl(parent);
}

Back to the top