Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-04-09 05:06:19 -0400
committerUwe Stieber2013-04-09 05:06:19 -0400
commit1ea76786fb48d778e7b7dd3fc4b6417875225899 (patch)
treef1fc3e353c65f9fdc90a3593ca2a00e5f5e8b29c /target_explorer/plugins/org.eclipse.tcf.te.ui.swt
parent3dc3211274b69bb3dd7c58089c0c13eb5ea3aa28 (diff)
downloadorg.eclipse.tcf-1ea76786fb48d778e7b7dd3fc4b6417875225899.tar.gz
org.eclipse.tcf-1ea76786fb48d778e7b7dd3fc4b6417875225899.tar.xz
org.eclipse.tcf-1ea76786fb48d778e7b7dd3fc4b6417875225899.zip
Target Explorer: Adapt custom tray dialog to use the same scrollable composite dialog area implementation as the custom title area dialog
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.ui.swt')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java48
1 files changed, 40 insertions, 8 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java
index 38e647197..72f110e99 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java
@@ -16,10 +16,12 @@ import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.TrayDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.tcf.te.ui.swt.activator.UIPlugin;
import org.eclipse.ui.PlatformUI;
@@ -129,32 +131,62 @@ public class CustomTrayDialog extends TrayDialog {
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
- protected Control createDialogArea(Composite parent) {
+ protected final Control createDialogArea(Composite parent) {
if (contextHelpId != null) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, contextHelpId);
}
// Let the super implementation create the dialog area control
Control control = super.createDialogArea(parent);
- // But fix the layout data for the top control
+ // Setup the inner panel as scrollable composite
if (control instanceof Composite) {
- configureDialogAreaControl((Composite)control);
+ ScrolledComposite sc = new ScrolledComposite((Composite)control, SWT.V_SCROLL);
+
+ GridLayout layout = new GridLayout(1, true);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ layout.verticalSpacing = 0; layout.horizontalSpacing = 0;
+
+ sc.setLayout(layout);
+ sc.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
+
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+
+ // Give subclasses the chance to configure the new dialog area control
+ configureDialogAreaControl(sc);
+
+ Composite composite = new Composite(sc, SWT.NONE);
+ composite.setLayout(new GridLayout());
+
+ // Setup the dialog area content
+ createDialogAreaContent(composite);
+
+ sc.setContent(composite);
+ sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+ // Return the scrolled composite as new dialog area control
+ control = sc;
}
return control;
}
/**
+ * Creates the dialog area content.
+ *
+ * @param parent The parent composite. Must not be <code>null</code>.
+ */
+ protected void createDialogAreaContent(Composite parent) {
+ Assert.isNotNull(parent);
+ }
+
+ /**
* Configure the dialog top control.
*
* @param composite The dialog top control. Must not be <code>null</code>.
*/
protected void configureDialogAreaControl(Composite composite) {
Assert.isNotNull(composite);
- Layout layout = composite.getLayout();
- if (layout == null || layout instanceof GridLayout) {
- composite.setLayout(new GridLayout());
- }
}
/**

Back to the top