aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2012-08-13 12:37:17 (EDT)
committerAlexander Kurtakov2012-08-14 10:24:57 (EDT)
commitc8c54cd6f9c13a78c42c8263e3a01c10dbb68190 (patch)
tree890a940081c41f10729cdf9064f72f1cff8e86b6
parentf76f4f3b3fdba19a9c31de63078c97577348dab6 (diff)
downloadorg.eclipse.linuxtools-c8c54cd6f9c13a78c42c8263e3a01c10dbb68190.zip
org.eclipse.linuxtools-c8c54cd6f9c13a78c42c8263e3a01c10dbb68190.tar.gz
org.eclipse.linuxtools-c8c54cd6f9c13a78c42c8263e3a01c10dbb68190.tar.bz2
Remove check when creating control for Oprofile/Perf event tabs.
When creating control for Oprofile/Perf event tabs we do not need to check for number of children in the parent composite, this condition is only triggered when clicking on a snapshot configuration, which does not require the resulting functionality of the condition. Change-Id: I121f5111a0e11f22cdf2e26559b2ace2cc815b0d Reviewed-on: https://git.eclipse.org/r/7205 Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> IP-Clean: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java13
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java14
2 files changed, 6 insertions, 21 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java
index 17d0410..7159173 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java
@@ -86,16 +86,9 @@ public class OprofileEventConfigTab extends AbstractLaunchConfigurationTab {
* @param parent the parent composite
*/
public void createControl(Composite parent) {
- Composite top;
-
- if(parent.getChildren().length > 0){
- top = (Composite) parent.getChildren()[0];
- } else {
- top = new Composite(parent, SWT.NONE);
- setControl(top);
- top.setLayout(new GridLayout());
- }
-
+ Composite top = new Composite(parent, SWT.NONE);
+ setControl(top);
+ top.setLayout(new GridLayout());
this.top = top;
}
/**
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java
index 7e54ba5..8930ade 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java
@@ -68,18 +68,10 @@ public class PerfEventsTab extends AbstractLaunchConfigurationTab {
//Function adapted from org.eclipse.linuxtools.oprofile.launch.configuration.OprofileSetupTab.java
@Override
public void createControl(Composite parent) {
- Composite top;
-
- if(parent.getChildren().length > 0){
- top = (Composite) parent.getChildren()[0];
- } else {
- top = new Composite(parent, SWT.NONE);
- setControl(top);
- top.setLayout(new GridLayout());
- }
-
+ Composite top = new Composite(parent, SWT.NONE);
+ setControl(top);
+ top.setLayout(new GridLayout());
this.top = top;
-
}
private void createEventTabs(Composite top, ILaunchConfiguration config){