Skip to content

Commit 539acbb

Browse files
committed
linux: set auto-expand-level in ResourcesStatusDataProvider
Setting the auto-expand-level to 1 of the returned TmfTreeModel when calling fetchTree() will indicate to the clients that only the top-level should be expanded and their children supposed to be collapsed. With this trace server clients can apply thhis and it fixes FE issue eclipse-cdt-cloud/theia-trace-extension#801 Note: The classic Eclipse UI has been doing this in the UI code without that setting (see ResourcesView). Signed-off-by: Bernd Hufmann <[email protected]>
1 parent cbf0b32 commit 539acbb

File tree

1 file changed

+5
-1
lines changed
  • analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/resourcesstatus

1 file changed

+5
-1
lines changed

analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/resourcesstatus/ResourcesStatusDataProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,11 @@ protected ResourcesStatusDataProvider(@NonNull ITmfTrace trace, @NonNull TmfStat
274274
}
275275
Collections.sort(builder, COMPARATOR);
276276

277-
return new TmfTreeModel<>(Collections.emptyList(), ImmutableList.copyOf(builder));
277+
TmfTreeModel.Builder<@NonNull ResourcesEntryModel> treeModelBuilder = new TmfTreeModel.Builder<@NonNull ResourcesEntryModel>()
278+
.setAutoExpandLevel(1) // only expand top level
279+
.setEntries(ImmutableList.copyOf(builder));
280+
281+
return treeModelBuilder.build();
278282
}
279283

280284
private static long getCpuFrequency(@NonNull ITmfStateSystem ss, int cpuQuark, @NonNull String freqAttribute) throws StateSystemDisposedException {

0 commit comments

Comments
 (0)