Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2010-02-13 01:22:48 +0000
committerrelves2010-02-13 01:22:48 +0000
commit473dda2d38aa3dd2eb30c3d14a03908b08b6a8d7 (patch)
tree1ef4abb028e8449cd119ec487fea8f6e6750a4c7 /org.eclipse.mylyn.bugzilla.ui
parent58d9432f7793dbbdf1c5e4dc367607e523e44af2 (diff)
downloadorg.eclipse.mylyn.tasks-473dda2d38aa3dd2eb30c3d14a03908b08b6a8d7.tar.gz
org.eclipse.mylyn.tasks-473dda2d38aa3dd2eb30c3d14a03908b08b6a8d7.tar.xz
org.eclipse.mylyn.tasks-473dda2d38aa3dd2eb30c3d14a03908b08b6a8d7.zip
297437: Support for patch review through Mylyn for Bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=297437
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java49
1 files changed, 41 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
index 2f42c1865..45493b44e 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
@@ -14,6 +14,7 @@ package org.eclipse.mylyn.internal.bugzilla.ui.tasklist;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaFlag;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaFlagMapper;
@@ -24,10 +25,12 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.wizards.TaskAttachmentPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
@@ -52,16 +55,46 @@ public class BugzillaTaskAttachmentPage extends TaskAttachmentPage {
private ExpandableComposite flagExpandComposite = null;
- private Composite scrollComposite;
+ private Composite flagScrollComposite;
+
+ private ScrolledComposite scrolledComposite;
+
+ private Composite scrolledBodyComposite;
public BugzillaTaskAttachmentPage(TaskAttachmentModel model) {
super(model);
toolkit = new FormToolkit(Display.getCurrent());
}
+ private void updateScrolledCompositeSize() {
+ scrolledComposite.setMinSize(scrolledBodyComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
+ }
+
+ private void createScrolledComposite(Composite parent) {
+ scrolledComposite = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL /*| SWT.BORDER*/) {
+ @Override
+ public Point computeSize(int hint, int hint2, boolean changed) {
+ return new Point(64, 64);
+ }
+ };
+ scrolledComposite.setExpandHorizontal(true);
+ scrolledComposite.setExpandVertical(true);
+ scrolledBodyComposite = new Composite(scrolledComposite, SWT.NONE);
+ scrolledBodyComposite.setLayout(new GridLayout());
+ scrolledComposite.setContent(scrolledBodyComposite);
+ setControl(scrolledComposite);
+ Dialog.applyDialogFont(scrolledBodyComposite);
+ }
+
+ private Composite getScrolledBodyComposite() {
+ return scrolledBodyComposite;
+ }
+
@Override
public void createControl(Composite parent) {
- super.createControl(parent);
+ createScrolledComposite(parent);
+ updateScrolledCompositeSize();
+ super.createControl(getScrolledBodyComposite());
BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(getModel().getTaskRepository()
.getConnectorKind());
RepositoryConfiguration configuration = connector.getRepositoryConfiguration(getModel().getTaskRepository()
@@ -155,7 +188,7 @@ public class BugzillaTaskAttachmentPage extends TaskAttachmentPage {
Label dummy = new Label(pageComposite, SWT.NONE);
dummy.setText(""); //$NON-NLS-1$
}
- updateSize4ScrolledComposite();
+ updateScrolledCompositeSize();
}
private Composite createFlagSection(Composite container) {
@@ -171,15 +204,15 @@ public class BugzillaTaskAttachmentPage extends TaskAttachmentPage {
flagExpandComposite.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
- updateSize4ScrolledComposite();
+ updateScrolledCompositeSize();
getControl().getShell().pack();
}
});
- scrollComposite = new Composite(flagExpandComposite, SWT.NONE);
- scrollComposite.setLayout(new GridLayout(3, false));
- flagExpandComposite.setClient(scrollComposite);
- return scrollComposite;
+ flagScrollComposite = new Composite(flagExpandComposite, SWT.NONE);
+ flagScrollComposite.setLayout(new GridLayout(3, false));
+ flagExpandComposite.setClient(flagScrollComposite);
+ return flagScrollComposite;
}
@Override

Back to the top