Search in sources :

Example 1 with ClassFilter

use of com.intellij.ui.classFilter.ClassFilter in project intellij-community by JetBrains.

the class BreakpointWithHighlighter method getDescription.

@SuppressWarnings("HardCodedStringLiteral")
@NotNull
public String getDescription() {
    final StringBuilder buf = StringBuilderSpinAllocator.alloc();
    try {
        buf.append(getDisplayName());
        if (isCountFilterEnabled()) {
            buf.append("&nbsp;<br>&nbsp;");
            buf.append(DebuggerBundle.message("breakpoint.property.name.pass.count")).append(": ");
            buf.append(getCountFilter());
        }
        if (isClassFiltersEnabled()) {
            buf.append("&nbsp;<br>&nbsp;");
            buf.append(DebuggerBundle.message("breakpoint.property.name.class.filters")).append(": ");
            ClassFilter[] classFilters = getClassFilters();
            for (ClassFilter classFilter : classFilters) {
                buf.append(classFilter.getPattern()).append(" ");
            }
        }
        if (isInstanceFiltersEnabled()) {
            buf.append("&nbsp;<br>&nbsp;");
            buf.append(DebuggerBundle.message("breakpoint.property.name.instance.filters"));
            InstanceFilter[] instanceFilters = getInstanceFilters();
            for (InstanceFilter instanceFilter : instanceFilters) {
                buf.append(Long.toString(instanceFilter.getId())).append(" ");
            }
        }
        return buf.toString();
    } finally {
        StringBuilderSpinAllocator.dispose(buf);
    }
}
Also used : ClassFilter(com.intellij.ui.classFilter.ClassFilter) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ClassFilter

use of com.intellij.ui.classFilter.ClassFilter in project intellij-community by JetBrains.

the class ClassFiltersField method reloadFilters.

private void reloadFilters() {
    String filtersText = getText();
    ArrayList<ClassFilter> classFilters = new ArrayList<>();
    ArrayList<ClassFilter> exclusionFilters = new ArrayList<>();
    int startFilter = -1;
    for (int i = 0; i <= filtersText.length(); i++) {
        if (i < filtersText.length() && !Character.isWhitespace(filtersText.charAt(i))) {
            if (startFilter == -1) {
                startFilter = i;
            }
        } else {
            if (startFilter >= 0) {
                if (filtersText.charAt(startFilter) == '-') {
                    exclusionFilters.add(new ClassFilter(filtersText.substring(startFilter + 1, i)));
                } else {
                    classFilters.add(new ClassFilter(filtersText.substring(startFilter, i)));
                }
                startFilter = -1;
            }
        }
    }
    Arrays.stream(myClassFilters).filter(f -> !f.isEnabled()).forEach(classFilters::add);
    Arrays.stream(myClassExclusionFilters).filter(f -> !f.isEnabled()).forEach(classFilters::add);
    myClassFilters = classFilters.toArray(new ClassFilter[classFilters.size()]);
    myClassExclusionFilters = exclusionFilters.toArray(new ClassFilter[exclusionFilters.size()]);
}
Also used : ClassFilter(com.intellij.ui.classFilter.ClassFilter) Arrays(java.util.Arrays) DialogWrapper(com.intellij.openapi.ui.DialogWrapper) StreamEx(one.util.streamex.StreamEx) Project(com.intellij.openapi.project.Project) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) ArrayList(java.util.ArrayList) ClassFilter(com.intellij.ui.classFilter.ClassFilter) ArrayList(java.util.ArrayList)

Example 3 with ClassFilter

use of com.intellij.ui.classFilter.ClassFilter in project intellij-community by JetBrains.

the class DebuggerUtilsEx method create.

public static ClassFilter create(Element element) throws InvalidDataException {
    ClassFilter filter = new ClassFilter();
    DefaultJDOMExternalizer.readExternal(filter, element);
    return filter;
}
Also used : ClassFilter(com.intellij.ui.classFilter.ClassFilter)

Example 4 with ClassFilter

use of com.intellij.ui.classFilter.ClassFilter in project kotlin by JetBrains.

the class DebuggerSteppingHelper method getActiveFilters.

// copied from DebugProcessImpl.getActiveFilters
@NotNull
private static List<ClassFilter> getActiveFilters() {
    List<ClassFilter> activeFilters = new ArrayList<ClassFilter>();
    DebuggerSettings settings = DebuggerSettings.getInstance();
    if (settings.TRACING_FILTERS_ENABLED) {
        for (ClassFilter filter : settings.getSteppingFilters()) {
            if (filter.isEnabled()) {
                activeFilters.add(filter);
            }
        }
    }
    for (DebuggerClassFilterProvider provider : Extensions.getExtensions(DebuggerClassFilterProvider.EP_NAME)) {
        for (ClassFilter filter : provider.getFilters()) {
            if (filter.isEnabled()) {
                activeFilters.add(filter);
            }
        }
    }
    return activeFilters;
}
Also used : DebuggerSettings(com.intellij.debugger.settings.DebuggerSettings) DebuggerClassFilterProvider(com.intellij.ui.classFilter.DebuggerClassFilterProvider) ClassFilter(com.intellij.ui.classFilter.ClassFilter) ArrayList(java.util.ArrayList) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with ClassFilter

use of com.intellij.ui.classFilter.ClassFilter in project kotlin by JetBrains.

the class KotlinBreakpointFiltersPanel method updateClassFilterEditor.

private void updateClassFilterEditor(boolean updateText) {
    List<String> filters = new ArrayList<String>();
    for (ClassFilter classFilter : myClassFilters) {
        if (classFilter.isEnabled()) {
            filters.add(classFilter.getPattern());
        }
    }
    List<String> excludeFilters = new ArrayList<String>();
    for (ClassFilter classFilter : myClassExclusionFilters) {
        if (classFilter.isEnabled()) {
            excludeFilters.add("-" + classFilter.getPattern());
        }
    }
    if (updateText) {
        String editorText = StringUtil.join(filters, " ");
        if (!filters.isEmpty()) {
            editorText += " ";
        }
        editorText += StringUtil.join(excludeFilters, " ");
        myClassFiltersField.setText(editorText);
    }
    int width = (int) Math.sqrt(myClassExclusionFilters.length + myClassFilters.length) + 1;
    String tipText = concatWithEx(filters, " ", width, "\n");
    if (!filters.isEmpty()) {
        tipText += "\n";
    }
    tipText += concatWithEx(excludeFilters, " ", width, "\n");
    myClassFiltersField.getTextField().setToolTipText(tipText);
}
Also used : ClassFilter(com.intellij.ui.classFilter.ClassFilter) ArrayList(java.util.ArrayList) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint)

Aggregations

ClassFilter (com.intellij.ui.classFilter.ClassFilter)18 ArrayList (java.util.ArrayList)6 Project (com.intellij.openapi.project.Project)3 NotNull (org.jetbrains.annotations.NotNull)3 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)2 DebuggerSettings (com.intellij.debugger.settings.DebuggerSettings)2 PsiClass (com.intellij.psi.PsiClass)2 DebuggerClassFilterProvider (com.intellij.ui.classFilter.DebuggerClassFilterProvider)2 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)2 Element (org.jdom.Element)2 CoverageRunner (com.intellij.coverage.CoverageRunner)1 IDEACoverageRunner (com.intellij.coverage.IDEACoverageRunner)1 JavaCoverageRunner (com.intellij.coverage.JavaCoverageRunner)1 InstanceFilter (com.intellij.debugger.InstanceFilter)1 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)1 TextWithImportsImpl (com.intellij.debugger.engine.evaluation.TextWithImportsImpl)1 DebuggerCommandImpl (com.intellij.debugger.engine.events.DebuggerCommandImpl)1 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)1 StackFrameProxyImpl (com.intellij.debugger.jdi.StackFrameProxyImpl)1 JavaCoverageEnabledConfiguration (com.intellij.execution.configurations.coverage.JavaCoverageEnabledConfiguration)1