use of com.intellij.ui.classFilter.ClassFilter in project intellij-community by JetBrains.
the class JavaCoverageEnabledConfiguration method writeExternal.
@Override
public void writeExternal(Element element) throws WriteExternalException {
// just for backward compatibility with settings format before "Huge Coverage Refactoring"
// see [IDEA-56800] ProjectRunConfigurationManager component: "coverage" extension: "merge" attribute is misplaced
// here we can't use super.writeExternal(...) due to differences in format between IDEA 10 and IDEA 9.x
// enabled
element.setAttribute(COVERAGE_ENABLED_ATTRIBUTE_NAME, String.valueOf(isCoverageEnabled()));
// merge with prev
element.setAttribute(COVERAGE_MERGE_ATTRIBUTE_NAME, String.valueOf(myIsMergeWithPreviousResults));
if (myIsMergeWithPreviousResults && mySuiteToMergeWith != null) {
element.setAttribute(COVERAGE_MERGE_SUITE_ATT_NAME, mySuiteToMergeWith);
}
// track per test
final boolean trackPerTestCoverage = isTrackPerTestCoverage();
if (!trackPerTestCoverage) {
element.setAttribute(TRACK_PER_TEST_COVERAGE_ATTRIBUTE_NAME, String.valueOf(trackPerTestCoverage));
}
// sampling
final boolean sampling = isSampling();
if (sampling) {
element.setAttribute(SAMPLING_COVERAGE_ATTRIBUTE_NAME, String.valueOf(sampling));
}
// test folders
final boolean trackTestFolders = isTrackTestFolders();
if (trackTestFolders) {
element.setAttribute(TRACK_TEST_FOLDERS, String.valueOf(trackTestFolders));
}
// runner
final CoverageRunner coverageRunner = getCoverageRunner();
final String runnerId = getRunnerId();
if (coverageRunner != null) {
element.setAttribute(COVERAGE_RUNNER, coverageRunner.getId());
} else if (runnerId != null) {
element.setAttribute(COVERAGE_RUNNER, runnerId);
}
// patterns
if (myCoveragePatterns != null) {
for (ClassFilter pattern : myCoveragePatterns) {
@NonNls final Element patternElement = new Element(COVERAGE_PATTERN_ELEMENT_NAME);
DefaultJDOMExternalizer.writeExternal(pattern, patternElement);
element.addContent(patternElement);
}
}
}
use of com.intellij.ui.classFilter.ClassFilter in project intellij-community by JetBrains.
the class ExecutionWithDebuggerToolsTestCase method readClassFilters.
private static Pair<ClassFilter[], ClassFilter[]> readClassFilters(String filtersString) {
ArrayList<ClassFilter> include = new ArrayList<>();
ArrayList<ClassFilter> exclude = new ArrayList<>();
for (String s : filtersString.split(",")) {
ClassFilter filter = new ClassFilter();
filter.setEnabled(true);
if (s.startsWith("-")) {
exclude.add(filter);
s = s.substring(1);
} else {
include.add(filter);
}
filter.setPattern(s);
}
return Pair.create(include.toArray(ClassFilter.EMPTY_ARRAY), exclude.toArray(ClassFilter.EMPTY_ARRAY));
}
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);
}
use of com.intellij.ui.classFilter.ClassFilter in project kotlin by JetBrains.
the class KotlinBreakpointFiltersPanel method reloadClassFilters.
private void reloadClassFilters() {
String filtersText = myClassFiltersField.getText();
ArrayList<ClassFilter> classFilters = new ArrayList<ClassFilter>();
ArrayList<ClassFilter> exclusionFilters = new ArrayList<ClassFilter>();
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;
}
}
}
for (ClassFilter classFilter : myClassFilters) {
if (!classFilter.isEnabled()) {
classFilters.add(classFilter);
}
}
for (ClassFilter classFilter : myClassExclusionFilters) {
if (!classFilter.isEnabled()) {
exclusionFilters.add(classFilter);
}
}
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 DebugProcessImpl method getActiveFilters.
@NotNull
private static List<ClassFilter> getActiveFilters() {
DebuggerSettings settings = DebuggerSettings.getInstance();
StreamEx<ClassFilter> stream = StreamEx.of(Extensions.getExtensions(DebuggerClassFilterProvider.EP_NAME)).flatCollection(DebuggerClassFilterProvider::getFilters);
if (settings.TRACING_FILTERS_ENABLED) {
stream = stream.prepend(settings.getSteppingFilters());
}
return stream.filter(ClassFilter::isEnabled).toList();
}
Aggregations