Search in sources :

Example 6 with AnnotationCategoriesModel

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, "");
}
Also used : LinkedHashSet(java.util.LinkedHashSet) AnnotationCategoriesModel(org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationCategoriesModel) ArrayList(java.util.ArrayList) TmfModelResponse(org.eclipse.tracecompass.tmf.core.response.TmfModelResponse) NonNull(org.eclipse.jdt.annotation.NonNull)

Example 7 with AnnotationCategoriesModel

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;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ITimeGraphDataProvider(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider) AnnotationCategoriesModel(org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationCategoriesModel) IOutputAnnotationProvider(org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.IOutputAnnotationProvider) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) NonNull(org.eclipse.jdt.annotation.NonNull)

Aggregations

AnnotationCategoriesModel (org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationCategoriesModel)7 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 NonNull (org.eclipse.jdt.annotation.NonNull)3 IOutputAnnotationProvider (org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.IOutputAnnotationProvider)3 TmfModelResponse (org.eclipse.tracecompass.tmf.core.response.TmfModelResponse)3 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 LinkedHashSet (java.util.LinkedHashSet)1 Annotation (org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.Annotation)1 AnnotationModel (org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationModel)1 PeriodicAnnotationProvider (org.eclipse.tracecompass.internal.tmf.core.annotations.PeriodicAnnotationProvider)1 TmfTreeCompositeDataProvider (org.eclipse.tracecompass.internal.tmf.core.model.tree.TmfTreeCompositeDataProvider)1 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)1 ITimeGraphDataProvider (org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider)1 TimeGraphEntryModel (org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel)1 TmfTreeDataModel (org.eclipse.tracecompass.tmf.core.model.tree.TmfTreeDataModel)1 TmfTreeModel (org.eclipse.tracecompass.tmf.core.model.tree.TmfTreeModel)1