Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2013-01-25 21:46:31 +0000
committerJeff Johnston2013-02-04 21:54:31 +0000
commite611496429743c9022b426ebc1b87c021b113fc3 (patch)
treea127541f34b7f4a4896f3deecda52c80cec4a4a2
parent91f12202b4cd7e520456ed68c07f04735acb844c (diff)
downloadorg.eclipse.linuxtools-e611496429743c9022b426ebc1b87c021b113fc3.tar.gz
org.eclipse.linuxtools-e611496429743c9022b426ebc1b87c021b113fc3.tar.xz
org.eclipse.linuxtools-e611496429743c9022b426ebc1b87c021b113fc3.zip
Bug 399130: Perf options tab should add scrollbars when window
resized https://bugs.eclipse.org/bugs/show_bug.cgi?id=399130 - Add scrollbar support to Perf options tab Change-Id: Ida6e4626d72de98c0812da6f52b5747de70d038a Reviewed-on: https://git.eclipse.org/r/10169 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java
index d0cb2fb9ce..5ec466f4b5 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java
@@ -27,11 +27,13 @@ import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.linuxtools.internal.perf.PerfCore;
import org.eclipse.linuxtools.internal.perf.PerfPlugin;
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.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -55,6 +57,9 @@ public class PerfOptionsTab extends AbstractLaunchConfigurationTab {
protected Button _chkHideUnresolvedSymbols;
protected Exception ex;
+ protected Composite top;
+ protected ScrolledComposite scrollTop;
+
/**
* @see ILaunchConfigurationTab#getImage()
*/
@@ -99,8 +104,14 @@ public class PerfOptionsTab extends AbstractLaunchConfigurationTab {
//Function adapted from org.eclipse.linuxtools.oprofile.launch.configuration.OprofileSetupTab.java
@Override
public void createControl(Composite parent) {
- Composite top = new Composite(parent, SWT.NONE);
- setControl(top);
+ scrollTop = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+ scrollTop.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ scrollTop.setExpandVertical(true);
+ scrollTop.setExpandHorizontal(true);
+
+ setControl(scrollTop);
+
+ top = new Composite(scrollTop, SWT.NONE);
top.setLayout(new GridLayout());
GridData data;
@@ -172,8 +183,19 @@ public class PerfOptionsTab extends AbstractLaunchConfigurationTab {
});
_chkKernel_SourceLineNumbers = _createCheckButton(p, PerfPlugin.STRINGS_Kernel_SourceLineNumbers);
_chkRecord_Realtime = _createCheckButton(p, PerfPlugin.STRINGS_Record_Realtime);
- _chkMultiplexEvents = _createCheckButton(p, PerfPlugin.STRINGS_Multiplex);
- }
+ _chkMultiplexEvents = _createCheckButton(p, PerfPlugin.STRINGS_Multiplex);
+
+ scrollTop.setContent(top);
+ recomputeSize();
+ updateLaunchConfigurationDialog();
+ }
+
+ protected void recomputeSize() {
+ Point point = top.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ top.setSize(point);
+ scrollTop.setMinSize(point);
+ }
+
//Function adapted from org.eclipse.linuxtools.oprofile.launch.configuration.OprofileSetupTab.java
// Helper function for creating buttons.
private Button _createCheckButton(Composite parent, String label) {

Back to the top