Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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