use of org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationCategoriesModel in project tracecompass by tracecompass.
the class CustomAnnotationProvider method fetchAnnotationCategories.
@Override
@NonNull
public TmfModelResponse<@NonNull AnnotationCategoriesModel> fetchAnnotationCategories(@NonNull Map<@NonNull String, @NonNull Object> fetchParameters, @Nullable IProgressMonitor monitor) {
Set<@NonNull String> categories = new LinkedHashSet<>();
for (CustomPeriodicAnnotationProvider annotationProvider : fAnnotationProviders) {
TmfModelResponse<@NonNull AnnotationCategoriesModel> response = annotationProvider.fetchAnnotationCategories(fetchParameters, monitor);
AnnotationCategoriesModel model = response.getModel();
if (model != null) {
categories.addAll(model.getAnnotationCategories());
getSubMarkerCategories(categories, annotationProvider.getSubMarkers());
}
}
// $NON-NLS-1$
return new TmfModelResponse<>(new AnnotationCategoriesModel(new ArrayList<>(categories)), Status.COMPLETED, "");
}
use of org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationCategoriesModel in project tracecompass by tracecompass.
the class BaseDataProviderTimeGraphView method getViewMarkerCategories.
@Override
@NonNull
protected List<String> getViewMarkerCategories() {
List<String> viewMarkerCategories = super.getViewMarkerCategories();
Collection<ITimeGraphDataProvider<? extends @NonNull TimeGraphEntryModel>> providers = getProviders(getTrace());
if (providers.isEmpty()) {
return viewMarkerCategories;
}
for (ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider : providers) {
if (provider instanceof IOutputAnnotationProvider) {
Map<@NonNull String, @NonNull Object> parameters = getFetchAnnotationCategoriesParameters();
TmfModelResponse<@NonNull AnnotationCategoriesModel> response = ((IOutputAnnotationProvider) provider).fetchAnnotationCategories(parameters, new NullProgressMonitor());
AnnotationCategoriesModel model = response.getModel();
if (model != null) {
List<@NonNull String> categories = model.getAnnotationCategories();
viewMarkerCategories.addAll(categories);
fMarkerCategories.put(provider, categories);
}
}
}
return viewMarkerCategories;
}
Aggregations