Search in sources :

Example 1 with TraceCompassFilter

use of org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TraceCompassFilter in project tracecompass by tracecompass.

the class AbstractTimeGraphView method getRegexes.

/**
 * This method build the multimap of regexes by property that will be used to
 * filter the timegraph states
 *
 * Override this method to add other regexes with their properties. The data
 * provider should handle everything after.
 *
 * @return The multimap of regexes by property
 * @since 4.0
 */
@NonNull
protected Multimap<@NonNull Integer, @NonNull String> getRegexes() {
    Multimap<@NonNull Integer, @NonNull String> regexes = HashMultimap.create();
    // $NON-NLS-1$
    @NonNull String dialogRegex = fTimeEventFilterDialog != null ? fTimeEventFilterDialog.getTextBoxRegex() : "";
    if (!dialogRegex.isEmpty()) {
        regexes.put(CoreFilterProperty.DIMMED, dialogRegex);
    }
    Set<@NonNull String> savedFilters = fTimeEventFilterDialog != null ? fTimeEventFilterDialog.getSavedFilters() : Collections.emptySet();
    for (String savedFilter : savedFilters) {
        regexes.put(CoreFilterProperty.EXCLUDE, savedFilter);
        regexes.put(CoreFilterProperty.DIMMED, savedFilter);
    }
    ITmfTrace trace = getTrace();
    if (trace == null) {
        return regexes;
    }
    if (fIsHideRowsFilterActive) {
        getTimeGraphViewer().setSavedFilterStatus(true);
        // $NON-NLS-1$
        regexes.put(CoreFilterProperty.EXCLUDE, "");
    }
    TraceCompassFilter globalFilter = TraceCompassFilter.getFilterForTrace(trace);
    if (globalFilter == null) {
        return regexes;
    }
    regexes.putAll(CoreFilterProperty.DIMMED, globalFilter.getRegexes());
    return regexes;
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) TraceCompassFilter(org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TraceCompassFilter) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) NonNull(org.eclipse.jdt.annotation.NonNull) NonNull(org.eclipse.jdt.annotation.NonNull)

Example 2 with TraceCompassFilter

use of org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TraceCompassFilter in project tracecompass by tracecompass.

the class AbstractSegmentStoreTableViewer method getRegexes.

/**
 * This method build the multimap of regexes by property that will be used
 * to filter the timegraph states
 *
 * Override this method to add other regexes with their properties. The data
 * provider should handle everything after.
 *
 * @return The multimap of regexes by property
 * @since 3.1
 */
protected Multimap<@NonNull Integer, @NonNull String> getRegexes() {
    Multimap<@NonNull Integer, @NonNull String> regexes = HashMultimap.create();
    ITmfTrace trace = fTrace;
    if (trace == null) {
        return regexes;
    }
    Set<String> localRegexes = fLocalRegexes;
    if (!localRegexes.isEmpty()) {
        regexes.putAll(CoreFilterProperty.DIMMED, localRegexes);
    }
    TraceCompassFilter globalFilter = TraceCompassFilter.getFilterForTrace(trace);
    if (globalFilter == null) {
        return regexes;
    }
    regexes.putAll(CoreFilterProperty.DIMMED, globalFilter.getRegexes());
    return regexes;
}
Also used : TraceCompassFilter(org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TraceCompassFilter) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)

Example 3 with TraceCompassFilter

use of org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TraceCompassFilter in project tracecompass by tracecompass.

the class TmfCommonXAxisChartViewer method getRegexes.

/**
 * This method build the multimap of regexes by property that will be used to
 * filter the timegraph states
 *
 * Override this method to add other regexes with their properties. The data
 * provider should handle everything after.
 *
 * @return The multimap of regexes by property
 */
@NonNull
protected Multimap<@NonNull Integer, @NonNull String> getRegexes() {
    Multimap<@NonNull Integer, @NonNull String> regexes = HashMultimap.create();
    ITmfTrace trace = getTrace();
    if (trace == null) {
        return regexes;
    }
    TraceCompassFilter globalFilter = TraceCompassFilter.getFilterForTrace(trace);
    if (globalFilter == null) {
        return regexes;
    }
    regexes.putAll(IFilterProperty.DIMMED, globalFilter.getRegexes());
    return regexes;
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) TraceCompassFilter(org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TraceCompassFilter) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) NonNull(org.eclipse.jdt.annotation.NonNull)

Aggregations

TraceCompassFilter (org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TraceCompassFilter)3 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 NonNull (org.eclipse.jdt.annotation.NonNull)2