Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2014-09-10 13:43:19 -0400
committerMarc-Andre Laperle2014-09-11 13:15:53 -0400
commitdf08ef1869afecb778490f255c809a6278b38f81 (patch)
tree3f6f3ae7f5eee63d58d84b861d30ac4661339f7a
parentd1c34e4239a724a2c85d0cc6355c9d62c31b2b7c (diff)
downloadorg.eclipse.linuxtools-df08ef1869afecb778490f255c809a6278b38f81.tar.gz
org.eclipse.linuxtools-df08ef1869afecb778490f255c809a6278b38f81.tar.xz
org.eclipse.linuxtools-df08ef1869afecb778490f255c809a6278b38f81.zip
tmf: Fix untyped traces being shown in the select traces dialog
Bug: 443737 Change-Id: Ifc1902341a4673a268ac0d540346a50cb5e5c9cc Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/33202 Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com> (cherry picked from commit fac6f1e79c65078f1e3acbadc85d6d2c3e206837) Reviewed-on: https://git.eclipse.org/r/33254
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java
index bf7310f250..d464852efb 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java
@@ -16,7 +16,9 @@
package org.eclipse.linuxtools.tmf.ui.project.wizards;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
@@ -42,6 +44,7 @@ import org.eclipse.jface.viewers.TreeViewerColumn;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceType;
import org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfNavigatorContentProvider;
@@ -151,21 +154,35 @@ public class SelectTracesWizardPage extends WizardPage {
@Override
public Object[] getElements(Object inputElement) {
- return super.getChildren(inputElement);
+ return getChildren(inputElement);
}
@Override
public synchronized Object[] getChildren(Object parentElement) {
// We only care about the content of trace folders
if (parentElement instanceof TmfTraceFolder) {
- return super.getChildren(parentElement);
+ Object[] children = super.getChildren(parentElement);
+ List<ITmfProjectModelElement> filteredChildren = new ArrayList<>();
+ for (Object child : children) {
+ if (child instanceof TmfTraceElement) {
+ TmfTraceElement traceElement = (TmfTraceElement) child;
+ String traceType = traceElement.getTraceType();
+ if (traceType != null && TmfTraceType.getTraceType(traceType) != null) {
+ filteredChildren.add(traceElement);
+ }
+ } else if (child instanceof TmfTraceFolder) {
+ filteredChildren.add((TmfTraceFolder) child);
+ }
+ }
+ return filteredChildren.toArray();
}
return null;
}
@Override
public boolean hasChildren(Object element) {
- return getChildren(element) != null;
+ Object[] children = getChildren(element);
+ return children != null && children.length > 0;
}
};
fCheckboxTreeViewer.setContentProvider(fContentProvider);

Back to the top