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(" <br> ");
buf.append(DebuggerBundle.message("breakpoint.property.name.pass.count")).append(": ");
buf.append(getCountFilter());
}
if (isClassFiltersEnabled()) {
buf.append(" <br> ");
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(" <br> ");
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);
}
}
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()]);
}
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;
}
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;
}
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);
}
Aggregations